Skip to main content

Crate api

Crate api 

Expand description

Common high-level external and internal API traits for the HOPR protocol.

This crate defines trait-based interfaces that separate API contract from implementation. Concrete implementations live in their respective crates (hopr-lib, hopr-transport, etc.) and depend on the traits defined here.

§Module Organization

  • chain — On-chain operations: channel management, account queries, safe operations, event subscriptions
  • ct — Cover traffic and probing traffic generation
  • graph — Network graph: topology view, pathfinding, edge quality observations
  • network — Network layer: peer connectivity, health, stream control
  • node — High-level node API: accessor traits (Has*), composed operations, session client
  • tickets — Winning ticket management and redemption

§Design Principle

The interface mandates trait behavior defined in this crate and does not rely on specific types outside of this crate. External types (from hopr-types) are re-exported at the crate root for convenience.

Modules§

chain
On-chain operations-related API traits. On-chain operations API traits.
ct
Cover traffic-related API traits. Cover traffic and probing traffic generation traits.
graph
Network graph related API traits. Network graph API traits: topology, pathfinding, and edge quality observations.
network
Network state and peer observation API traits. Network layer abstractions: peer connectivity, health, and stream control.
node
High-level HOPR node API traits. High-level HOPR node API trait definitions.
tickets
Winning ticket management API traits.
types
Contains all HOPR-specific or related Rust types.

Structs§

Address
Represents an Ethereum address
ChainKeypair
Represents a keypair consisting of a secp256k1 private and public key
Multiaddr
Representation of a Multiaddr.
OffchainKeypair
Represents a keypair consisting of an Ed25519 private and public key
OffchainPublicKey
Represents an Ed25519 public key.
PeerId
Identifier of a peer of the network.
WxHOPR
Represents wxHOPR token Currency.
XDai
Represents xDai coin Currency.

Type Aliases§

HoprBalance
XDaiBalance