Skip to content

Feat/betting ux and stark net transactions#20

Merged
tosoham merged 11 commits intoShonen-Labs:mainfrom
legend4tech:Feat/Betting-UX-And-StarkNet-Transactions
May 4, 2025
Merged

Feat/betting ux and stark net transactions#20
tosoham merged 11 commits intoShonen-Labs:mainfrom
legend4tech:Feat/Betting-UX-And-StarkNet-Transactions

Conversation

@legend4tech
Copy link
Contributor

On-Chain Betting Integration with StarkNet

Overview

This PR implements the full frontend flow for on-chain betting via StarkNet, including:
✅ Wallet connection & authentication
✅ Agent selection & bet amount input
✅ Transaction triggering & status tracking
⚠️ Note: Transactions are currently mocked—functionality is in place, but no real contract calls are made yet (see Next Steps).


Key Features

1. Wallet Connection

  • Supports ArgentX and Braavos via @starknet-react/core
  • Connection modal, account dropdown, and disconnect flow
  • Handles wallet detection (installed/not installed)

2. Betting Interface

  • Agent cards with performance data
  • ETH input with validation
  • "Place Bet" button with disabled states

3. Transaction Handling (Mocked)

  • UI fully simulates transaction flow (pending → success/failure)
  • Transaction history with status badges
  • Error states displayed for failed transactions
  • No real contract calls yet—backend integration is pending (see Next Steps)

Technical Notes

File Structure

src/
├── components/      # Wallet modals, betting UI
├── hooks/           # useBetting, useWallet
├── lib/starknet.ts  # Mocked contract calls
└── types/           # Interfaces for agents, tx

Why Mocked Transactions?

The frontend logic is fully functional, but since no betting contract has been deployed yet:

  • All contract calls are simulated in lib/starknet.ts
  • Replace the mock with a real contract ABI when ready

Testing Instructions

  1. Connect wallet (ArgentX/Braavos)
  2. Select agent and enter bet amount
  3. Submit bet → UI will simulate tx flow (no on-chain action)
  4. Verify transaction history updates correctly

Next Steps

To enable real transactions, we need:

  1. Deploy betting contract (or provide ABI + address)
  2. Replace mock in lib/starknet.ts with actual contract calls
  3. Configure network (testnet/mainnet) in Providers

This PR delivers the complete frontend foundation—backend integration will be seamless once the contract is ready.


This version:

  • Highlights the mocked state upfront (no surprises)
  • Explains why it’s mocked and how to enable real tx
  • Keeps the focus on the working UI/UX flow
  • Still shows the full scope of what’s implemented

Closes #8

@vercel
Copy link

vercel bot commented May 3, 2025

@legend4tech is attempting to deploy a commit to the poulavbhowmick03's projects Team on Vercel.

A member of the Team first needs to authorize it.

tosoham
tosoham previously requested changes May 3, 2025
Copy link
Contributor

@tosoham tosoham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are build errors please resolve

@legend4tech legend4tech requested a review from tosoham May 3, 2025 22:24
Copy link
Contributor

@tosoham tosoham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@legend4tech can you show me a video where you have implemented the betting UI

@tosoham tosoham dismissed their stale review May 4, 2025 12:08

Solved

@tosoham tosoham self-requested a review May 4, 2025 12:34
Copy link
Contributor

@tosoham tosoham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tosoham tosoham merged commit d3f0200 into Shonen-Labs:main May 4, 2025
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FRONTEND: Betting UX & StarkNet Transactions

2 participants

Comments