Skip to main content

Crate fiber_json_types

Crate fiber_json_types 

Source
Expand description

RPC JSON request/response types for the Fiber Network.

This crate contains the pure data types (request/response structs and enums) used by the Fiber Network’s JSON-RPC API. These types are separated from the RPC server implementations to allow external tools and clients to depend on the type definitions without pulling in the full node implementation.

All domain-specific types (Hash256, Pubkey, MultiAddr, etc.) are represented as plain strings in this crate to avoid dependencies on fiber-types, secp256k1, and tentacle-multiaddr. Conversions between these JSON types and the internal domain types are handled in the RPC server layer.

The types are organized by RPC module:

  • channel: Channel management types
  • payment: Payment types
  • graph: Network graph types
  • invoice: Invoice types
  • info: Node info types
  • peer: Peer management types
  • cch: Cross-chain hub types
  • dev: Development/debug types
  • watchtower: Watchtower types
  • prof: Profiling types
  • context: RPC context types

Re-exports§

pub use serde_utils::Hash256;
pub use serde_utils::Privkey;
pub use serde_utils::Pubkey;
pub use channel::*;
pub use context::*;
pub use dev::*;
pub use graph::*;
pub use info::*;
pub use invoice::*;
pub use payment::*;
pub use peer::*;
pub use prof::*;

Modules§

channel
Channel management types for the Fiber Network JSON-RPC API.
context
RPC context types for the Fiber Network JSON-RPC API.
dev
Development/debug types for the Fiber Network JSON-RPC API.
graph
Network graph types for the Fiber Network JSON-RPC API.
info
Node info types for the Fiber Network JSON-RPC API.
invoice
Invoice types for the Fiber Network JSON-RPC API.
payment
Payment types for the Fiber Network JSON-RPC API.
peer
Peer management types for the Fiber Network JSON-RPC API.
prof
Profiling types for the Fiber Network JSON-RPC API.
schema_helpers
Schema helper functions for generating JSON Schema descriptions of custom hex types.
serde_utils
Serde utilities for hex serialization of types used in JSON RPC.

Macros§

define_rpc_flags
Macro to define flags types that serialize to SCREAMING_SNAKE_CASE strings. For single flag, returns the flag name in SCREAMING_SNAKE_CASE (e.g., “OUR_INIT_SENT”). For multiple flags, returns pipe-separated names (e.g., “OUR_INIT_SENT | THEIR_INIT_SENT”).