Plinko

Properties:

interface TemplateWithWeb3Props extends BaseGameProps {
  options: PlinkoTemplateOptions;
  minWager?: number;
  maxWager?: number;
  hideBetHistory?: boolean;
  forceNoRetry?: boolean;
  divideWagerByBetCount?: boolean;
 
  onAnimationStep?: (step: number) => void;
  onAnimationCompleted?: (result: PlinkoGameResult[]) => void;
  onTransactionStatusUpdate?: (type: 'awaiting' | 'received') => void;
}

Example:

'use client';
 
import { useModalsStore, useToast } from '@winrlabs/ui';
import { PlinkoGame } from '@winrlabs/web3-games';
import { GameType } from '@winrlabs/games';
 
export default function PlinkoPage() {
  const { openModal } = useModalsStore();
 
  const { toast } = useToast();
 
  const { checkProgressChanges } = useProgressCheck();
 
  const { minWager, maxWager } = useGetWagerInfo(GameType.PLINKO);
 
  return (
    <>
      <PlinkoGame
        options={{
          scene: {
            backgroundImage: 'url(/images/game-assets/plinko/bg.png)',
          },
        }}
        minWager={minWager}
        maxWager={maxWager}
        onAnimationCompleted={() => {
          checkProgressChanges();
 
          refetchHistory();
        }}
        onError={(e) => {
          toast({
            title: 'Error',
            description: e || 'Something went wrong',
            variant: 'destructive',
          });
        }}
        onLogin={() => openModal('login')}
        hideBetHistory
      />
    </>
  );
}