#[repr(C)]pub struct Dojo {Show 15 fields
pub owner: Pubkey,
pub battles_count: u64,
pub shard_balance: u64,
pub last_ore_claim_slot: u64,
pub referrer: Pubkey,
pub recruitment_ticket_balance: u64,
pub recruited_count: u64,
pub dine_count: u64,
pub pity_counter: u64,
pub flash_sale_count_today: u64,
pub last_flash_sale_reset_slot: u64,
pub amethyst_balance: u64,
pub active_scene_id: u64,
pub fodder_counts_prestige: FodderPrestigeCounts,
pub xp: u64,
}Fields§
§owner: Pubkey§battles_count: u64PvP battles initiated (stats / future tasks).
shard_balance: u64Refined ore buffer (same raw decimals as $DOJO) during claim_shards; minted to wallet in the same ix.
Dine / level / etc. burn wallet DOJO, not this field.
last_ore_claim_slot: u64§referrer: Pubkey§recruitment_ticket_balance: u64§recruited_count: u64§dine_count: u64§pity_counter: u64Pity counter: pulls since last SR+. At 10, next pull is forced SR+. Resets on SR+.
flash_sale_count_today: u64§last_flash_sale_reset_slot: u64§amethyst_balance: u64§active_scene_id: u64§fodder_counts_prestige: FodderPrestigeCountsPer-prestige fodder counts: (collection_index * PRESTIGE_LEVELS + prestige - 1). Prestige 1–6. collection_index = element×5+rarity (0–24). Recruit/merge add; seat/replace/prestige consume.
xp: u64Reward points (XP): stake accrual + PvP wins + recruit + forge/barracks upgrades + first dine per slot, etc.
Burned when claiming SOL from xp_reward_pool (claim_xp_rewards).
Implementations§
Source§impl Dojo
impl Dojo
Sourcepub fn fodder_prestige_index(collection_index: usize, prestige: u64) -> usize
pub fn fodder_prestige_index(collection_index: usize, prestige: u64) -> usize
Index for collection (element×5+rarity) at prestige level (1–6).
Sourcepub fn fodder_prestige_get(&self, collection_index: usize, prestige: u64) -> u64
pub fn fodder_prestige_get(&self, collection_index: usize, prestige: u64) -> u64
Get fodder count at (collection_index, prestige).
Sourcepub fn fodder_prestige_add(
&mut self,
collection_index: usize,
prestige: u64,
amount: u64,
)
pub fn fodder_prestige_add( &mut self, collection_index: usize, prestige: u64, amount: u64, )
Add to fodder at (collection_index, prestige).
Sourcepub fn fodder_prestige_sub(
&mut self,
collection_index: usize,
prestige: u64,
amount: u64,
) -> bool
pub fn fodder_prestige_sub( &mut self, collection_index: usize, prestige: u64, amount: u64, ) -> bool
Subtract from fodder at (collection_index, prestige). Returns false if insufficient.
Sourcepub fn fodder_total_for_collection(&self, collection_index: usize) -> u64
pub fn fodder_total_for_collection(&self, collection_index: usize) -> u64
Total fodder for collection across all prestige levels.
Sourcepub fn fodder_total(&self) -> u64
pub fn fodder_total(&self) -> u64
Total fodder across all collections (for recruit cap check).
Sourcepub fn fodder_prestige_consume_from_collection(
&mut self,
collection_index: usize,
amount: u64,
) -> bool
pub fn fodder_prestige_consume_from_collection( &mut self, collection_index: usize, amount: u64, ) -> bool
Consume amount from collection ci, taking from lowest prestige first. Returns false if insufficient.
pub fn assert_owner(&self, signer: &Pubkey) -> Result<(), ProgramError>
pub fn add_amethyst(&mut self, amount: u64)
pub fn sub_amethyst(&mut self, amount: u64) -> Result<(), ProgramError>
Sourcepub fn sub_shard_balance(&mut self, amount: u64) -> Result<(), ProgramError>
pub fn sub_shard_balance(&mut self, amount: u64) -> Result<(), ProgramError>
Spend in-game shards (dine, upgrades, rolls, etc.).
Trait Implementations§
Source§impl AccountValidation for Dojo
impl AccountValidation for Dojo
fn assert<F>(&self, condition: F) -> Result<&Self, ProgramError>
fn assert_err<F>( &self, condition: F, err: ProgramError, ) -> Result<&Self, ProgramError>
fn assert_msg<F>(&self, condition: F, msg: &str) -> Result<&Self, ProgramError>
fn assert_mut<F>(&mut self, condition: F) -> Result<&mut Self, ProgramError>
fn assert_mut_err<F>( &mut self, condition: F, err: ProgramError, ) -> Result<&mut Self, ProgramError>
fn assert_mut_msg<F>( &mut self, condition: F, msg: &str, ) -> Result<&mut Self, ProgramError>
Source§impl Discriminator for Dojo
impl Discriminator for Dojo
fn discriminator() -> u8
impl Copy for Dojo
impl Pod for Dojo
impl StructuralPartialEq for Dojo
Auto Trait Implementations§
impl Freeze for Dojo
impl RefUnwindSafe for Dojo
impl Send for Dojo
impl Sync for Dojo
impl Unpin for Dojo
impl UnsafeUnpin for Dojo
impl UnwindSafe for Dojo
Blanket Implementations§
Source§impl<T> AccountDeserialize for Twhere
T: Discriminator + Pod,
impl<T> AccountDeserialize for Twhere
T: Discriminator + Pod,
fn try_from_bytes(data: &[u8]) -> Result<&T, ProgramError>
fn try_from_bytes_mut(data: &mut [u8]) -> Result<&mut T, ProgramError>
Source§impl<T> AccountHeaderDeserialize for Twhere
T: Discriminator + Pod,
impl<T> AccountHeaderDeserialize for Twhere
T: Discriminator + Pod,
fn try_header_from_bytes(data: &[u8]) -> Result<(&T, &[u8]), ProgramError>
fn try_header_from_bytes_mut( data: &mut [u8], ) -> Result<(&mut T, &mut [u8]), ProgramError>
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more