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

オープン
#758 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
12/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
blockchain, typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
TypeScript
スター
2
フォーク
5
平均マージ
23時間 23分
マージ済み PR(30日)
97

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

block52/ui のほかの issue

block52/ui の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。