| Crates.io | carbon-crafting-decoder |
| lib.rs | carbon-crafting-decoder |
| version | 0.12.1 |
| created_at | 2026-01-16 00:54:35.741604+00 |
| updated_at | 2026-01-21 22:45:52.874024+00 |
| description | Rust decoder for Star Atlas Crafting program on Solana |
| homepage | https://github.com/staratlasmeta/star-atlas-decoders |
| repository | https://github.com/staratlasmeta/star-atlas-decoders |
| max_upload_size | |
| id | 2047488 |
| size | 247,448 |
Rust decoder for the Star Atlas Crafting program on Solana, generated using Carbon CLI.
CRAFT2RPXPJWCEix4WpJST3E7NLf79GTqZUL75wngXo5Add this crate to your Cargo.toml:
[dependencies]
carbon-crafting-decoder = "0.12.0"
use carbon_crafting_decoder::{CraftingDecoder, CraftingAccount};
use carbon_core::account::AccountDecoder;
let decoder = CraftingDecoder;
let decoded_account = decoder.decode_account(&account);
if let Some(decoded) = decoded_account {
match decoded.data {
CraftingAccount::Recipe(recipe) => {
println!("Recipe: {:?}", recipe);
println!("Duration: {}", recipe.duration);
println!("Status: {:?}", recipe.status);
println!("Consumables: {}", recipe.consumables_count);
println!("Outputs: {}", recipe.outputs_count);
println!("Total items: {}", recipe.recipe_items.len());
// Access recipe inputs/outputs from remaining data
for (i, item) in recipe.recipe_items.iter().enumerate() {
println!("Item {}: amount={}, mint={}", i, item.amount, item.mint);
}
}
CraftingAccount::CraftingFacility(facility) => {
println!("Crafting Facility: {:?}", facility);
println!("Location: {}", facility.location);
println!("Location Type: {:?}", facility.location_type);
println!("Efficiency: {}", facility.efficiency);
println!("Max Concurrent Processes: {}", facility.max_concurrent_processes);
println!("Recipe categories: {}", facility.recipe_categories.len());
// Access recipe category pubkeys from remaining data
for (i, category) in facility.recipe_categories.iter().enumerate() {
println!("Category {}: {}", i, category);
}
}
CraftingAccount::CraftingProcess(process) => {
println!("Crafting Process: {:?}", process);
println!("Recipe: {}", process.recipe);
println!("Status: {:?}", process.status);
println!("Start Time: {}", process.start_time);
println!("End Time: {}", process.end_time);
}
CraftingAccount::CraftableItem(item) => {
println!("Craftable Item: {:?}", item);
println!("Mint: {}", item.mint);
}
CraftingAccount::Domain(domain) => {
println!("Crafting Domain: {:?}", domain);
println!("Authority Profile: {}", domain.authority_profile);
}
CraftingAccount::RecipeCategory(category) => {
println!("Recipe Category: {:?}", category);
}
}
}
The decoder provides type-safe enums for status and type fields:
use carbon_crafting_decoder::{ProcessStatus, RecipeStatus, LocationType};
// Check process status
match process.status {
ProcessStatus::Initialized => println!("Process initialized"),
ProcessStatus::Started => println!("Process in progress"),
ProcessStatus::Completed => println!("Process complete"),
}
// Check recipe status
match recipe.status {
RecipeStatus::Initializing => println!("Recipe being set up"),
RecipeStatus::Active => println!("Recipe available for use"),
RecipeStatus::Deactivated => println!("Recipe disabled"),
}
// Check facility location type
match facility.location_type {
LocationType::Starbase => println!("Located at a starbase"),
}
This decoder supports all Crafting account types:
Recipe - Blueprint defining inputs, outputs, duration, and requirements for crafting. Includes recipe_items (VecCraftingFacility - Physical location where crafting occurs with efficiency modifiers. Includes recipe_categories (VecCraftingProcess - Active crafting operation tracking progress and statusCraftableItem - Item that can be produced through craftingDomain - Administrative domain controlling crafting permissionsRecipeCategory - Classification system for organizing recipesInitialized - Process created but not yet startedStarted - Crafting in progressCompleted - Crafting finished, ready to claim outputsInitializing - Recipe being configuredActive - Recipe available for useDeactivated - Recipe disabled and unavailableStarbase - Crafting facility located at a starbaseFull documentation is available at docs.rs.
See the main repository for build instructions and contribution guidelines.
Licensed under the Apache-2.0 license.