💰
Megapot
  • Overview
    • About Megapot
    • How to play
    • How to provide liquidity
    • How to refer users
    • Earn as a liquidity provider
    • About the Team
    • Megapoints
  • Deep dive
    • Components
    • System Diagram
    • Smart Contract
    • Provably Fair
  • Developers
    • Start Here
    • Add jackpot to your site
      • Custom Integration
        • Getting Started
        • Contract Functions
        • Jackpot Page
        • LP Deposit Page
        • History Page
      • React UI Kit
        • MegapotProvider
        • Jackpot
        • useJackpot
    • Sybil-resistant incentives
    • Launch jackpot in your token
    • Developer Reference
      • Testnet & Mainnet
      • Contract Overview & Functions
      • Megapot API
      • Megapot Examples
      • How to Earn Fees
      • Brand Kit
  • Appendix
    • VIP Program
    • FAQ
    • About Megapot
  • Terms of Service
  • Privacy Policy
  • Responsible Gaming
Powered by GitBook
On this page
  • Usage
  • Props
  • Official Jackpot
  • Type
  1. Developers
  2. Add jackpot to your site
  3. React UI Kit

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

Callback function when ticket purchase succeeds

❌

onTicketChangeAmount

Callback function when ticket amount changes

❌

onBuyTicketError

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

PreviousMegapotProviderNextuseJackpot

Last updated 2 months ago

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