Skip to content

Commit 2e05c5c

Browse files
committed
feat: declare nostd feature in payjoin/Cargo.toml
1 parent 6193026 commit 2e05c5c

1 file changed

Lines changed: 30 additions & 15 deletions

File tree

payjoin/Cargo.toml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,36 @@ exclude = ["tests"]
1919
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
2020

2121
[features]
22-
default = ["v2"]
23-
#[doc = "Core features for payjoin state machines"]
24-
_core = [
22+
default = ["std", "v2", "v2-ohttp"]
23+
24+
alloc = []
25+
26+
std = [
27+
"alloc",
28+
"bitcoin/rand",
2529
"bitcoin/rand-std",
26-
"dep:http",
30+
"bitcoin/base64",
2731
"serde_json",
2832
"dep:percent-encoding-rfc3986",
2933
"bitcoin_uri",
30-
"serde",
31-
"bitcoin/serde",
3234
]
33-
directory = []
34-
v1 = ["_core"]
35-
v2 = ["_core", "hpke", "bhttp", "ohttp", "directory"]
35+
#[doc = "Core features for payjoin state machines"]
36+
_core = ["alloc", "serde", "bitcoin/serde"]
37+
38+
directory = ["alloc", "_core"]
39+
v1 = ["_core", "std"]
40+
41+
v2 = ["_core", "directory"]
42+
43+
v2-ohttp = ["v2", "std", "dep:hpke", "dep:bhttp", "dep:ohttp", "dep:http"]
3644
#[doc = "Functions to fetch OHTTP keys via CONNECT proxy using reqwest. Enables `v2` since only `v2` uses OHTTP."]
37-
io = ["v2", "reqwest/rustls-tls"]
38-
_manual-tls = ["rustls"]
45+
io = ["v2-ohttp", "reqwest/rustls-tls", "dep:reqwest"]
46+
_manual-tls = ["reqwest/rustls-tls", "rustls"]
3947

4048
[dependencies]
4149
bhttp = { version = "0.6.1", optional = true }
42-
bitcoin = { version = "0.32.9", features = ["base64"] }
43-
bitcoin-units = "0.1.3"
50+
bitcoin = { version = "0.32.9", default-features = false }
51+
bitcoin-units = { version = "0.1.3", default-features = false }
4452
bitcoin_uri = { version = "0.1.0", optional = true }
4553
hpke = { package = "bitcoin-hpke", version = "0.13.0", optional = true }
4654
http = { version = "1.3.1", optional = true }
@@ -52,10 +60,14 @@ rustls = { version = "0.23.31", optional = true, default-features = false, featu
5260
] }
5361
serde = { version = "1.0.228", default-features = false, optional = true }
5462
serde_json = { version = "1.0.149", optional = true }
55-
tracing = "0.1.41"
63+
tokio = { version = "1.48.0", features = ["full"], optional = true }
64+
tracing = { version = "0.1.41", default-features = false, features = [
65+
"attributes",
66+
] }
5667

5768
[target.'cfg(target_arch = "wasm32")'.dependencies]
5869
web-time = "1.1.0"
70+
getrandom = { version = "0.3.4", features = ["wasm_js"] }
5971

6072
[package.metadata.cargo-machete]
6173
ignored = ["bitcoin-units"]
@@ -64,7 +76,10 @@ ignored = ["bitcoin-units"]
6476
once_cell = "1.21.3"
6577
payjoin-test-utils = { path = "../payjoin-test-utils", features = ["v2"] }
6678
tokio = { version = "1.52.3", features = ["full"] }
67-
tracing = "0.1.41"
79+
tracing = { version = "0.1.41", default-features = false, features = [
80+
"attributes",
81+
] }
82+
6883

6984
[package.metadata.docs.rs]
7085
all-features = true

0 commit comments

Comments
 (0)