Skip to main content

Crate fiber_types

Crate fiber_types 

Source
Expand description

Core domain types for the Fiber Network.

This crate provides the shared type definitions used across the Fiber Network ecosystem, including:

  • Primitive types: Hash256, Pubkey
  • Channel state types: bitflags, ChannelState, TLCId, TLC status enums
  • Payment types: PaymentStatus, PaymentCustomRecords
  • Invoice types: CkbInvoiceStatus, Currency, HashAlgorithm, CkbScript, InvoiceSignature
  • CCH types: CchOrderStatus
  • Network types: PersistentNetworkActorState
  • Watchtower types: ChannelData (feature-gated)
  • Store schema constants
  • Serde utilities for hex and base58 serialization
  • Molecule generated types for protocol messages

Re-exports§

pub use network::HopRequire;
pub use network::PersistentNetworkActorState;
pub use primitives::Hash256;
pub use primitives::NodeId;
pub use primitives::Privkey;
pub use primitives::Pubkey;
pub use serde_utils::duration_hex;
pub use serde_utils::from_hex;
pub use serde_utils::to_hex;
pub use serde_utils::CompactSignatureAsBytes;
pub use serde_utils::EntityHex;
pub use serde_utils::PartialSignatureAsBytes;
pub use serde_utils::PubNonceAsBytes;
pub use serde_utils::SliceBase58;
pub use serde_utils::SliceHex;
pub use serde_utils::SliceHexNoPrefix;
pub use serde_utils::U128Hex;
pub use serde_utils::U16Hex;
pub use serde_utils::U32Hex;
pub use serde_utils::U64Hex;
pub use channel::*;
pub use config::*;
pub use invoice::*;
pub use onion::*;
pub use payment::*;
pub use protocol::*;

Modules§

channel
Channel-related types: state flags, TLC status, channel state enum.
config
gen
invoice
Invoice-related types: status, currency, hash algorithm, script wrapper, signature.
network
Network state types.
onion
Onion routing types and Sphinx packet processing.
payment
Payment-related types.
primitives
Layer 1: Basic primitive types — Hash256, Pubkey, Privkey, NodeId.
protocol
Layer 2: Protocol message types and supporting types.
schema
+–––––––+–––––––––––+—————————–+ | KeyPrefix:: | Key:: | Value:: | +–––––––+–––––––––––+—————————–+ | 0 | Hash256 | ChannelActorState | | 16 | Pubkey | PersistentNetworkActorState | | 32 | Hash256 | CkbInvoice | | 33 | Payment_hash | CkbInvoice Preimage | | 34 | Payment_hash | CkbInvoice Status | | 48 | Hash256 | PendingCommitDiff | | 64 | Pubkey | Hash256 | ChannelState | | 65 | OutPoint | ChannelId | | 96 | Cursor | BroadcastMessage | | 97 | BroadcastMessageID | u64 | | 192 | Hash256 | PaymentSession | | 193 | OutPoint | Direction | TimedResult | | 194 | Hash256 | PaymentCustomRecords | | 224 | Hash256 | ChannelData | | 201 | Hash256 | ChannelOpenRecord | | 232 | Payment_hash | CchOrder | +–––––––+–––––––––––+—————————–+
serde_utils
Serde utilities for hex and base58 serialization of types used in the Fiber Network.

Macros§

declare_feature_bits_and_methods
Macro for declaring feature bits and generating methods on FeatureVector.

Structs§

Multiaddr
Representation of a Multiaddr.

Functions§

deserialize
Deserialize a value from bincode-encoded bytes.
now_timestamp_as_millis_u64
Get the current timestamp as milliseconds since the Unix epoch.
serialize
Serialize a value to bincode-encoded bytes.