Accounts
The iCoordinates protocol leverages distinct Solana account structures to operate seamlessly within the blockchain ecosystem, providing crucial functionalities and interactions for users. Below is a detailed description of the key account structures along with their corresponding code snippets:
MatrixInfo:
Contains essential details related to the coordinate matrix, such as range limits, base mint, and protocol fee information.
#[account] pub struct MatrixInfo { pub authority: Pubkey, pub x_range_min: i64, pub x_range_max: i64, pub y_range_min: i64, pub y_range_max: i64, pub base_mint: Pubkey, pub sold_number: u64, pub current_product: f64, pub last_transaction_timestamp: i64, pub protocol_fee_withdrawal: u64, pub protocol_min_portion: f32, pub protocol_max_portion: f32, pub protocol_portion: f32, pub luckydraw_portion: f32, pub luckydraw_withdrawal: u64, }
LuckyDrawInfo:
Holds information about lucky draw events, including coordinates, timestamps, and reward details.
#[account] pub struct LuckyDrawInfo { pub x: i64, pub y: i64, pub timestamp: i64, pub total_amount: u64, pub milestone: u64, pub lucky_draw_reward_taken: [bool; 9], }
Coordinates:
Represents essential information for a coordinate, including owner details, contact information, and state.
#[account] pub struct Coordinates { pub owner: Pubkey, pub x: i64, pub y: i64, pub color: [u8; 4], pub email: String, pub website: String, pub slogan: String, pub init_timestamp: i64, pub state: CoordinatesState, pub country: Country, }
CoordinatesOnSale:
Contains details of coordinates available for sale, including coordinates and sale price.
#[account] pub struct CoordinatesOnSale { pub x: i64, pub y: i64, pub price: u64, }
OfferForCoordinates:
Captures data related to offers made on coordinates by users, such as coordinates, offered price, and offerer information.
#[account] pub struct OfferForCoordinates { pub x: i64, pub y: i64, pub price: u64, pub offerer: Pubkey, }
CoordinatesOnAuction:
Contains auction-related information for coordinates, including starting price, auction end time, last bid details, and bid count.
#[account] pub struct CoordinatesOnAuction { pub x: i64, pub y: i64, pub starting_price: u64, pub auction_endtime: i64, pub last_price: u64, pub last_bidder: Pubkey, pub bid_times: u64, }
These well-defined account structures serve as the backbone of the iCoordinates protocol, enabling smooth operation and interaction within the Solana blockchain ecosystem.
Last updated