//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/codama-idl/codama>
//!
syntax = "proto3";

package vixen.parser.settlement;

message ActivateGameIx {
	ActivateGameIxAccounts accounts = 1;
	ActivateGameIxData data = 2;
}

message AddAuthorizedProgramIx {
	AddAuthorizedProgramIxAccounts accounts = 1;
	AddAuthorizedProgramIxData data = 2;
}

message AddOperatorIx {
	AddOperatorIxAccounts accounts = 1;
	AddOperatorIxData data = 2;
}

message CancelBetIx {
	CancelBetIxAccounts accounts = 1;
	CancelBetIxData data = 2;
}

message CancelGameIx {
	CancelGameIxAccounts accounts = 1;
	CancelGameIxData data = 2;
}

message ClaimPayoutIx {
	ClaimPayoutIxAccounts accounts = 1;
	ClaimPayoutIxData data = 2;
}

message CloseBettingIx {
	CloseBettingIxAccounts accounts = 1;
	CloseBettingIxData data = 2;
}

message CreateGameIx {
	CreateGameIxAccounts accounts = 1;
	CreateGameIxData data = 2;
}

message GetPayoutsIx {
	GetPayoutsIxAccounts accounts = 1;
	GetPayoutsIxData data = 2;
}

message InitializeAuthorizedProgramsIx {
	InitializeAuthorizedProgramsIxAccounts accounts = 1;
	InitializeAuthorizedProgramsIxData data = 2;
}

message PlaceBetIx {
	PlaceBetIxAccounts accounts = 1;
	PlaceBetIxData data = 2;
}

message RemoveAuthorizedProgramIx {
	RemoveAuthorizedProgramIxAccounts accounts = 1;
	RemoveAuthorizedProgramIxData data = 2;
}

message RemoveOperatorIx {
	RemoveOperatorIxAccounts accounts = 1;
	RemoveOperatorIxData data = 2;
}

message SettleGameIx {
	SettleGameIxAccounts accounts = 1;
	SettleGameIxData data = 2;
}

message UpdateAdminIx {
	UpdateAdminIxAccounts accounts = 1;
	UpdateAdminIxData data = 2;
}

message UpdateFeeConfigIx {
	UpdateFeeConfigIxAccounts accounts = 1;
	UpdateFeeConfigIxData data = 2;
}

message UpdateLiquidityPoolProgramIx {
	UpdateLiquidityPoolProgramIxAccounts accounts = 1;
	UpdateLiquidityPoolProgramIxData data = 2;
}

message RepeatedUint32Row {
	repeated uint32 rows = 1;
}


message AdminUpdated {
	string old_admin = 1;
	string new_admin = 2;
	int64 updated_at = 3;
}

message AuthorizedProgramsInitialized {
	string admin = 1;
	repeated string initial_programs = 2;
	string liquidity_pool_program_id = 3;
	int64 initialized_at = 4;
}

message BetCancelled {
	uint64 game_id = 1;
	uint64 bet_id = 2;
	string player = 3;
	uint64 refund_amount = 4;
	uint64 expected_value_removed = 5;
	BetOdds bet_odds = 6;
	string game_program = 7;
	string escrow_vault = 8;
	int64 cancelled_at = 9;
}

message BetOdds {
	double odds_factor = 1;
	string bet_type = 2;
}

message BetPlaced {
	uint64 game_id = 1;
	uint64 bet_id = 2;
	string player = 3;
	uint64 bet_amount = 4;
	uint64 expected_value = 5;
	EvFeeBreakdownEvent ev_fee_breakdown = 6;
	string game_program = 7;
	string escrow_vault = 8;
	int64 timestamp = 9;
}

message BettingClosed {
	uint64 game_id = 1;
	int64 total_exposure = 2;
	int64 closed_at = 3;
	string settlement_program = 4;
}

message EvFeeBreakdownEvent {
	uint64 expected_value = 1;
	uint64 protocol_fee = 2;
	uint64 operator_fee = 3;
	uint64 affiliate_fee = 4;
}

message EvFeeConfig {
	uint32 ev_fee_bps = 1;
	uint32 protocol_fee_ev_bps = 2;
	uint32 operator_fee_ev_bps = 3;
	uint32 affiliate_fee_ev_bps = 4;
}

message FeeConfigUpdated {
	string admin = 1;
	EvFeeConfig old_config = 2;
	EvFeeConfig new_config = 3;
	int64 updated_at = 4;
}

message GameActivated {
	uint64 game_id = 1;
	string operator = 2;
	int64 activated_at = 3;
	string settlement_program = 4;
}

message GameCancelled {
	uint64 game_id = 1;
	int64 cancelled_at = 2;
	string settlement_program = 3;
}

message GameCancelledDueToExposure {
	uint64 game_id = 1;
	int64 total_exposure = 2;
	int64 cancelled_at = 3;
	string settlement_program = 4;
}

message GameCreated {
	uint64 game_id = 1;
	uint64 global_count = 2;
	string game_program = 3;
	string creator = 4;
	string operator = 5;
	optional string affiliate = 6;
	uint32 config_data_len = 7;
	int64 created_at = 8;
	bool registry_reused = 9;
}

enum GameRegistryState {
	GameRegistryStateUninitialized = 0;
	GameRegistryStateCreated = 1;
	GameRegistryStateActive = 2;
	GameRegistryStateSettled = 3;
	GameRegistryStateCancelled = 4;
}

message GameSettled {
	uint64 game_id = 1;
	uint64 house_amount = 2;
	uint64 total_claimable = 3;
	int64 total_exposure = 4;
	uint64 total_ev = 5;
	SettlementFees fees = 6;
	repeated uint32 final_randomness = 7;
	int64 settled_at = 8;
	string game_program = 9;
	string escrow_vault = 10;
	string game_settlement = 11;
}

enum GameState {
	GameStateActive = 0;
	GameStateSealed = 1;
	GameStateCompleted = 2;
	GameStateCancelled = 3;
}

message LiquidityPoolProgramUpdated {
	string admin = 1;
	string old_program_id = 2;
	string new_program_id = 3;
	int64 updated_at = 4;
}

message OperatorAdded {
	string operator = 1;
	string admin = 2;
	int64 added_at = 3;
}

message OperatorRemoved {
	string operator = 1;
	string admin = 2;
	int64 removed_at = 3;
}

message PayoutClaimed {
	uint64 game_id = 1;
	uint64 payout_index = 2;
	string recipient = 3;
	uint64 amount = 4;
	string claimer = 5;
	int64 claimed_at = 6;
}

message PayoutEntry {
	string recipient = 1;
	uint64 amount = 2;
}

message PayoutInfo {
	string recipient = 1;
	uint64 amount_bps = 2;
	bool is_claimed = 3;
	uint64 payout_index = 4;
}

message PayoutResponse {
	uint64 game_id = 1;
	GameRegistryState game_state = 2;
	repeated PayoutInfo payouts = 3;
	optional uint64 total_claimable = 4;
	optional uint64 total_claimed = 5;
	optional int64 settled_at = 6;
}

message ProgramAuthorized {
	string program_id = 1;
	string admin = 2;
	int64 authorized_at = 3;
}

message ProgramDeauthorized {
	string program_id = 1;
	string admin = 2;
	int64 deauthorized_at = 3;
}

message SettlementFees {
	uint64 protocol_fee = 1;
	uint64 operator_fee = 2;
	uint64 affiliate_fee = 3;
	uint64 total_fees_removed = 4;
	uint64 fees_retained = 5;
}


message AuthorizedPrograms {
	repeated string programs = 1;
	repeated string operators = 2;
	string admin = 3;
	uint64 game_counter = 4;
	EvFeeConfig ev_fee_config = 5;
	string liquidity_pool_program_id = 6;
	string game_keeper_program_id = 7;
	string rando_program_id = 8;
	string protocol_fee_account = 9;
	uint32 bump = 10;
}

message GameBetTracker {
	uint64 game_id = 1;
	uint64 global_count = 2;
	uint64 total_volume = 3;
	uint64 total_ev = 4;
	uint64 total_fees = 5;
	int64 total_exposure = 6;
	uint32 bet_count = 7;
	uint32 bump = 8;
}

message GameRandomness {
	uint64 game_id = 1;
	string settlement_program = 2;
	string game_creator = 3;
	repeated uint32 house_nonce_commitment = 4;
	bool house_nonce_revealed = 5;
	repeated uint32 final_randomness = 6;
	int64 created_at = 7;
	GameState state = 8;
	uint64 entropy_nonce = 9;
	optional uint64 sealed_randomness_height = 10;
	uint32 bump = 11;
}

message GameRegistry {
	uint64 game_id = 1;
	uint64 global_count = 2;
	string game_program = 3;
	string creator = 4;
	string operator = 5;
	string token_mint = 6;
	repeated uint32 game_config_data = 7;
	int64 created_at = 8;
	GameRegistryState state = 9;
	optional string affiliate = 10;
	uint32 bump = 11;
}

message GameSettlement {
	uint64 game_id = 1;
	repeated PayoutEntry payouts = 2;
	uint64 total_claimable = 3;
	uint64 total_claimed = 4;
	repeated uint32 claimed_bitmap = 5;
	int64 settled_at = 6;
}

message GlobalConfig {
	string admin = 1;
	repeated string authorized_settlements = 2;
	int64 created_at = 3;
	int64 updated_at = 4;
	uint32 bump = 5;
}

message LiquidityPool {
	string token_mint = 1;
	string vault = 2;
	string lp_token_mint = 3;
	uint64 total_lp_tokens = 4;
	uint64 current_exposure = 5;
	uint64 total_exposure_settled = 6;
	uint64 total_queued_deposits = 7;
	int64 created_at = 8;
	bool is_active = 9;
	uint32 bump = 10;
}

message PoolExposure {
	string pool = 1;
	uint64 total_exposure = 2;
	uint64 max_exposure_reached = 3;
	int64 updated_at = 4;
	uint32 bump = 5;
}

message RandomnessState {
	repeated RepeatedUint32Row chain_heads = 1;
	repeated RepeatedUint32Row active_queue = 2;
	repeated RepeatedUint32Row pending_queue = 3;
	uint32 steps_in_current_block = 4;
	uint32 max_steps_per_block = 5;
	uint64 total_steps = 6;
	uint64 last_tick_slot = 7;
	string admin = 8;
	repeated string trusted_providers = 9;
	repeated string authorized_readers = 10;
	int64 last_updated = 11;
	uint64 update_count = 12;
	uint32 bump = 13;
	uint64 mining_difficulty = 14;
	uint64 randomness_chain_height = 15;
	repeated RepeatedUint32Row randomness_chain_buffer = 16;
	repeated uint32 randomness_chain_head = 17;
	uint64 nonce = 18;
}


message ActivateGameIxAccounts {
	string game_registry = 1;
	string game_program = 2;
	string game_account = 3;
	string global_config = 4;
	string settlement_authority = 5;
	string game_keeper_signer = 6;
	string operator = 7;
	string authorized_programs = 8;
	string game_keeper_program = 9;
	string game_randomness = 10;
	string rando_program = 11;
	string gk_global_config = 12;
	string gk_global_config_program = 13;
	string settlement_program = 14;
	string randomness_state = 15;
	string instruction_sysvar = 16;
	string slot_hashes = 17;
	string system_program = 18;
}

message ActivateGameIxData {
	uint64 game_id = 1;
	repeated uint32 house_commitment = 2;
}

message AddAuthorizedProgramIxAccounts {
	string authorized_programs = 1;
	string admin = 2;
}

message AddAuthorizedProgramIxData {
	string program_id = 1;
}

message AddOperatorIxAccounts {
	string authorized_programs = 1;
	string admin = 2;
}

message AddOperatorIxData {
	string operator = 1;
}

message CancelBetIxAccounts {
	string game_registry = 1;
	string escrow_vault = 2;
	string token_mint = 3;
	string player_token_account = 4;
	string game_program = 5;
	string game_account = 6;
	string global_config = 7;
	optional string token_pool = 8;
	optional string pool_exposure = 9;
	string liquidity_pool_program = 10;
	string settlement_authority = 11;
	string player = 12;
	string authorized_programs = 13;
	string bet_tracker = 14;
	string rando_program = 15;
	string randomness_state = 16;
	string instruction_sysvar = 17;
	string slot_hashes = 18;
	string system_program = 19;
	string token_program = 20;
}

message CancelBetIxData {
	uint64 game_id = 1;
	uint64 bet_id = 2;
}

message CancelGameIxAccounts {
	string game_registry = 1;
	string game_program = 2;
	string game_account = 3;
	string global_config = 4;
	string settlement_authority = 5;
	string operator = 6;
	optional string game_keeper_program = 7;
	optional string game_randomness = 8;
	string authorized_programs = 9;
	string rando_program = 10;
	string randomness_state = 11;
	string instruction_sysvar = 12;
	string slot_hashes = 13;
	string system_program = 14;
}

message CancelGameIxData {
	uint64 game_id = 1;
}

message ClaimPayoutIxAccounts {
	string game_settlement = 1;
	string escrow_vault = 2;
	string settlement_authority = 3;
	string winner_token_account = 4;
	string authorized_programs = 5;
	string rando_program = 6;
	string global_entropy = 7;
	string instruction_sysvar = 8;
	string token_program = 9;
	string claimer = 10;
}

message ClaimPayoutIxData {
	uint64 game_id = 1;
	uint64 payout_index = 2;
}

message CloseBettingIxAccounts {
	string game_registry = 1;
	string authorized_programs = 2;
	string bet_tracker = 3;
	string game_program = 4;
	string game_account = 5;
	string lp_program_config = 6;
	string global_config = 7;
	string token_pool = 8;
	string pool_exposure = 9;
	string vault = 10;
	string lp_global_config = 11;
	string liquidity_pool_program = 12;
	string token_mint = 13;
	string settlement_authority = 14;
	string operator = 15;
	string rando_program = 16;
	string global_entropy = 17;
	string game_keeper_program = 18;
	string game_randomness = 19;
	string randomness_state = 20;
	string instruction_sysvar = 21;
	string slot_hashes = 22;
	string token_program = 23;
	string system_program = 24;
}

message CloseBettingIxData {
	uint64 game_id = 1;
}

message CreateGameIxAccounts {
	string game_registry = 1;
	string authorized_programs = 2;
	string game_program_account = 3;
	string game_account = 4;
	string global_config = 5;
	string token_mint = 6;
	string escrow_vault = 7;
	string settlement_authority = 8;
	string rando_program = 9;
	string randomness_state = 10;
	string slot_hashes = 11;
	string game_settlement = 12;
	string creator = 13;
	string system_program = 14;
	string token_program = 15;
}

message CreateGameIxData {
	string operator = 1;
	repeated uint32 game_config_data = 2;
	uint64 game_id = 3;
	optional string affiliate = 4;
}

message GetPayoutsIxAccounts {
	string game_registry = 1;
	optional string game_settlement = 2;
}

message GetPayoutsIxData {
	uint64 game_id = 1;
}

message InitializeAuthorizedProgramsIxAccounts {
	string authorized_programs = 1;
	string admin = 2;
	string rando_program = 3;
	string randomness_state = 4;
	string instruction_sysvar = 5;
	string slot_hashes = 6;
	string system_program = 7;
}

message InitializeAuthorizedProgramsIxData {
	repeated string initial_programs = 1;
	string liquidity_pool_program_id = 2;
	string game_keeper_program_id = 3;
	string protocol_fee_account = 4;
	optional uint32 max_operators = 5;
}

message PlaceBetIxAccounts {
	string game_registry = 1;
	string escrow_vault = 2;
	string token_mint = 3;
	string player_token_account = 4;
	string game_program = 5;
	string game_account = 6;
	string global_config = 7;
	string settlement_authority = 8;
	string player = 9;
	string authorized_programs = 10;
	string bet_tracker = 11;
	string game_keeper_program = 12;
	string game_randomness = 13;
	string rando_program = 14;
	string randomness_state = 15;
	string instruction_sysvar = 16;
	string slot_hashes = 17;
	string system_program = 18;
	string token_program = 19;
	string rent = 20;
}

message PlaceBetIxData {
	uint64 game_id = 1;
	uint64 bet_amount = 2;
	repeated uint32 bet_data = 3;
	uint64 bet_id = 4;
}

message RemoveAuthorizedProgramIxAccounts {
	string authorized_programs = 1;
	string admin = 2;
}

message RemoveAuthorizedProgramIxData {
	string program_id = 1;
}

message RemoveOperatorIxAccounts {
	string authorized_programs = 1;
	string admin = 2;
}

message RemoveOperatorIxData {
	string operator = 1;
}

message SettleGameIxAccounts {
	string operator = 1;
	string game_registry = 2;
	string escrow_vault = 3;
	string game_settlement = 4;
	string bet_tracker = 5;
	string game_randomness = 6;
	string game_keeper_signer = 7;
	string authorized_programs = 8;
	string game_program = 9;
	string game_account = 10;
	string global_config = 11;
	string game_keeper_program = 12;
	string rando_program = 13;
	string randomness_state = 14;
	string slot_hashes = 15;
	string settlement_authority = 16;
	string token_program = 17;
	string system_program = 18;
	string instruction_sysvar = 19;
}

message SettleGameIxData {
	uint64 game_id = 1;
	uint64 num_payouts = 2;
	repeated uint32 house_nonce = 3;
}

message UpdateAdminIxAccounts {
	string authorized_programs = 1;
	string current_admin = 2;
}

message UpdateAdminIxData {
	string new_admin = 1;
}

message UpdateFeeConfigIxAccounts {
	string authorized_programs = 1;
	string admin = 2;
}

message UpdateFeeConfigIxData {
	EvFeeConfig new_fee_config = 1;
}

message UpdateLiquidityPoolProgramIxAccounts {
	string authorized_programs = 1;
	string admin = 2;
}

message UpdateLiquidityPoolProgramIxData {
	string new_liquidity_pool_program_id = 1;
}


message ProgramState {
    oneof state_oneof {
        	AuthorizedPrograms authorized_programs = 1;
        	GameBetTracker game_bet_tracker = 2;
        	GameRandomness game_randomness = 3;
        	GameRegistry game_registry = 4;
        	GameSettlement game_settlement = 5;
        	GlobalConfig global_config = 6;
        	LiquidityPool liquidity_pool = 7;
        	PoolExposure pool_exposure = 8;
        	RandomnessState randomness_state = 9;
        }
}

message ProgramIxs {
    oneof ix_oneof {
        	ActivateGameIx activate_game = 1;
        	AddAuthorizedProgramIx add_authorized_program = 2;
        	AddOperatorIx add_operator = 3;
        	CancelBetIx cancel_bet = 4;
        	CancelGameIx cancel_game = 5;
        	ClaimPayoutIx claim_payout = 6;
        	CloseBettingIx close_betting = 7;
        	CreateGameIx create_game = 8;
        	GetPayoutsIx get_payouts = 9;
        	InitializeAuthorizedProgramsIx initialize_authorized_programs = 10;
        	PlaceBetIx place_bet = 11;
        	RemoveAuthorizedProgramIx remove_authorized_program = 12;
        	RemoveOperatorIx remove_operator = 13;
        	SettleGameIx settle_game = 14;
        	UpdateAdminIx update_admin = 15;
        	UpdateFeeConfigIx update_fee_config = 16;
        	UpdateLiquidityPoolProgramIx update_liquidity_pool_program = 17;
        }
}


