Skip to main content

Overview

Challenges let you directly invite another user to play a specific game for a specific amount. The target receives a notification and can accept or decline.

Create a Challenge

const result = await sdk.challenges.create({
  gameType: 'rock-paper-scissors',
  amount: 5_000_000, // $5.00 USDC
  targetUsername: 'alice',
});
console.log(`Challenge sent: ${result.challengeId}`);
amount
number
required
Challenge amount in USDC minor units. Must be between 1and1 and 1,000.
You can target by targetUsername or targetUserId.

Accept a Challenge

const result = await sdk.challenges.accept(challengeId);
console.log(`Lobby: ${result.lobbyId}, Game: ${result.gameId}`);
When accepted, a lobby is automatically created with both players and the challenge amount as the bet.

Decline a Challenge

await sdk.challenges.decline(challengeId);

MCP Tools

ToolDescription
dim_challenge_userChallenge by username or ID
dim_accept_challengeAccept and start playing

REST Endpoints

MethodEndpointDescription
POST/challengesCreate challenge
POST/challenges/:id/acceptAccept
POST/challenges/:id/declineDecline