Deck
A Deck is the list a player brings to a game. The engine reads the parts it
needs to build the game — cards, sideboard, commanders, and the
supplementary decks (attractions, contraptions, schemes, planes) — and
round-trips the rest unchanged: the remaining fields are client-side state
(stack positions, tags, cover art) the engine doesn’t model but preserves so the
wire shape stays identical.
Each block below is generated from the same source as the engine bindings
(ts-rs for TypeScript, the manabrew-protocol crate for Rust).
The whole deck — its identity, the maindeck and sideboard, the supplementary zones, and the preserved client-side metadata.
interface Deck { id?: string; name: string; description?: string; color?: string; format?: DeckFormat; cards: Array<DeckCard>; sideboard: Array<DeckCard>; attractions?: Array<DeckCard>; contraptions?: Array<DeckCard>; schemes?: Array<DeckCard>; planes?: Array<DeckCard>; commanders?: Array<DeckCard>; companion?: DeckCard; maybeboard?: Array<DeckCard>; draft?: boolean; labels?: Array<DeckLabel>; coverCardName?: string; coverCardFace?: number; playmat?: string; playmatSettings?: PlaymatSettings; stackPositions?: Record<string, { x: number; y: number }>; tokens?: Array<DeckCard>;}#[serde(rename_all = "camelCase")]pub struct Deck { #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option<String>, pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option<String>, #[serde(default, skip_serializing_if = "Option::is_none")] pub color: Option<String>, #[serde(default, skip_serializing_if = "Option::is_none")] pub format: Option<DeckFormat>, #[serde(default)] pub cards: Vec<DeckCard>, #[serde(default)] pub sideboard: Vec<DeckCard>, #[serde(default, skip_serializing_if = "Option::is_none")] pub attractions: Option<Vec<DeckCard>>, #[serde(default, skip_serializing_if = "Option::is_none")] pub contraptions: Option<Vec<DeckCard>>, #[serde(default, skip_serializing_if = "Option::is_none")] pub schemes: Option<Vec<DeckCard>>, #[serde(default, skip_serializing_if = "Option::is_none")] pub planes: Option<Vec<DeckCard>>, #[serde(default, skip_serializing_if = "Option::is_none")] pub commanders: Option<Vec<DeckCard>>, #[serde(default, skip_serializing_if = "Option::is_none")] pub companion: Option<DeckCard>, #[serde(default, skip_serializing_if = "Option::is_none")] pub maybeboard: Option<Vec<DeckCard>>, #[serde(default, skip_serializing_if = "Option::is_none")] pub draft: Option<bool>, #[serde(default, skip_serializing_if = "Option::is_none")] pub labels: Option<Vec<DeckLabel>>, #[serde(default, skip_serializing_if = "Option::is_none")] pub cover_card_name: Option<String>, #[serde(default, skip_serializing_if = "Option::is_none")] pub cover_card_face: Option<u8>, #[serde(default, skip_serializing_if = "Option::is_none")] pub playmat: Option<String>, #[serde(default, skip_serializing_if = "Option::is_none")] pub playmat_settings: Option<PlaymatSettings>, #[serde(default, skip_serializing_if = "Option::is_none")] pub stack_positions: Option<serde_json::Value>, #[serde(default, skip_serializing_if = "Option::is_none")] pub tokens: Option<Vec<DeckCard>>,}
References: DeckCard , DeckFormat , DeckLabel , PlaymatSettings
DeckCard
Section titled “DeckCard”One entry in a deck. Identity (id, name, setCode, cardNumber, foil) and
a rules summary are flattened in alongside the UI-only uris, so a DeckCard is
a single flat object on the wire.
interface DeckCard { uris: CardImageUris; allParts?: Array<CardPart>; id: string; name: string; setCode: string; cardNumber: string; foil?: boolean; color: string; colorIdentity: Array<string>; manaCost: string; cmc: number; types: Array<string>; subtypes: Array<string>; supertypes: Array<string>; keywords?: Array<string>; power?: string; toughness?: string; text: string; layout?: string; isDoubleFaced?: boolean;}/// Mirror of `manabrew.ts:DeckCard`.#[serde(rename_all = "camelCase")]pub struct DeckCard { #[serde(flatten)] pub identity: CardIdentity, #[serde(flatten)] pub rules: CardRulesSummary, #[serde(default)] pub uris: CardImageUris, #[serde(default, skip_serializing_if = "Option::is_none")] pub all_parts: Option<Vec<CardPart>>,}
References: CardImageUris , CardPart
DeckLabel
Section titled “DeckLabel”A user-defined label attached to a deck.
interface DeckLabel { name: string; color?: string;}#[serde(rename_all = "camelCase")]pub struct DeckLabel { pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub color: Option<String>,}