use steel::*;
use bytemuck;
#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
pub enum OilInstruction {
Automate = 0,
AutomateWithSession = 40,
Initialize = 1,
Checkpoint = 2,
CheckpointWithSession = 52,
ClaimSOL = 3,
ClaimSOLWithSession = 44,
ClaimOIL = 4,
ClaimOILWithSession = 45,
Close = 5,
Deploy = 6,
DeployWithSession = 39,
Log = 8,
Reset = 9,
ReloadSOL = 22,
CreateReferral = 27,
CreateReferralWithSession = 49,
ClaimReferral = 28,
ClaimReferralWithSession = 50,
PlaceBid = 29,
PlaceBidWithSession = 41,
ClaimAuctionOIL = 31,
ClaimAuctionOILWithSession = 42,
ClaimAuctionSOL = 32,
ClaimAuctionSOLWithSession = 43,
Contribute = 53,
ContributeWithSession = 54,
CheckpointAuction = 55,
CheckpointAuctionWithSession = 56,
InitializeRefinery = 57,
PurchasePlot = 58,
UpgradePlot = 59,
PurchaseRig = 60,
PlaceRig = 61,
RemoveRig = 62,
ClaimRefineryRewards = 63,
RefuelPlot = 64,
SetRigConfig = 65,
PurchasePlotWithSession = 66,
UpgradePlotWithSession = 67,
PurchaseRigWithSession = 68,
PlaceRigWithSession = 69,
RemoveRigWithSession = 70,
RefuelPlotWithSession = 71,
ClaimRefineryRewardsWithSession = 72,
InitOilOracle = 73,
SetOilOraclePrice = 74,
SetOracleAuthority = 75,
InitCollection = 76,
Deposit = 10,
DepositWithSession = 48,
Withdraw = 11,
WithdrawWithSession = 47,
ClaimYield = 12,
ClaimYieldWithSession = 51,
Buyback = 13,
Wrap = 14,
SetAdmin = 16,
SetFeeCollector = 17,
SetSwapProgram = 18,
SetVarAddress = 19,
NewVar = 20,
SetAdminFee = 21,
Migrate = 26,
SetAuction = 33,
CreateWhitelist = 34,
SetTgeTimestamp = 35,
Liq = 37,
Barrel = 38,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Automate {
pub amount: [u8; 8],
pub deposit: [u8; 8],
pub fee: [u8; 8],
pub mask: [u8; 8],
pub strategy: u8,
pub reload: [u8; 8],
pub referrer: [u8; 32],
pub pooled: u8,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ClaimSOL {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ClaimOIL {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Deploy {
pub amount: [u8; 8],
pub squares: [u8; 4],
pub referrer: [u8; 32],
pub pooled: u8,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Log {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Reset {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Close {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct SetAdmin {
pub admin: [u8; 32],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct SetFeeCollector {
pub fee_collector: [u8; 32],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Buyback {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Liq {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Barrel {
pub amount: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Wrap {
pub use_liquidity: u8,
pub amount: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ReloadSOL {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Deposit {
pub amount: [u8; 8],
pub lock_duration_days: [u8; 8], pub stake_id: [u8; 8], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Withdraw {
pub amount: [u8; 8],
pub stake_id: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ClaimYield {
pub amount: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Checkpoint {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct NewVar {
pub id: [u8; 8],
pub commit: [u8; 32],
pub samples: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct SetAdminFee {
pub admin_fee: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct SetSwapProgram {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct SetVarAddress {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Migrate {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct CreateReferral {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ClaimReferral {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct CreateWhitelist {
pub code_hash: [u8; 32],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct SetTgeTimestamp {
pub tge_timestamp: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Initialize {
pub barrel_authority: [u8; 32],
pub fee_collector: [u8; 32],
pub swap_program: [u8; 32],
pub var_address: [u8; 32],
pub admin_fee: [u8; 8],
pub halving_period_seconds: [u8; 8],
pub base_mining_rates: [[u8; 8]; 4], pub auction_duration_seconds: [u8; 8],
pub starting_prices: [[u8; 8]; 4], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct PlaceBid {
pub square_id: [u8; 8],
pub referrer: [u8; 32],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ClaimAuctionOIL {
pub well_mask: u8,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ClaimAuctionSOL {
pub _reserved: u8,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct SetAuction {
pub halving_period_seconds: [u8; 8],
pub last_halving_time: [u8; 8],
pub base_mining_rates: [[u8; 8]; 4], pub auction_duration_seconds: [u8; 8],
pub starting_prices: [[u8; 8]; 4], pub well_id: [u8; 8], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Contribute {
pub well_id: [u8; 8],
pub amount: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct CheckpointAuction {
pub well_mask: u8,
pub epoch_ids: [[u8; 8]; 4],
}
instruction!(OilInstruction, Automate);
instruction!(OilInstruction, Initialize);
instruction!(OilInstruction, Checkpoint);
instruction!(OilInstruction, ClaimSOL);
instruction!(OilInstruction, ClaimOIL);
instruction!(OilInstruction, ReloadSOL);
instruction!(OilInstruction, Deploy);
instruction!(OilInstruction, Log);
instruction!(OilInstruction, Buyback);
instruction!(OilInstruction, Wrap);
instruction!(OilInstruction, Reset);
instruction!(OilInstruction, Close);
instruction!(OilInstruction, SetAdmin);
instruction!(OilInstruction, SetFeeCollector);
instruction!(OilInstruction, Deposit);
instruction!(OilInstruction, Withdraw);
instruction!(OilInstruction, ClaimYield);
instruction!(OilInstruction, NewVar);
instruction!(OilInstruction, SetAdminFee);
instruction!(OilInstruction, SetSwapProgram);
instruction!(OilInstruction, SetVarAddress);
instruction!(OilInstruction, Migrate);
instruction!(OilInstruction, CreateReferral);
instruction!(OilInstruction, ClaimReferral);
instruction!(OilInstruction, PlaceBid);
instruction!(OilInstruction, ClaimAuctionOIL);
instruction!(OilInstruction, ClaimAuctionSOL);
instruction!(OilInstruction, SetAuction);
instruction!(OilInstruction, CreateWhitelist);
instruction!(OilInstruction, SetTgeTimestamp);
instruction!(OilInstruction, Liq);
instruction!(OilInstruction, Barrel);
instruction!(OilInstruction, Contribute);
instruction!(OilInstruction, CheckpointAuction);
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct InitializeRefinery {
pub initial_emission: [u8; 8],
pub mining_powers: [[u8; 8]; 15],
pub fuel_requirements: [[u8; 8]; 15],
pub fuel_consumption_rates: [[u8; 8]; 15],
pub rig_supplies: [[u8; 8]; 15],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct PurchasePlot {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct UpgradePlot {
pub plot_level: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct PurchaseRig {
pub rig_type: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct PlaceRig {
pub rig_mint: [u8; 32],
pub slot: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct RemoveRig {
pub rig_mint: [u8; 32],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ClaimRefineryRewards {
pub fee_lamports: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct RefuelPlot {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct SetRigConfig {
pub rig_type: [u8; 8],
pub mining_power: [u8; 8],
pub fuel_requirement: [u8; 8],
pub fuel_consumption_rate: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct InitOilOracle {
pub oracle_authority: [u8; 32],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct SetOilOraclePrice {
pub price: [u8; 8],
pub expo: [u8; 4],
pub conf: [u8; 8],
pub ema: [u8; 8],
pub publish_time: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct SetOracleAuthority {
pub new_oracle_authority: [u8; 32],
}
instruction!(OilInstruction, InitializeRefinery);
instruction!(OilInstruction, PurchasePlot);
instruction!(OilInstruction, UpgradePlot);
instruction!(OilInstruction, PurchaseRig);
instruction!(OilInstruction, PlaceRig);
instruction!(OilInstruction, RemoveRig);
instruction!(OilInstruction, ClaimRefineryRewards);
instruction!(OilInstruction, RefuelPlot);
instruction!(OilInstruction, SetRigConfig);
instruction!(OilInstruction, InitOilOracle);
instruction!(OilInstruction, SetOilOraclePrice);
instruction!(OilInstruction, SetOracleAuthority);
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct InitCollection {}
instruction!(OilInstruction, InitCollection);