Skip to main content

dpp/
lib.rs

1#![cfg_attr(docsrs, feature(doc_cfg))]
2// Coding conventions .
3#![forbid(unsafe_code)]
4//#![deny(missing_docs)]
5#![allow(dead_code)]
6// `ProtocolError` is the Err type of hundreds of fns here; boxing it
7// would add indirection to every return. Removing the allow needs a
8// crate-wide error refactor.
9#![allow(clippy::result_large_err)]
10// Covers static-dispatch async trait methods; dyn-safe traits like
11// `Signer` still use `#[async_trait]` at their own declaration.
12#![allow(async_fn_in_trait)]
13
14extern crate core;
15
16pub use dashcore;
17/// Low-level ECDSA primitives used by Platform signature validation.
18pub use secp256k1;
19
20#[cfg(feature = "core_key_wallet")]
21pub use key_wallet;
22
23#[cfg(feature = "core_key_wallet_manager")]
24pub use key_wallet_manager;
25
26#[cfg(feature = "core_spv")]
27pub use dash_spv;
28
29#[cfg(feature = "core_rpc_client")]
30pub use dashcore_rpc;
31
32#[cfg(feature = "client")]
33pub use dash_platform_protocol::DashPlatformProtocol;
34pub use errors::*;
35
36pub mod data_contract;
37pub mod document;
38pub mod identifier;
39pub mod identity;
40pub mod metadata;
41#[cfg(feature = "state-transitions")]
42pub mod state_transition;
43pub mod util;
44pub mod version;
45
46pub mod errors;
47
48pub mod validation;
49
50#[cfg(feature = "client")]
51pub mod dash_platform_protocol;
52
53pub mod bls;
54
55#[cfg(feature = "fixtures-and-mocks")]
56pub mod tests;
57
58pub mod asset_lock;
59pub mod balances;
60pub mod block;
61/// Core subsidy
62pub mod core_subsidy;
63pub mod fee;
64pub mod nft;
65pub mod prefunded_specialized_balance;
66pub mod serialization;
67#[cfg(any(
68    feature = "message-signing",
69    feature = "message-signature-verification"
70))]
71pub mod signing;
72#[cfg(feature = "system_contracts")]
73pub mod system_data_contracts;
74
75pub mod tokens;
76
77pub mod voting;
78
79#[cfg(feature = "core-types")]
80pub mod core_types;
81
82pub mod address_funds;
83pub mod contract_group;
84pub mod group;
85pub mod moderation_charter;
86pub mod shielded;
87pub mod withdrawal;
88
89pub use async_trait;
90
91#[cfg(feature = "bls-signatures")]
92pub use bls::native_bls;
93pub use bls::BlsModule;
94
95pub mod prelude {
96
97    pub use crate::data_contract::DataContract;
98    #[cfg(feature = "extended-document")]
99    pub use crate::document::ExtendedDocument;
100    pub use crate::errors::ProtocolError;
101    pub use crate::identifier::Identifier;
102    pub use crate::identity::state_transition::asset_lock_proof::AssetLockProof;
103    pub use crate::identity::Identity;
104    pub use crate::identity::IdentityPublicKey;
105    #[cfg(feature = "validation")]
106    pub use crate::validation::ConsensusValidationResult;
107
108    pub type EpochInterval = u16;
109
110    pub type BlockHeight = u64;
111
112    pub type FeeMultiplier = u64;
113
114    pub type BlockHeightInterval = u64;
115
116    pub type CoreBlockHeight = u32;
117    pub type TimestampMillis = u64;
118
119    pub type TimestampMillisInterval = u64;
120
121    pub type StartAtIncluded = bool;
122
123    pub type TimestampIncluded = bool;
124    pub type Revision = u64;
125
126    /// Identity nonces are split 24 bits are for the recent documents, 40 bits are for the identity.
127    pub type IdentityNonce = u64;
128
129    /// The Key of type none is only 32 bits, which means an address can be used up to 4 billion times.
130    pub type AddressNonce = u32;
131
132    pub type SenderKeyIndex = u32;
133    pub type RecipientKeyIndex = u32;
134
135    /// The index of the user's key that is used to derive keys that will be used to encrypt the contact's user id in encToUserId and the private data.
136    pub type RootEncryptionKeyIndex = u32;
137
138    /// The index at which to derive the root encryption key.
139    pub type DerivationEncryptionKeyIndex = u32;
140
141    /// UserFeeIncrease is the additional percentage of the processing fee.
142    /// A 1 here means we pay 1% more in processing fees. A 100 means we pay 100% more.
143    pub type UserFeeIncrease = u16;
144}
145
146pub use bincode;
147pub use bincode::enc::Encode;
148#[cfg(feature = "data-contracts")]
149pub use data_contracts;
150#[cfg(feature = "ed25519-dalek")]
151pub use ed25519_dalek;
152#[cfg(feature = "jsonschema")]
153pub use jsonschema;
154pub use platform_serialization;
155pub use platform_serialization::de::{BorrowDecode, Decode, DefaultBorrowDecode, DefaultDecode};
156pub use platform_value;