From d2fc86bb00c0322a07469f29d3e1e4531c1ef624 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Fri, 4 Apr 2025 18:33:22 +0700 Subject: [PATCH 01/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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/16] 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;