1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// © 2024 Max Karou. All Rights Reserved.
// Licensed under Apache Version 2.0, or MIT License, at your discretion.
//
// Apache License: http://www.apache.org/licenses/LICENSE-2.0
// MIT License: http://opensource.org/licenses/MIT
//
// Usage of this file is permitted solely under a sanctioned license.

#![deny(warnings, clippy::pedantic)]
#![allow(
    clippy::module_name_repetitions,
    clippy::expl_impl_clone_on_copy,
    clippy::missing_panics_doc,
    clippy::missing_errors_doc,
    clippy::must_use_candidate,
    clippy::upper_case_acronyms,
    clippy::too_many_arguments,
    clippy::large_enum_variant,
    clippy::result_large_err,
    clippy::similar_names
)]

#[cfg(feature = "clarity")]
pub mod clarity;

#[cfg(feature = "crypto")]
pub mod crypto;

#[cfg(feature = "rpc")]
pub mod rpc;

#[cfg(feature = "transaction")]
pub mod transaction;

#[cfg(feature = "wallet-sdk")]
pub mod wallet;

#[cfg(feature = "derive")]
#[path = "derive.rs"]
mod __derive;

#[cfg(feature = "derive")]
pub mod derive {
    pub use stacks_derive::*;

    pub use crate::__derive::*;
}

#[derive(Debug, thiserror::Error)]
pub enum Error {
    /// `crypto::b58` crate errors.
    #[error(transparent)]
    Base58(#[from] crypto::b58::Error),
    /// `crypto::c32` crate errors.
    #[error(transparent)]
    C32(#[from] crypto::c32::Error),
    /// `crypto::hex` crate errors.
    #[error(transparent)]
    Hex(#[from] crypto::hex::Error),
    #[cfg(feature = "clarity")]
    /// `clarity` crate errors.
    #[error(transparent)]
    Clarity(#[from] clarity::Error),
    #[cfg(feature = "transaction")]
    /// `transaction` crate errors.
    #[error(transparent)]
    Transaction(#[from] transaction::Error),
    #[cfg(feature = "rpc")]
    /// `rpc` crate errors.
    #[error(transparent)]
    RPC(#[from] rpc::Error),
    #[cfg(feature = "wallet-sdk")]
    /// `wallet` crate errors.
    #[error(transparent)]
    Wallet(#[from] wallet::Error),
    #[cfg(feature = "derive")]
    /// `derive` crate errors.
    #[error(transparent)]
    Derive(#[from] derive::Error),
}

pub use secp256k1::PublicKey;
pub use secp256k1::SecretKey;