| Crates.io | carbon-profile-faction-decoder |
| lib.rs | carbon-profile-faction-decoder |
| version | 0.12.1 |
| created_at | 2025-10-22 16:56:58.243521+00 |
| updated_at | 2026-01-21 23:33:56.289844+00 |
| description | Rust decoder for Star Atlas Profile Faction program on Solana |
| homepage | https://github.com/staratlasmeta/star-atlas-decoders |
| repository | https://github.com/staratlasmeta/star-atlas-decoders |
| max_upload_size | |
| id | 1895951 |
| size | 125,426 |
Rust decoder for the Star Atlas Profile Faction program on Solana, generated using Carbon CLI.
pFACSRuobDmvfMKq1bAzwj27t6d2GJhSCHb1VcfnRmqAdd this crate to your Cargo.toml:
[dependencies]
carbon-profile-faction-decoder = "0.12.0"
use carbon_profile_faction_decoder::{ProfileFactionDecoder, ProfileFactionAccount};
use carbon_core::account::AccountDecoder;
let decoder = ProfileFactionDecoder;
let decoded_account = decoder.decode_account(&account);
if let Some(decoded) = decoded_account {
match decoded.data {
ProfileFactionAccount::ProfileFactionAccount(profile_faction) => {
println!("Profile: {:?}", profile_faction.profile);
println!("Faction: {:?}", profile_faction.faction);
println!("Version: {}", profile_faction.version);
}
}
}
The decoder includes a type-safe Faction enum:
use carbon_profile_faction_decoder::{ProfileFactionAccount, Faction};
let profile_faction: ProfileFactionAccount = /* ... */;
// Pattern match on faction
match profile_faction.faction {
Faction::Unaligned => println!("Player has not chosen a faction"),
Faction::MUD => println!("Player is aligned with MUD"),
Faction::ONI => println!("Player is aligned with ONI"),
Faction::Ustur => println!("Player is aligned with Ustur"),
}
// Check specific faction
if profile_faction.faction == Faction::MUD {
println!("MUD faction member detected");
}
This decoder supports the Profile Faction account type:
ProfileFactionAccount - Stores a profile's enlisted faction on-chain
version: u8 - Account data versionprofile: Pubkey - The profile this faction enlistment is forfaction: Faction - The faction of the profile (type-safe enum)bump: u8 - PDA bump seedThe Faction enum represents the available factions in Star Atlas:
Unaligned - Faction is not selected yet (default)MUD - The MUD factionONI - The ONI factionUstur - The Ustur factionFull documentation is available at docs.rs.
See the main repository for build instructions and contribution guidelines.
Licensed under the Apache-2.0 license.