Skip to main content

bee/swarm/
mod.rs

1//! Foundational types for the Swarm protocol: typed bytes, BMT chunk
2//! addressing, SOC primitives, and the crate-level error type.
3//!
4//! Mirrors `pkg/swarm` in bee-go.
5
6pub mod bmt;
7pub mod bytes;
8pub mod cid;
9pub mod duration;
10pub mod errors;
11pub mod file_chunker;
12pub mod gsoc;
13pub mod keys;
14pub mod network;
15pub mod size;
16pub mod soc;
17pub mod tokens;
18pub mod typed_bytes;
19
20pub use bmt::{
21    CHUNK_SIZE, Chunk, MAX_PAYLOAD_SIZE, MIN_PAYLOAD_SIZE, SEGMENT_SIZE, SEGMENTS_COUNT,
22    calculate_chunk_address, keccak256, make_content_addressed_chunk,
23};
24pub use cid::{
25    CidType, DecodedCid, FEED_CODEC, MANIFEST_CODEC, convert_cid_to_reference,
26    convert_reference_to_cid,
27};
28pub use duration::Duration as BeeDuration;
29pub use errors::{Error, RESPONSE_BODY_CAP, Result, redact_url};
30pub use file_chunker::{ChunkerRoot, FileChunker, MAX_BRANCHES, SealedChunk};
31pub use gsoc::{GSOC_DEFAULT_PROXIMITY, GSOC_MINE_START, gsoc_mine, proximity};
32pub use keys::{PrivateKey, PublicKey, eth_signed_message_digest};
33pub use network::Network;
34pub use size::Size;
35pub use soc::{
36    SingleOwnerChunk, calculate_single_owner_chunk_address, make_single_owner_chunk,
37    unmarshal_single_owner_chunk,
38};
39pub use tokens::{BZZ_DIGITS, Bzz, DAI_DIGITS, Dai};
40pub use typed_bytes::{
41    BATCH_ID_LENGTH, BatchId, ENCRYPTED_REFERENCE_LENGTH, ETH_ADDRESS_LENGTH, EthAddress,
42    FEED_INDEX_LENGTH, FeedIndex, IDENTIFIER_LENGTH, Identifier, PEER_ADDRESS_LENGTH,
43    PRIVATE_KEY_LENGTH, PUBLIC_KEY_LENGTH, PeerAddress, REFERENCE_LENGTH, Reference,
44    SIGNATURE_LENGTH, SPAN_LENGTH, Signature, Span, TOPIC_LENGTH, TRANSACTION_ID_LENGTH, Topic,
45    TransactionId,
46};