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
18#[cfg(feature = "core_key_wallet")]
19pub use key_wallet;
20
21#[cfg(feature = "core_key_wallet_manager")]
22pub use key_wallet_manager;
23
24#[cfg(feature = "core_spv")]
25pub use dash_spv;
26
27#[cfg(feature = "core_rpc_client")]
28pub use dashcore_rpc;
29
30#[cfg(feature = "client")]
31pub use dash_platform_protocol::DashPlatformProtocol;
32pub use errors::*;
33
34pub mod data_contract;
35pub mod document;
36pub mod identifier;
37pub mod identity;
38pub mod metadata;
39#[cfg(feature = "state-transitions")]
40pub mod state_transition;
41pub mod util;
42pub mod version;
43
44pub mod errors;
45
46pub mod validation;
47
48#[cfg(feature = "client")]
49pub mod dash_platform_protocol;
50
51mod bls;
52
53#[cfg(feature = "fixtures-and-mocks")]
54pub mod tests;
55
56pub mod asset_lock;
57pub mod balances;
58pub mod block;
59/// Core subsidy
60pub mod core_subsidy;
61pub mod fee;
62pub mod nft;
63pub mod prefunded_specialized_balance;
64pub mod serialization;
65#[cfg(any(
66    feature = "message-signing",
67    feature = "message-signature-verification"
68))]
69pub mod signing;
70#[cfg(feature = "system_contracts")]
71pub mod system_data_contracts;
72
73pub mod tokens;
74
75pub mod voting;
76
77#[cfg(feature = "core-types")]
78pub mod core_types;
79
80pub mod address_funds;
81pub mod contract_group;
82pub mod group;
83pub mod moderation_charter;
84pub mod shielded;
85pub mod withdrawal;
86
87pub use async_trait;
88
89pub use bls::*;
90
91pub mod prelude {
92
93    pub use crate::data_contract::DataContract;
94    #[cfg(feature = "extended-document")]
95    pub use crate::document::ExtendedDocument;
96    pub use crate::errors::ProtocolError;
97    pub use crate::identifier::Identifier;
98    pub use crate::identity::state_transition::asset_lock_proof::AssetLockProof;
99    pub use crate::identity::Identity;
100    pub use crate::identity::IdentityPublicKey;
101    #[cfg(feature = "validation")]
102    pub use crate::validation::ConsensusValidationResult;
103
104    pub type EpochInterval = u16;
105
106    pub type BlockHeight = u64;
107
108    pub type FeeMultiplier = u64;
109
110    pub type BlockHeightInterval = u64;
111
112    pub type CoreBlockHeight = u32;
113    pub type TimestampMillis = u64;
114
115    pub type TimestampMillisInterval = u64;
116
117    pub type StartAtIncluded = bool;
118
119    pub type TimestampIncluded = bool;
120    pub type Revision = u64;
121
122    /// Identity nonces are split 24 bits are for the recent documents, 40 bits are for the identity.
123    pub type IdentityNonce = u64;
124
125    /// The Key of type none is only 32 bits, which means an address can be used up to 4 billion times.
126    pub type AddressNonce = u32;
127
128    pub type SenderKeyIndex = u32;
129    pub type RecipientKeyIndex = u32;
130
131    /// 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.
132    pub type RootEncryptionKeyIndex = u32;
133
134    /// The index at which to derive the root encryption key.
135    pub type DerivationEncryptionKeyIndex = u32;
136
137    /// UserFeeIncrease is the additional percentage of the processing fee.
138    /// A 1 here means we pay 1% more in processing fees. A 100 means we pay 100% more.
139    pub type UserFeeIncrease = u16;
140}
141
142pub use bincode;
143pub use bincode::enc::Encode;
144#[cfg(feature = "bls-signatures")]
145pub use dashcore::blsful as bls_signatures;
146#[cfg(feature = "ed25519-dalek")]
147pub use dashcore::ed25519_dalek;
148#[cfg(feature = "data-contracts")]
149pub use data_contracts;
150#[cfg(feature = "jsonschema")]
151pub use jsonschema;
152pub use platform_serialization;
153pub use platform_serialization::de::{BorrowDecode, Decode, DefaultBorrowDecode, DefaultDecode};
154pub use platform_value;