use crate::{JupiterLendDecoder, PROGRAM_ID};
#[cfg(feature = "postgres")]
pub mod postgres;
#[cfg(feature = "graphql")]
pub mod graphql;
pub mod change_status;
pub mod claim;
pub mod close_claim_account;
pub mod collect_revenue;
pub mod cpi_event;
pub mod init_claim_account;
pub mod init_liquidity;
pub mod init_new_protocol;
pub mod init_token_reserve;
pub mod operate;
pub mod pause_user;
pub mod pre_operate;
pub mod unpause_user;
pub mod update_authority;
pub mod update_auths;
pub mod update_exchange_price;
pub mod update_guardians;
pub mod update_rate_data_v1;
pub mod update_rate_data_v2;
pub mod update_revenue_collector;
pub mod update_token_config;
pub mod update_user_borrow_config;
pub mod update_user_class;
pub mod update_user_supply_config;
pub mod update_user_withdrawal_limit;
pub use self::{
change_status::*, claim::*, close_claim_account::*, collect_revenue::*, cpi_event::*,
init_claim_account::*, init_liquidity::*, init_new_protocol::*, init_token_reserve::*,
operate::*, pause_user::*, pre_operate::*, unpause_user::*, update_authority::*,
update_auths::*, update_exchange_price::*, update_guardians::*, update_rate_data_v1::*,
update_rate_data_v2::*, update_revenue_collector::*, update_token_config::*,
update_user_borrow_config::*, update_user_class::*, update_user_supply_config::*,
update_user_withdrawal_limit::*,
};
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type", content = "data"))]
pub enum JupiterLendInstruction {
ChangeStatus {
program_id: solana_pubkey::Pubkey,
data: ChangeStatus,
accounts: ChangeStatusInstructionAccounts,
},
Claim {
program_id: solana_pubkey::Pubkey,
data: Claim,
accounts: ClaimInstructionAccounts,
},
CloseClaimAccount {
program_id: solana_pubkey::Pubkey,
data: CloseClaimAccount,
accounts: CloseClaimAccountInstructionAccounts,
},
CollectRevenue {
program_id: solana_pubkey::Pubkey,
data: CollectRevenue,
accounts: CollectRevenueInstructionAccounts,
},
InitClaimAccount {
program_id: solana_pubkey::Pubkey,
data: InitClaimAccount,
accounts: InitClaimAccountInstructionAccounts,
},
InitLiquidity {
program_id: solana_pubkey::Pubkey,
data: InitLiquidity,
accounts: InitLiquidityInstructionAccounts,
},
InitNewProtocol {
program_id: solana_pubkey::Pubkey,
data: InitNewProtocol,
accounts: InitNewProtocolInstructionAccounts,
},
InitTokenReserve {
program_id: solana_pubkey::Pubkey,
data: InitTokenReserve,
accounts: InitTokenReserveInstructionAccounts,
},
Operate {
program_id: solana_pubkey::Pubkey,
data: Operate,
accounts: OperateInstructionAccounts,
},
PauseUser {
program_id: solana_pubkey::Pubkey,
data: PauseUser,
accounts: PauseUserInstructionAccounts,
},
PreOperate {
program_id: solana_pubkey::Pubkey,
data: PreOperate,
accounts: PreOperateInstructionAccounts,
},
UnpauseUser {
program_id: solana_pubkey::Pubkey,
data: UnpauseUser,
accounts: UnpauseUserInstructionAccounts,
},
UpdateAuthority {
program_id: solana_pubkey::Pubkey,
data: UpdateAuthority,
accounts: UpdateAuthorityInstructionAccounts,
},
UpdateAuths {
program_id: solana_pubkey::Pubkey,
data: UpdateAuths,
accounts: UpdateAuthsInstructionAccounts,
},
UpdateExchangePrice {
program_id: solana_pubkey::Pubkey,
data: UpdateExchangePrice,
accounts: UpdateExchangePriceInstructionAccounts,
},
UpdateGuardians {
program_id: solana_pubkey::Pubkey,
data: UpdateGuardians,
accounts: UpdateGuardiansInstructionAccounts,
},
UpdateRateDataV1 {
program_id: solana_pubkey::Pubkey,
data: UpdateRateDataV1,
accounts: UpdateRateDataV1InstructionAccounts,
},
UpdateRateDataV2 {
program_id: solana_pubkey::Pubkey,
data: UpdateRateDataV2,
accounts: UpdateRateDataV2InstructionAccounts,
},
UpdateRevenueCollector {
program_id: solana_pubkey::Pubkey,
data: UpdateRevenueCollector,
accounts: UpdateRevenueCollectorInstructionAccounts,
},
UpdateTokenConfig {
program_id: solana_pubkey::Pubkey,
data: UpdateTokenConfig,
accounts: UpdateTokenConfigInstructionAccounts,
},
UpdateUserBorrowConfig {
program_id: solana_pubkey::Pubkey,
data: UpdateUserBorrowConfig,
accounts: UpdateUserBorrowConfigInstructionAccounts,
},
UpdateUserClass {
program_id: solana_pubkey::Pubkey,
data: UpdateUserClass,
accounts: UpdateUserClassInstructionAccounts,
},
UpdateUserSupplyConfig {
program_id: solana_pubkey::Pubkey,
data: UpdateUserSupplyConfig,
accounts: UpdateUserSupplyConfigInstructionAccounts,
},
UpdateUserWithdrawalLimit {
program_id: solana_pubkey::Pubkey,
data: UpdateUserWithdrawalLimit,
accounts: UpdateUserWithdrawalLimitInstructionAccounts,
},
CpiEvent {
program_id: solana_pubkey::Pubkey,
data: CpiEvent,
accounts: CpiEventInstructionAccounts,
},
}
impl carbon_core::instruction::InstructionDecoder<'_> for JupiterLendDecoder {
type InstructionType = JupiterLendInstruction;
fn decode_instruction(
&self,
instruction: &solana_instruction::Instruction,
) -> Option<Self::InstructionType> {
if instruction.program_id != PROGRAM_ID {
return None;
}
carbon_core::try_decode_instructions!(
instruction,
PROGRAM_ID,
JupiterLendInstruction::ChangeStatus => ChangeStatus,
JupiterLendInstruction::Claim => Claim,
JupiterLendInstruction::CloseClaimAccount => CloseClaimAccount,
JupiterLendInstruction::CollectRevenue => CollectRevenue,
JupiterLendInstruction::InitClaimAccount => InitClaimAccount,
JupiterLendInstruction::InitLiquidity => InitLiquidity,
JupiterLendInstruction::InitNewProtocol => InitNewProtocol,
JupiterLendInstruction::InitTokenReserve => InitTokenReserve,
JupiterLendInstruction::Operate => Operate,
JupiterLendInstruction::PauseUser => PauseUser,
JupiterLendInstruction::PreOperate => PreOperate,
JupiterLendInstruction::UnpauseUser => UnpauseUser,
JupiterLendInstruction::UpdateAuthority => UpdateAuthority,
JupiterLendInstruction::UpdateAuths => UpdateAuths,
JupiterLendInstruction::UpdateExchangePrice => UpdateExchangePrice,
JupiterLendInstruction::UpdateGuardians => UpdateGuardians,
JupiterLendInstruction::UpdateRateDataV1 => UpdateRateDataV1,
JupiterLendInstruction::UpdateRateDataV2 => UpdateRateDataV2,
JupiterLendInstruction::UpdateRevenueCollector => UpdateRevenueCollector,
JupiterLendInstruction::UpdateTokenConfig => UpdateTokenConfig,
JupiterLendInstruction::UpdateUserBorrowConfig => UpdateUserBorrowConfig,
JupiterLendInstruction::UpdateUserClass => UpdateUserClass,
JupiterLendInstruction::UpdateUserSupplyConfig => UpdateUserSupplyConfig,
JupiterLendInstruction::UpdateUserWithdrawalLimit => UpdateUserWithdrawalLimit,
JupiterLendInstruction::CpiEvent => CpiEvent,
)
}
}