neo3/prelude.rs
1/// # Neo SDK Prelude (v0.1.8)
2///
3/// Convenient imports for commonly used types and traits to make working with Neo more ergonomic.
4///
5/// This prelude module provides a single import to access the most commonly used
6/// components of the NeoRust SDK. Import it with:
7///
8/// ```rust
9/// use neo3::prelude::*;
10/// ```
11///
12/// ## Included Categories
13///
14/// The prelude includes:
15///
16/// - **Core Types**: Basic blockchain primitives like Address, ScriptHash
17/// - **Errors**: The unified NeoError type for error handling
18/// - **Contracts**: Types for interacting with Neo smart contracts
19/// - **Wallets**: Account and wallet management
20/// - **Clients**: RPC and other client interfaces
21/// - **Builders**: Transaction construction utilities
22/// - **Extensions**: Utility traits and extensions
23///
24/// ## When to Use
25///
26/// The prelude is ideal for applications that use multiple Neo features.
27/// For more targeted imports, you can import specific modules directly.
28// Core error type
29pub use crate::neo_error::NeoError;
30
31// === Core Types ===
32// Basic blockchain types
33pub use crate::neo_types::{
34 Address, AddressOrScriptHash, Base64Encode, Bytes, NameOrAddress, ScriptHash,
35 ScriptHashExtension, StringExt, ToBase58,
36};
37
38// Contract-related types
39pub use crate::neo_types::{
40 ContractManifest, ContractParameter, ContractParameterType, ContractState, InvocationResult,
41 NefFile,
42};
43
44// VM and runtime types
45pub use crate::neo_types::{OpCode, StackItem, VMState};
46
47// NNS-related types
48pub use crate::neo_types::NNSName;
49
50// Common external types
51pub use primitive_types::{H160, H256, U256};
52pub use serde_json::Value as ParameterValue;
53pub use url::Url;
54
55// === Serialization Helpers ===
56pub use crate::neo_types::{
57 // H160/H256 serialization
58 deserialize_h160,
59 deserialize_h256,
60 // Other serialization helpers
61 deserialize_script_hash,
62 // U256 serialization
63 deserialize_u256,
64 deserialize_u64,
65 deserialize_vec_h256,
66 deserialize_vec_u256,
67 deserialize_wildcard,
68 serialize_h160,
69 serialize_h256,
70 serialize_script_hash,
71 serialize_u256,
72 serialize_u64,
73
74 serialize_vec_h256,
75
76 serialize_vec_u256,
77 serialize_wildcard,
78};
79
80// === Core Functionality Modules ===
81// These are aliased module names for user convenience
82pub use crate::{
83 neo_builder as builder, neo_clients as providers, neo_codec as codec, neo_config as config,
84 neo_crypto as crypto, neo_protocol as protocol, neo_wallets as wallets, neo_x as x,
85};
86
87// === Extension modules ===
88// These are full modules that provide specialized functionality
89pub use crate::neo_fs; // NeoFS distributed storage
90
91// Re-export ValueExtension
92pub use crate::neo_types::ValueExtension;
93
94// === Utility Traits ===
95// Hex and base64 encoding/decoding utilities
96pub use crate::neo_crypto::utils::{FromBase64String, FromHexString, ToHexString};