use serde::{Deserialize, Serialize};
use serde_json::Value;

//@todo need some renaming on this bad boy.
use crate::traits::{PoolParams, StratumParams};

#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PoolParam<PP, SP>
where
    PP: PoolParams,
    SP: StratumParams,
{
    Notify(SP::Notify),
    SetDifficulty(f64),

    // ===== Responding Values ===== //
    AuthorizeResult(PP::AuthorizeResult),
    SubscribeResult(PP::SubscribeResult),
    SubmitResult(bool),

    Unknown(Value),
}

#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum ClientParam<PP, SP>
where
    PP: PoolParams,
    SP: StratumParams,
{
    Authorize(PP::Authorize),
    Submit(SP::Submit),
    Subscribe(PP::Subscribe),
    Unknown(Value),
}
