diff --git a/src/components/PriceSelection.tsx b/src/components/PriceSelection.tsx index 336fc7c..853e385 100644 --- a/src/components/PriceSelection.tsx +++ b/src/components/PriceSelection.tsx @@ -6,7 +6,7 @@ interface PriceSelectionProps { } export function PriceSelection({ selectedPrice, onSelect }: PriceSelectionProps) { - const presets = [0.01, 0.05, 0.1, 0.2, 0.5, 1.0]; + const presets = [0.05, 0.1, 0.2, 0.5, 1.0]; const [inputValue, setInputValue] = useState(""); const MIN_AMOUNT = 0.01; diff --git a/src/components/YourGames.tsx b/src/components/YourGames.tsx index 513cc4e..7e45cd5 100644 --- a/src/components/YourGames.tsx +++ b/src/components/YourGames.tsx @@ -54,7 +54,7 @@ export default function YourGames({bets}:GameModalProps) { } }); try { - const tx = await closeBet(wallet, selectedBet.id); + const tx = await closeBet(wallet, selectedBet.id, user?.id ?? "na"); const url = EXPLORER_TX_TEMPLATE.replace("{address}", tx); connection.confirmTransaction(tx, CONFIRMATION_THRESHOLD).finally(()=>{ diff --git a/src/idl/bets.ts b/src/idl/bets.ts index a7bf1eb..4f430bb 100644 --- a/src/idl/bets.ts +++ b/src/idl/bets.ts @@ -56,6 +56,10 @@ export type Bets = { { "name": "winner", "type": "pubkey" + }, + { + "name": "userid", + "type": "string" } ] }, diff --git a/src/idl/bets_idl.json b/src/idl/bets_idl.json index da57568..333a496 100644 --- a/src/idl/bets_idl.json +++ b/src/idl/bets_idl.json @@ -50,6 +50,10 @@ { "name": "winner", "type": "pubkey" + }, + { + "name": "userid", + "type": "string" } ] }, diff --git a/src/shared/solana_helpers.ts b/src/shared/solana_helpers.ts index fa5050e..98a66b4 100644 --- a/src/shared/solana_helpers.ts +++ b/src/shared/solana_helpers.ts @@ -103,7 +103,7 @@ export async function getVaultByAddress(wallets: ConnectedSolanaWallet, address: return undefined; } -export async function closeBet(wallets: ConnectedSolanaWallet, betId: string): Promise { +export async function closeBet(wallets: ConnectedSolanaWallet, uid:string, betId: string): Promise { try { const wallet = { publicKey: new PublicKey(wallets.address), @@ -142,7 +142,7 @@ export async function closeBet(wallets: ConnectedSolanaWallet, betId: string): P // Execute the closeBet transaction const tx = await program.methods - .closeBet(winner) + .closeBet(winner, uid) .accounts({ betVault: chosenBet, betsList: bet_list_pda,