This commit is contained in:
Sewmina 2025-08-02 01:25:46 +00:00
parent e2b0b55cb8
commit 8a28bc5716
4 changed files with 490 additions and 80 deletions

View File

@ -0,0 +1,4 @@
{
"path":"/root/cert.pfx",
"password": ""
}

View File

@ -320,8 +320,8 @@ export default function BeatHighscoreSection() {
);
}
const currentLeaderboard = leaderboards[selectedLeaderboardIndex];
const currentGame = highscoreGames.find(g => g.id === currentLeaderboard.gameId);
const currentLeaderboard = leaderboards[selectedLeaderboardIndex] || null;
const currentGame = currentLeaderboard ? highscoreGames.find(g => g.id === currentLeaderboard.gameId) : null;
return (
<>
@ -468,6 +468,14 @@ export default function BeatHighscoreSection() {
{remainingAttempts > 0 ? `${remainingAttempts} remaining` : 'Limit reached'}
</div>
</div>
<div className="flex flex-col items-center gap-2">
<div className="bg-green-600 text-white px-3 py-1 rounded-full text-sm font-bold">
{(currentLeaderboard.maxAttemptCount * 0.1).toFixed(1)} SOL
</div>
<div className="text-gray-400 text-xs">
Winner Prize
</div>
</div>
</>
) : (
<>
@ -485,6 +493,14 @@ export default function BeatHighscoreSection() {
Entry: {currentLeaderboard.entryTicketCount} ticket{currentLeaderboard.entryTicketCount > 1 ? 's' : ''}
</div>
</div>
<div className="flex flex-col items-center gap-2">
<div className="bg-green-600 text-white px-3 py-1 rounded-full text-sm font-bold">
{(currentLeaderboard.maxAttemptCount * 0.1).toFixed(1)} SOL
</div>
<div className="text-gray-400 text-xs">
Winner Prize
</div>
</div>
</>
);
})()}

View File

@ -31,11 +31,6 @@ export type Bets = {
"writable": true,
"signer": true
},
{
"name": "ticketSaleVault",
"writable": true,
"address": "9esrj2X33pr5og6fdkDMjaW6fdnnb9hT1cWshamxTdL4"
},
{
"name": "ticketLeaderboardList",
"writable": true,
@ -2041,6 +2036,236 @@ export type Bets = {
}
]
},
{
"name": "rewardLeaderboard",
"discriminator": [
180,
91,
212,
106,
79,
234,
247,
253
],
"accounts": [
{
"name": "payer",
"writable": true,
"signer": true
},
{
"name": "winner",
"writable": true
},
{
"name": "ticketLeaderboardList",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
116,
105,
99,
107,
101,
116,
95,
108,
101,
97,
100,
101,
114,
98,
111,
97,
114,
100,
115,
95,
108,
105,
115,
116
]
}
]
}
},
{
"name": "ticketLeaderboard",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
116,
105,
99,
107,
101,
116,
95,
108,
101,
97,
100,
101,
114,
98,
111,
97,
114,
100
]
},
{
"kind": "arg",
"path": "id"
}
]
}
},
{
"name": "ticketLeaderboardVault",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "ticketLeaderboard"
},
{
"kind": "account",
"path": "tokenProgram"
},
{
"kind": "account",
"path": "tokenMint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "ticketLeaderboardListVault",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "ticketLeaderboardList"
},
{
"kind": "account",
"path": "tokenProgram"
},
{
"kind": "account",
"path": "tokenMint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "tokenMint"
},
{
"name": "systemProgram",
"address": "11111111111111111111111111111111"
},
{
"name": "tokenProgram"
},
{
"name": "associatedTokenProgram",
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
}
],
"args": [
{
"name": "id",
"type": "u64"
}
]
},
{
"name": "updateLeaderboard",
"discriminator": [
@ -2268,43 +2493,13 @@ export type Bets = {
"errors": [
{
"code": 6000,
"name": "betNotFilled",
"msg": "Bet is not filled yet!"
"name": "invalidId",
"msg": "Invalid id"
},
{
"code": 6001,
"name": "betAlreadyFilled",
"msg": "Bet is already filled"
},
{
"code": 6002,
"name": "invalidWinner",
"msg": "The winner must be either the owner or the joiner of the bet."
},
{
"code": 6003,
"name": "invalidFeeCollector",
"msg": "Please use the correct fee collector address"
},
{
"code": 6004,
"name": "joinerAccountNotProvided",
"msg": "Joiner account not provided"
},
{
"code": 6005,
"name": "insufficientFunds",
"msg": "Insufficient funds"
},
{
"code": 6006,
"name": "feeCalculationError",
"msg": "Fee calculation error"
},
{
"code": 6007,
"name": "invalidTicketSaleVault",
"msg": "Invalid ticket sale vault address"
"name": "notActive",
"msg": "Not active"
}
],
"types": [

View File

@ -25,11 +25,6 @@
"writable": true,
"signer": true
},
{
"name": "ticket_sale_vault",
"writable": true,
"address": "9esrj2X33pr5og6fdkDMjaW6fdnnb9hT1cWshamxTdL4"
},
{
"name": "ticket_leaderboard_list",
"writable": true,
@ -2035,6 +2030,236 @@
}
]
},
{
"name": "reward_leaderboard",
"discriminator": [
180,
91,
212,
106,
79,
234,
247,
253
],
"accounts": [
{
"name": "payer",
"writable": true,
"signer": true
},
{
"name": "winner",
"writable": true
},
{
"name": "ticket_leaderboard_list",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
116,
105,
99,
107,
101,
116,
95,
108,
101,
97,
100,
101,
114,
98,
111,
97,
114,
100,
115,
95,
108,
105,
115,
116
]
}
]
}
},
{
"name": "ticket_leaderboard",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
116,
105,
99,
107,
101,
116,
95,
108,
101,
97,
100,
101,
114,
98,
111,
97,
114,
100
]
},
{
"kind": "arg",
"path": "id"
}
]
}
},
{
"name": "ticket_leaderboard_vault",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "ticket_leaderboard"
},
{
"kind": "account",
"path": "token_program"
},
{
"kind": "account",
"path": "token_mint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "ticket_leaderboard_list_vault",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "ticket_leaderboard_list"
},
{
"kind": "account",
"path": "token_program"
},
{
"kind": "account",
"path": "token_mint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "token_mint"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "token_program"
},
{
"name": "associated_token_program",
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
}
],
"args": [
{
"name": "id",
"type": "u64"
}
]
},
{
"name": "update_leaderboard",
"discriminator": [
@ -2262,43 +2487,13 @@
"errors": [
{
"code": 6000,
"name": "BetNotFilled",
"msg": "Bet is not filled yet!"
"name": "InvalidId",
"msg": "Invalid id"
},
{
"code": 6001,
"name": "BetAlreadyFilled",
"msg": "Bet is already filled"
},
{
"code": 6002,
"name": "InvalidWinner",
"msg": "The winner must be either the owner or the joiner of the bet."
},
{
"code": 6003,
"name": "InvalidFeeCollector",
"msg": "Please use the correct fee collector address"
},
{
"code": 6004,
"name": "JoinerAccountNotProvided",
"msg": "Joiner account not provided"
},
{
"code": 6005,
"name": "InsufficientFunds",
"msg": "Insufficient funds"
},
{
"code": 6006,
"name": "FeeCalculationError",
"msg": "Fee calculation error"
},
{
"code": 6007,
"name": "InvalidTicketSaleVault",
"msg": "Invalid ticket sale vault address"
"name": "NotActive",
"msg": "Not active"
}
],
"types": [