Skip to main content

Module utils

Module utils 

Source
Expand description

Utility functions for the Lightcone Pinocchio SDK.

This module provides helper functions for ATA derivation, validation, and string serialization.

Structs§

OutcomeMetadataInput
Outcome metadata for conditional token creation.

Functions§

checked_add_u64
Add two u64 values and check for overflow.
checked_div_u64
Divide two u64 values and check for division by zero.
checked_mul_u64
Multiply two u64 values and check for overflow.
checked_sub_u64
Subtract two u64 values and check for underflow.
deserialize_string
Deserialize a string with a u16 length prefix.
get_associated_token_address
Get the Associated Token Address for a wallet and mint.
get_conditional_token_ata
Get the ATA for a conditional token (using Token-2022).
get_deposit_token_ata
Get the ATA for a deposit token (using SPL Token).
serialize_outcome_metadata
Serialize outcome metadata for the add_deposit_mint instruction.
serialize_string
Serialize a string with a u16 length prefix.
validate_32_bytes
Validate that a buffer is exactly 32 bytes.
validate_outcome_count
Validate that the number of outcomes is within the allowed range.
validate_outcome_index
Validate that an outcome index is valid for the given number of outcomes.