Jackpot

The Jackpot component is a React component designed to facilitate the purchase of tickets for a jackpot.

Usage

import {
  Jackpot,
  JACKPOT,
  MainnetJackpotName,
} from "@coordinationlabs/megapot-ui-kit";

<Jackpot
  contract={JACKPOT[chainId][MainnetJackpotName.USDC]}
/>

Props

Name
Type
Description
Required

contract

Contract information including address and chain details

βœ…

onBuyTicketSuccess

(hash: `0x${string}`, ticketAmount: number) => void

Callback function when ticket purchase succeeds

❌

onTicketChangeAmount

(ticketAmount: number) => void

Callback function when ticket amount changes

❌

onBuyTicketError

(error: Error) => void

Callback function when ticket purchase fails

❌

referrerAddress

Address

The address of the referrer. This address will get 5% of each ticket price

❌

recipientAddress

Address

This address will receive the ticket instead of the sender *Only ETH contract support this

❌

blocked

You can disable Jackpot functionalities

❌

isStablecoinPool

boolean

If you set this to false, UI will show base token amount and dollar for ticket price

❌

isOfficialPool

boolean

If you set this to false, Information about megapoint will be hide from the UI

❌

showSuccessDialog

boolean

If you set this to false, success dialog won't show after ticket purchase succeeds

❌

detailContainer

ReactNode

This will be render below ticket price. You can use this prop to add more detail to the widget

❌

tokenPrice

number

Optional override for token price

❌

Official Jackpot

You can easily integrate these official pools using our pre-configured JACKPOT constant:

import { JACKPOT, MainnetJackpotName, SupportedChainId, TestnetJackpotName } from '@coordinationlabs/megapot-ui-kit';

// Example: Using the official Base USDC pool
const usdcPool = JACKPOT[SupportedChainId.BASE][MainnetJackpotName.USDC];

// Example: Using the official Base Sepolia MPUSDC pool
const usdcPool = JACKPOT[SupportedChainId.BASE][TestnetJackpotName.MPUSDC];

// Example: Using the official BLAST pool
const blastPool = JACKPOT[SupportedChainId.BLAST][MainnetJackpotName.BLAST];

Type

JackpotInfo

Property
Type
Description
Required

address

Address

Smart contract address of the jackpot

βœ…

abi

Abi

Contract ABI for interaction

βœ…

chainId

number

Blockchain network ID

βœ…

name

string

Display name of the jackpot

βœ…

tokenAddress

Address

Address of the token used

βœ…

tokenImage

string

URL/path to token logo

βœ…

pointPerTicket

number

Points awarded per ticket

❌

BlockedData

Property
Type
Required
Description

blocked

boolean

Yes

When set to true, disables action button

blockTitle

string

No

Custom button text to display to users when purchases are blocked

blockMessage

string

No

show detail blocked message to users

Last updated