no_fee = true, so gas is always free.
How It Works
- Account deployment on mainnet happens automatically after
login(), as usual. - First
executeOnSlot()call lazily deploys the account on Slot and registers the session key. The SDK uses a relayer (configurable or default) to handle theexecute_from_outside_v2call needed for JWT verification. - Subsequent
executeOnSlot()calls use the session key directly — no relayer, no paymaster, just a direct invoke.
Configuration
Addslot to your CavosProvider config:
SlotConfig Options
| Property | Type | Required | Description |
|---|---|---|---|
rpcUrl | string | Yes | RPC URL of your Cartridge Katana Slot instance |
chainId | string | Optional | Chain ID for the Slot chain. Defaults to the primary network’s ID. You should provide the exact internal VM chain ID (e.g., 0x57505f4341564f53 for WP_CAVOS) to avoid signature mismatches. |
relayerAddress | string | Optional | Account address to act as relayer for Slot deployment. Defaults to the built-in Cavos relayer. |
relayerPrivateKey | string | Optional | Private key for the relayer account. |
[!WARNING] Important: Katana sequencers often reportSN_MAINvia their RPC, but use a custom internal chain ID inside the Cairo VM. Because the Cavos session registration signature depends on this internal chain ID, you must manually set thechainIdin your config to match the internal ID of your Katana genesis (e.g.,WP_CAVOS/0x57505f4341564f53). If you do not provide the correct internalchainId, you will encounter an “Invalid session key signature” error.
[!IMPORTANT] Address Parity: On Cavos Slots, theCavosAccountclass andJWKSRegistryare typically deployed at the exact same addresses as production (Sepolia/Mainnet). The SDK now automatically uses these parity addresses. You no longer need to provideclassHashorjwksRegistryAddressin theSlotConfig.
[!NOTE] Ifslotis not present in the config, nothing Slot-related happens —executeOnSlot()will throw.
Finding your internal Katana Chain ID
Since you cannot rely on the RPCstarknet_chainId method to give you the internal VM chain ID of your Slot or Katana node, you must query it directly from within the Cairo VM.
You can do this by deploying a minimalistic Cairo contract that returns get_tx_info().chain_id:
- Deploy the contract above to your Katana node using
starkli. - Call the
get_chain_idfunction: - Use the exact hexadecimal result in your
slot.chainIdconfiguration array.
Executing Transactions on Slot
UseexecuteOnSlot() instead of execute() to route transactions to the Slot chain:
Multicall on Slot
Session Policy on Slot
The session policy configured inCavosProvider (session.defaultPolicy) applies to both mainnet and Slot transactions. Configure allowedContracts to include your Slot game contracts:
Differences from execute()
execute() | executeOnSlot() | |
|---|---|---|
| Target chain | Starknet mainnet / sepolia | Cartridge Slot (Katana) |
| Gas | Sponsored by Cavos Paymaster | Free (no_fee = true) |
| Paymaster needed | Yes (for sponsored) | No |
| First call overhead | None | Deploys account + registers session on Slot |
| Subsequent calls | Direct invoke or paymaster | Direct invoke with session key |
Troubleshooting
| Symptom | Likely Cause | Fix |
|---|---|---|
executeOnSlot throws “Slot not configured” | slot key missing from config | Add slot: { rpcUrl: '...' } to CavosProvider config |
| First Slot transaction takes long | Deploying account + registering session | Expected on the very first call — subsequent calls are instant |
| ”Invalid session key signature” on Slot | Mismatched Katana chain ID or SDK version | Provide the internal Katana chainId (e.g. 0x57505f4341564f53 for WP_CAVOS) in the slot config, and ensure @cavos/react is updated |
| Transaction rejected on Slot | Contract not in session policy | Add contract to allowedContracts in session.defaultPolicy |
| Wrong chain ID | Custom Katana uses an internal VM chain ID different from RPC | Pass chainId explicitly in slot config |

