Skip to main content

Crate moonproof_node_client

Crate moonproof_node_client 

Source
Expand description

§moonproof-node-client

Rust client for the Midnight node’s Substrate submission RPC.

Midnight transactions are submitted as unsigned Substrate extrinsics wrapping the Midnight tx bytes: pallet_midnight.send_mn_transaction(Vec<u8>). The Midnight bytes carry all required cryptographic signatures internally (Intent signatures + ZK proofs), so the Substrate layer adds no authentication.

Transport is WebSocket JSON-RPC on port 9944 in the local dev harness. The status subscription uses author_submitAndWatchExtrinsic, and the wallet collapses Substrate tx-pool statuses into three emitted events: SubmissionEvent::Submitted, SubmissionEvent::InBlock, and SubmissionEvent::Finalized.

§Reference

TS counterpart: @midnight-ntwrk/wallet-sdk-node-client (midnight-wallet/packages/node-client/src/effect/PolkadotNodeClient.ts).

Re-exports§

pub use client::Genesis;
pub use client::NodeClient;
pub use client::SerializedTransaction;
pub use config::Config;
pub use error::NodeClientError;
pub use event::SubmissionEvent;
pub use event::SubmissionStage;
pub use status::SubmissionOutcome;
pub use status::TxStatus;
pub use polkadot::PolkadotNodeClient;

Modules§

client
The NodeClient trait — the abstract interface every concrete node adapter implements.
config
Configuration for the Midnight node client.
error
Error taxonomy for the Midnight node client.
event
Submission events emitted while a transaction progresses through the node.
polkadot
PolkadotNodeClient — subxt-backed implementation of NodeClient.
status
Pure translation from Substrate tx-pool statuses to wallet-level events and errors.