use crate::deploy::outcomes::actions::bounded::FeeScale;
use crate::deploy::outcomes::actions::keywords::Keywords;
use crate::utils::sign::Map;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Instance {
pub id: String,
pub keywords: Keywords,
}
impl Instance {
#[must_use]
pub fn new(id: impl Into<String>, keywords: Keywords) -> Self {
Instance { id: id.into(), keywords }
}
#[must_use]
pub fn wire(&self) -> Map {
Map::new().put("id", self.id.clone()).put("keywordToValue", self.keywords.wire())
}
pub(super) fn wire_with(&self, fee_scale: FeeScale) -> Map {
self.wire().put("deployerFeeScale", fee_scale.to_wire())
}
}