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 decision_proposal;
85pub mod group;
86pub mod moderation_charter;
87pub mod shielded;
88pub mod withdrawal;
89
90pub use async_trait;
91
92#[cfg(feature = "bls-signatures")]
93pub use bls::native_bls;
94pub use bls::BlsModule;
95
96pub mod prelude {
97
98    pub use crate::data_contract::DataContract;
99    #[cfg(feature = "extended-document")]
100    pub use crate::document::ExtendedDocument;
101    pub use crate::errors::ProtocolError;
102    pub use crate::identifier::Identifier;
103    pub use crate::identity::state_transition::asset_lock_proof::AssetLockProof;
104    pub use crate::identity::Identity;
105    pub use crate::identity::IdentityPublicKey;
106    #[cfg(feature = "validation")]
107    pub use crate::validation::ConsensusValidationResult;
108
109    pub type EpochInterval = u16;
110
111    pub type BlockHeight = u64;
112
113    pub type FeeMultiplier = u64;
114
115    pub type BlockHeightInterval = u64;
116
117    pub type CoreBlockHeight = u32;
118    pub type TimestampMillis = u64;
119
120    pub type TimestampMillisInterval = u64;
121
122    pub type StartAtIncluded = bool;
123
124    pub type TimestampIncluded = bool;
125    pub type Revision = u64;
126
127    /// Identity nonces are split 24 bits are for the recent documents, 40 bits are for the identity.
128    pub type IdentityNonce = u64;
129
130    /// The Key of type none is only 32 bits, which means an address can be used up to 4 billion times.
131    pub type AddressNonce = u32;
132
133    pub type SenderKeyIndex = u32;
134    pub type RecipientKeyIndex = u32;
135
136    /// 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.
137    pub type RootEncryptionKeyIndex = u32;
138
139    /// The index at which to derive the root encryption key.
140    pub type DerivationEncryptionKeyIndex = u32;
141
142    /// UserFeeIncrease is the additional percentage of the processing fee.
143    /// A 1 here means we pay 1% more in processing fees. A 100 means we pay 100% more.
144    pub type UserFeeIncrease = u16;
145}
146
147pub use bincode;
148pub use bincode::enc::Encode;
149#[cfg(feature = "data-contracts")]
150pub use data_contracts;
151#[cfg(feature = "ed25519-dalek")]
152pub use ed25519_dalek;
153#[cfg(feature = "jsonschema")]
154pub use jsonschema;
155pub use platform_serialization;
156pub use platform_serialization::de::{BorrowDecode, Decode, DefaultBorrowDecode, DefaultDecode};
157pub use platform_value;