Skip to main content

bulk_client/msgs/
meta.rs

1use std::sync::Arc;
2use serde::{Deserialize, Serialize};
3use crate::transaction::ActionMeta;
4
5/// Per-market configuration returned by the exchange.
6#[derive(Debug, Clone, Deserialize)]
7#[serde(rename_all = "camelCase")]
8#[allow(unused)]
9pub struct MarketInfo {
10    pub symbol: String,
11    pub base_asset: String,
12    pub quote_asset: String,
13    pub status: String,
14    pub price_precision: u32,
15    pub size_precision: u32,
16    pub tick_size: f64,
17    pub lot_size: f64,
18    pub min_notional: f64,
19    pub max_leverage: f64,
20    pub order_types: Vec<String>,
21    pub time_in_forces: Vec<String>,
22}
23
24/// Beacon tx
25#[derive(Clone, Debug, Deserialize, Serialize)]
26pub struct Beacon {
27    pub epoch: u32,
28    pub node_id: u16,
29    pub wall_clock_ns: u64,
30    pub since_commit_us: u64,
31
32    #[serde(skip)]
33    pub meta: ActionMeta,
34}
35
36
37/// WarmJoin protocol: a validator announces it has caught up and is ready to vote.
38///
39/// System-internal transaction (like Beacon). Not a user order.
40/// Authentication is via the BulkTransaction signer — verified against the
41/// preconfigured validator pubkey map before consensus processes the join.
42///
43/// `committed_round` is the node's last committed round at emission time.
44/// Re-emitted join TXs naturally hash differently, preventing dedup stalls.
45#[derive(Clone, Debug, Serialize, Deserialize)]
46pub struct Join {
47    pub node_id: u16,
48    pub committed_round: u64,
49
50    #[serde(skip)]
51    pub meta: ActionMeta,
52}
53
54
55/// Add new market tx
56#[derive(Clone, Debug, Serialize, Deserialize)]
57pub struct AddMarket {
58    #[serde(rename = "c")]
59    pub symbol: Arc<str>,
60
61    #[serde(skip)]
62    pub meta: ActionMeta,
63}
64
65/// Opaque wrapper for special tx
66#[derive(Clone, Debug, Serialize, Deserialize)]
67pub struct OpaqueAction {
68    pub payload: Vec<u8>,
69
70    #[serde(skip)]
71    pub meta: ActionMeta,
72}