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 { version?: string; 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 version: Option<String>, #[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: a nested identity (which card and printing) plus a
flattened rules summary and the UI-only uris.
interface DeckCard { identity: DeckCardIdentity; uris: CardImageUris; allParts?: Array<CardPart>; 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; /** * Back face of a transform / modal_dfc card, captured at deck import. * Absent on single-faced cards and on decks saved before it existed. */ backFace?: CardBackFaceSummary;}#[serde(rename_all = "camelCase")]pub struct DeckCard { pub identity: DeckCardIdentity, #[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: CardBackFaceSummary , CardImageUris , CardPart , DeckCardIdentity
DeckCardIdentity
Section titled “DeckCardIdentity”Which card a DeckCard is — name, printing (setCode/cardNumber), and an
optional foil flag. id is a client-side instance id.
interface DeckCardIdentity { id: string; name: string; setCode: string; cardNumber: string; oracleId?: string; tokenScript?: TokenScript; foil?: boolean;}#[serde(rename_all = "camelCase")]pub struct DeckCardIdentity { #[serde(default, skip_serializing_if = "String::is_empty")] pub id: String, pub name: String, pub set_code: String, pub card_number: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub oracle_id: Option<String>, #[serde(default, skip_serializing_if = "Option::is_none")] pub token_script: Option<TokenScript>, #[serde(default, skip_serializing_if = "Option::is_none")] pub foil: Option<bool>,}
References: TokenScript
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>,}