reward dist

This commit is contained in:
Sewmina Dilshan 2025-04-05 04:46:15 +05:30
parent 8b90e32645
commit 34bd7d66b3
4 changed files with 25 additions and 6 deletions

View File

@ -28,6 +28,10 @@
"name": "bet_vault",
"writable": true
},
{
"name": "fee_wallet",
"writable": true
},
{
"name": "winner",
"writable": true
@ -246,8 +250,8 @@
"errors": [
{
"code": 6000,
"name": "BetNotFilled",
"msg": "Bet is not filled yet!"
"name": "CustomError",
"msg": "Custom error message"
}
],
"types": [
@ -299,6 +303,11 @@
}
],
"constants": [
{
"name": "FEE_COLLECTOR",
"type": "string",
"value": "\"cocD4r4yNpHxPq7CzUebxEMyLki3X4d2Y3HcTX5ptUc\""
},
{
"name": "SEED",
"type": "string",

View File

@ -34,6 +34,10 @@ export type Bets = {
"name": "betVault",
"writable": true
},
{
"name": "feeWallet",
"writable": true
},
{
"name": "winner",
"writable": true
@ -252,8 +256,8 @@ export type Bets = {
"errors": [
{
"code": 6000,
"name": "betNotFilled",
"msg": "Bet is not filled yet!"
"name": "customError",
"msg": "Custom error message"
}
],
"types": [
@ -305,6 +309,11 @@ export type Bets = {
}
],
"constants": [
{
"name": "feeCollector",
"type": "string",
"value": "\"cocD4r4yNpHxPq7CzUebxEMyLki3X4d2Y3HcTX5ptUc\""
},
{
"name": "seed",
"type": "string",

View File

@ -25,7 +25,8 @@ async function close(){
const tx = await program.methods.closeBet(winner).accounts({
betVault: bet,
betsList: bet_list_pda,
winner: winner
winner: winner,
feeWallet: cocKeypair.publicKey
}).rpc();
console.log(`tx: ${tx}`);

View File

@ -30,7 +30,7 @@ async function join(){
const betAcc = await program.account.betVault.fetch(bet);
if (betAcc.joiner.toBase58() == SystemProgram.programId.toBase58()) {
console.log(`Joining ${bet}`);
const tx = await program.methods.joinBet("tetris").accounts({
const tx = await program.methods.joinBet("tester2","tetris").accounts({
betVault: bet,
}).rpc();
console.log(`tx: ${tx}`);