diff --git a/public/UnityBuild/walls/cert.json b/public/UnityBuild/walls/cert.json
new file mode 100644
index 0000000..9974a65
--- /dev/null
+++ b/public/UnityBuild/walls/cert.json
@@ -0,0 +1,4 @@
+{
+ "path":"/root/cert.pfx",
+ "password": ""
+}
\ No newline at end of file
diff --git a/src/components/BeatHighscoreSection.tsx b/src/components/BeatHighscoreSection.tsx
index c49354a..e1b1d9b 100644
--- a/src/components/BeatHighscoreSection.tsx
+++ b/src/components/BeatHighscoreSection.tsx
@@ -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'}
+
+
+ {(currentLeaderboard.maxAttemptCount * 0.1).toFixed(1)} SOL
+
+
+ Winner Prize
+
+
>
) : (
<>
@@ -485,6 +493,14 @@ export default function BeatHighscoreSection() {
Entry: {currentLeaderboard.entryTicketCount} ticket{currentLeaderboard.entryTicketCount > 1 ? 's' : ''}
+
+
+ {(currentLeaderboard.maxAttemptCount * 0.1).toFixed(1)} SOL
+
+
+ Winner Prize
+
+
>
);
})()}
diff --git a/src/idl/bets.ts b/src/idl/bets.ts
index 6119ae0..c0a91f0 100644
--- a/src/idl/bets.ts
+++ b/src/idl/bets.ts
@@ -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": [
diff --git a/src/idl/bets_idl.json b/src/idl/bets_idl.json
index 5467012..5f57b78 100644
--- a/src/idl/bets_idl.json
+++ b/src/idl/bets_idl.json
@@ -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": [