anchor update

This commit is contained in:
Sewmina 2025-04-23 13:13:02 +00:00
parent e9594a754a
commit ea0d5c977a
4 changed files with 11 additions and 3 deletions

View File

@ -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(()=>{

View File

@ -56,6 +56,10 @@ export type Bets = {
{
"name": "winner",
"type": "pubkey"
},
{
"name": "userid",
"type": "string"
}
]
},

View File

@ -50,6 +50,10 @@
{
"name": "winner",
"type": "pubkey"
},
{
"name": "userid",
"type": "string"
}
]
},

View File

@ -103,7 +103,7 @@ export async function getVaultByAddress(wallets: ConnectedSolanaWallet, address:
return undefined;
}
export async function closeBet(wallets: ConnectedSolanaWallet, betId: string): Promise<string> {
export async function closeBet(wallets: ConnectedSolanaWallet, uid:string, betId: string): Promise<string> {
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,