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,
14}
15
16impl Instance {
17 #[must_use]
18 pub fn new(id: impl Into<String>, keywords: Keywords) -> Self {
19 Instance { id: id.into(), keywords }
20 }
21
22 #[must_use]
23 pub fn wire(&self) -> Map {
24 Map::new().put("id", self.id.clone()).put("keywordToValue", self.keywords.wire())
25 }
26
27 pub(super) fn wire_with(&self, fee_scale: FeeScale) -> Map {
29 self.wire().put("deployerFeeScale", fee_scale.to_wire())
30 }
31}