df_hyperliquid_core/deploy/outcomes/actions/
instance.rs1use crate::deploy::outcomes::actions::bounded::FeeScale;
5use crate::deploy::outcomes::actions::keywords::Keywords;
6use crate::utils::sign::Map;
7
8#[derive(Debug, Clone, PartialEq, Eq)]
10pub struct Instance {
11 pub id: String,
13 pub keywords: Keywords,
15}
16
17impl Instance {
18 #[must_use]
20 pub fn new(id: impl Into<String>, keywords: Keywords) -> Self {
21 Instance { id: id.into(), keywords }
22 }
23
24 #[must_use]
26 pub fn wire(&self) -> Map {
27 Map::new().put("id", self.id.clone()).put("keywordToValue", self.keywords.wire())
28 }
29
30 pub(super) fn wire_with(&self, fee_scale: FeeScale) -> Map {
32 self.wire().put("deployerFeeScale", fee_scale.to_wire())
33 }
34}