Skip to content

What's in @chain-protocol/casino-sdk

Find the Casino SDK's public entry points and the files a starter game gives you. Know which imports belong in your game and which stay inside platform tooling.

This page lists what the @chain-protocol/casino-sdk package ships on npm, and what a game created with chain init casino holds.

Path in the packageImportWhat it is
dist/index.js@chain-protocol/casino-sdkHostSnapshot, HostApi, manifest validation, defineDeployment, hostSupports.
dist/guest.js@chain-protocol/casino-sdk/guestconnectGameToHost, the Penpal bridge for the iframe.
contracts/ICasinoGameV2.sol@chain-protocol/casino-sdk/contracts/*The canonical game interface.
contracts/CasinoSession*.sol@chain-protocol/casino-sdk/contracts/*The session struct and its codec.
dist/slot-engine.js@chain-protocol/casino-sdk/slot-engineThe slot engine library and its compiled contracts.
slot-engine/contracts/@chain-protocol/casino-sdk/slot-engine/contracts/*The slot engine contracts as Solidity source.
dist/slot-engine/threshold.js@chain-protocol/casino-sdk/slot-engine/thresholdThe browser-safe threshold helpers.
dist/local-host.js@chain-protocol/casino-sdk/local-hostThe local casino host and test randomness router, for host-path tests.
dist/host.js./host (internal)The host side of the bridge, for the Chain.wtf host.
dist/simulator.js, dist/harness./simulator (internal)The SDK simulator chain dev casino starts.
dist/conformance.js./conformance (internal)The conformance checks game-verify runs.
README.mdPackage overview.

The internal subpaths sit outside semver and can change in any release. Do not import them from a game. The guides on this site are the SDK’s docs/; they are not in the npm package.

PathWhat it is
contracts/src/CoinflipGame.solThe game contract. It imports the interface from the SDK.
deployment.tsNames the contract chain dev and the platform compile and deploy.
src/The frontend (React and Vite).
public/game.manifest.jsonThe manifest the host fetches from the frontend’s origin.
package.json@chain-protocol/casino-sdk and @chain-protocol/cli at one version, and the dev and simulator scripts.

There is no required folder layout, toolchain, or release process for third-party games. Each title is expected to live in its own repository, with its own build, test, and release pipeline. The platform needs a deployed URL the host can load in an iframe, the on-chain game contract, and catalog wiring on our side. chain dev needs only a deployment.ts in the project’s root and the contract it names under contracts/.

Games differ (slots vs. table games, stack choices, asset pipelines), so treat the chain init example as a starting point, not a layout to keep.