34 lines
838 B
Rust
34 lines
838 B
Rust
pub mod constants;
|
|
pub mod error;
|
|
pub mod instructions;
|
|
pub mod state;
|
|
|
|
use anchor_lang::prelude::*;
|
|
|
|
pub use constants::*;
|
|
pub use instructions::*;
|
|
pub use state::*;
|
|
|
|
declare_id!("HxsDuhD7wcPxcMsrYdteMYxkffuwff8HoxhZ7NuFtM37");
|
|
|
|
#[program]
|
|
pub mod bets {
|
|
use super::*;
|
|
|
|
pub fn initialize(ctx: Context<InitializeBetsList>) -> Result<()> {
|
|
initialize_bets_list::init(ctx)
|
|
}
|
|
|
|
pub fn create_bet(ctx: Context<CreateBet>, wager:u64,user_id:String, game_id:String, nonce:u64)-> Result<()>{
|
|
create_bet::create(ctx, wager, user_id, game_id,nonce)
|
|
}
|
|
|
|
pub fn join_bet(ctx: Context<JoinBet>,user_id:String, game_id:String) -> Result<()>{
|
|
join_bet::join(ctx,user_id, game_id)
|
|
}
|
|
|
|
pub fn close_bet(ctx:Context<CloseBet>, winner:Pubkey)->Result<()> {
|
|
close_bet::close(ctx, winner)
|
|
}
|
|
}
|