contracts/ kit/ConfidentialDeck.sol the base contract you inherit CardLib.sol 52-card rank/suit decoding (optional) examples/ War, Blackjack, Raffle, Mafiaclient/ incoDeckClient.ts peekMyCards / readRevealed / packForSettletest/ pure units (no Docker) plus full games vs a real covalidatorignition/modules/ one deploy module per gamefrontend/ the demo dAppRECIPES.md copy-paste snippets, one per move
npm install # @inco/lightning + @inco/lightning-js v1.0.2npm run compilenpm test # pure-logic units (blackjack scoring), no Dockernpm run node:up # local Inco node: anvil + covalidator v1.0.2npm run test:local # units plus all four games end-to-endnpm run node:down
Package and image versions must match: @inco/lightning{,-js}@1.0.2 with
inconetwork/local-node-{anvil,covalidator}-mainnet:v1.0.2. A mismatch fails at
the shuffle with a ciphertext MAC error.
Deploy to Base Sepolia testnet, then write the addresses into the frontend env.
npm run deploy:war:testnet # also :blackjack :raffle :mafianpm run wire:frontend # writes deployed addresses into frontend/.env.localcd frontend && npm installcp .env.example .env.local # WalletConnect id plus the deployed addressesnpm run dev
client/incoDeckClient.ts is the client half of the kit. It mirrors the contract
moves.
Function
What it does
getZap({ local })
init the SDK against a local node or Base Sepolia
peekMyCards(zap, wallet, handles)
decrypt cards dealt to you (signs once)
readRevealed(zap, handles)
read public cards, no wallet
packForSettle(cards)
shape revealed cards into (values, sigs) for settle
decodeCard(value)
decode a value from 1 to 52 into rank, suit, and label
peekMyCards uses attestedDecrypt, so Inco refuses anyone but the owner.
readRevealed uses attestedReveal, which needs no signature. The covalidator
is async, so both retry until the value lands.