feat(ui): Play-for-NFT escrow-at-creation and winner claim flows

Aperta
#758 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
12/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
blockchain, typescript

Direzione di ricerca

Start with the linked design doc at ui/docs/designs/play-for-nft.md, since the issue defers much of the flow detail to it. Read nftImageResolver.ts to see how prize NFTs are displayed, and locate the existing cosmos-to-ETH wallet hooks and withdrawal-signature query the issue says to reuse. Done means the creator escrow and winner or refund claim flows work end to end, with the prize state shown as unconfirmed until the chain confirms it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement idea fairy

Part of #196 (Play for NFTs). Design: ui/docs/designs/play-for-nft.md.

Scope

UI for the two user-facing flows: escrow the NFT at SNG creation, and claim it as the winner.

Escrow-at-creation (creator)

  • In the SNG creation flow, option to add an NFT prize (contract + tokenId).
  • After MsgCreateGame returns the gameId, submit MsgRegisterNFTPrize, then prompt the ETH wallet to call ERC721.safeTransferFrom(creator, escrow, tokenId, abi.encode(gameId)) — one tx, no approve.
  • Show prize state: "unconfirmed" until the chain reports confirmed (SNG start is gated on it).
  • Display the prize NFT on the table (reuse nftImageResolver.ts).

Claim (winner)

  • On SNG finish, if the connected wallet is the winner, surface a "Claim NFT prize" action.
  • Collect the winner's ETH recipient address, call MsgRequestNFTUnlock(gameId, recipientEth), poll for the validator signature (query, like the withdrawal signature), then prompt the ETH wallet to call NFTPrizeEscrow.release(gameId, recipientEth, WIN, nonce, sig) — winner pays gas.
  • Refund path (creator) when the SNG is cancelled: same shape with REFUND to the depositor.

Notes

  • SDK types only (12 Commandments), double quotes, yarn in ui/.
  • Reuse the existing cosmos↔ETH wallet hooks and the withdrawal-signature query pattern.
Lingua principale
TypeScript
Stelle
2
Fork
5
Merge medio
22h 35m
PR unite (30g)
91

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di block52/ui

Tutte le issue di block52/ui

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.