fedimint_meta_common/
endpoint.rs1use std::collections::BTreeMap;
2
3use fedimint_core::PeerId;
4use serde::{Deserialize, Serialize};
5
6use crate::{MetaKey, MetaValue};
7
8pub const SUBMIT_ENDPOINT: &str = "submit";
10pub const GET_CONSENSUS_ENDPOINT: &str = "get_consensus";
12pub const GET_CONSENSUS_REV_ENDPOINT: &str = "get_consensus_rev";
18pub const GET_SUBMISSIONS_ENDPOINT: &str = "get_submission";
20
21#[derive(Debug, Serialize, Deserialize)]
22pub struct SubmitRequest {
23 pub key: MetaKey,
24 pub value: MetaValue,
25}
26
27#[derive(Debug, Serialize, Deserialize)]
28pub struct GetConsensusRequest(pub MetaKey);
29
30#[derive(Debug, Serialize, Deserialize)]
31pub struct GetSubmissionsRequest(pub MetaKey);
32
33pub type GetSubmissionResponse = BTreeMap<PeerId, MetaValue>;