v0.5.1-pre.008
This commit is contained in:
@@ -1,56 +1,30 @@
|
||||
// file: ks-lib/src/model/nomenclature.rs
|
||||
// version: 6
|
||||
// version: 7
|
||||
|
||||
//! Shared protocol, surface, and event nomenclature types.
|
||||
|
||||
use ts_rs::TS; // rust-rules: derive-import
|
||||
|
||||
/// Stable internal program code.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash, serde::Deserialize, serde::Serialize, TS)]
|
||||
#[ts(
|
||||
export,
|
||||
export_to = "../frontend/ts/bindings/ks_lib/model/nomenclature/ProgramCode.ts"
|
||||
)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash, serde::Deserialize, serde::Serialize)]
|
||||
pub struct MdProgramCode(pub std::string::String);
|
||||
|
||||
/// Protocol family code, for example `raydium` or `meteora`.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash, serde::Deserialize, serde::Serialize, TS)]
|
||||
#[ts(
|
||||
export,
|
||||
export_to = "../frontend/ts/bindings/ks_lib/model/nomenclature/ProtocolCode.ts"
|
||||
)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash, serde::Deserialize, serde::Serialize)]
|
||||
pub struct MdProtocolCode(pub std::string::String);
|
||||
|
||||
/// Concrete protocol surface code, for example `raydium_amm_v4`.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash, serde::Deserialize, serde::Serialize, TS)]
|
||||
#[ts(
|
||||
export,
|
||||
export_to = "../frontend/ts/bindings/ks_lib/model/nomenclature/SurfaceCode.ts"
|
||||
)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash, serde::Deserialize, serde::Serialize)]
|
||||
pub struct MdSurfaceCode(pub std::string::String);
|
||||
|
||||
/// Event name without surface prefix.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash, serde::Deserialize, serde::Serialize, TS)]
|
||||
#[ts(
|
||||
export,
|
||||
export_to = "../frontend/ts/bindings/ks_lib/model/nomenclature/EventName.ts"
|
||||
)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash, serde::Deserialize, serde::Serialize)]
|
||||
pub struct MdEventName(pub std::string::String);
|
||||
|
||||
/// Canonical event code in `<surface_code>.<event_name>` format.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash, serde::Deserialize, serde::Serialize, TS)]
|
||||
#[ts(
|
||||
export,
|
||||
export_to = "../frontend/ts/bindings/ks_lib/model/nomenclature/EventCode.ts"
|
||||
)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash, serde::Deserialize, serde::Serialize)]
|
||||
pub struct MdEventCode(pub std::string::String);
|
||||
|
||||
/// High-level event family.
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, serde::Deserialize, serde::Serialize, TS)]
|
||||
#[ts(
|
||||
export,
|
||||
export_to = "../frontend/ts/bindings/ks_lib/model/nomenclature/EventFamily.ts"
|
||||
)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, serde::Deserialize, serde::Serialize)]
|
||||
pub enum MdEventFamily {
|
||||
/// Swap or buy/sell event.
|
||||
Trade,
|
||||
|
||||
Reference in New Issue
Block a user