Carbon Points Decoder
Rust decoder for the Star Atlas Points program on Solana, generated using Carbon CLI.
Program Information
- Program ID:
Point2iBvz7j5TMVef8nEgpmz4pDr7tU7v3RjAfkQbM - Network: Solana Mainnet
- Description: Star Atlas Points program for managing player progression systems with categories, levels, and point tracking. Supports daily point limits, level upgrades, token-gated progression, and spendable points mechanics.
Features
- Decodes all Points account types
- Full instruction parsing support
- Integration with Carbon indexing framework
- Support for point categories with configurable levels
- Token-gated level progression with license types
- Daily point tracking and limits
Usage
Add this crate to your Cargo.toml:
[]
= "0.10.0"
Decoding Accounts
use ;
use AccountDecoder;
let decoder = PointsDecoder;
let decoded_account = decoder.decode_account;
if let Some = decoded_account
Working with License Types
The Points program uses license types to control level progression requirements:
use ;
// LicenseType is used for level upgrade requirements with quantity
match license_type
// PointsLevelLicenseType is a simpler enum without quantities
match license
Working with Boolean Flags
The Points program uses u8 fields for boolean flags. Check them like this:
// Check if a point category requires tokens
if category.token_required != 0
// Check if points are spendable
if category.is_spendable != 0
// Check if tokens should be transferred to vault
if category.transfer_tokens_to_vault != 0
// Check modifier permissions
if modifier.can_increment != 0
if modifier.can_decrement != 0
Account Types
This decoder supports all Points account types:
-
PointCategory- Defines a category of points with levels, limits, and token requirements- Contains point limits, spendability settings, and token-gating configuration
- Supports dynamic levels array (stored as RemainingData in the on-chain account)
- Can require tokens for point earning or level upgrades
-
UserPointsAccount- Tracks a user's points and level for a specific category- Stores earned points, spent points, and current level
- Includes daily point tracking with timestamps
- Links to a profile and point category
-
PointsModifier- Grants authority to modify points for a specific category- Controls increment and decrement permissions
- Used to delegate point management authority
License Types
The Points program uses two license type enums:
LicenseType
An enum with associated data for level upgrade requirements:
None- No license or tokens requiredBurn { quantity: u64 }- Requires burning the specified quantity of tokensVault { quantity: u64 }- Requires transferring tokens to a vault
PointsLevelLicenseType
A simpler enum without quantities:
None- No license requiredBurn- Burn-type licenseVault- Vault-type license
Documentation
Full documentation is available at docs.rs.
Repository
See the main repository for build instructions and contribution guidelines.
License
Licensed under the Apache-2.0 license.