Instructions

Exploring iCoordinates Solana Program

The icoordinates_solana program is a Solana-based smart contract that facilitates various actions and operations related to the iCoordinates protocol. In this article, we'll delve into the different functions provided by this program, understanding their purpose and how they are implemented.

Instruction: initialize

pub fn initialize(ctx: Context<InitializeController>,x_min: i64,x_max: i64,y_min: i64,y_max: i64,protocol_min_portion:f32,protocol_max_portion:f32,luckydraw_portion:f32) -> Result<()>

The initialize function is used to initialize the iCoordinates protocol. It sets the initial configuration, including the allowed ranges for coordinates (x_min, x_max, y_min, y_max) and portions for protocol fees (protocol_min_portion, protocol_max_portion) and lucky draw rewards (luckydraw_portion).

Instruction: buy_coordinates_on_sale

pub fn buy_coordinates_on_sale(ctx: Context<BuyCoordinatesOnSaleController>,x: i64,y: i64) -> Result<()>

The buy_coordinates_on_sale function enables users to purchase coordinates that are listed for sale.

Instruction: change_coordinates_price

pub fn change_coordinates_price(ctx: Context<ChangeCoordinatesPriceController>,x: i64,y: i64,price:u64) -> Result<()>

The change_coordinates_price function allows the owner to change the price of coordinates that are listed for sale.

Instruction: claim_lucky_draw

pub fn claim_lucky_draw(ctx: Context<ClaimLuckyDrawController>,x: i64,y: i64) -> Result<()>

The claim_lucky_draw function allows a user to claim a lucky draw reward for specific coordinates.

Instruction: edit_coordinates

pub fn edit_coordinates(ctx: Context<EditCoordinatesController>,x: i64,y: i64,email:String,website:String,slogan:String,red:u8,green:u8,blue:u8,transparency:u8,country:Country) -> Result<()>

The edit_coordinates function allows the owner to edit the details of a set of coordinates.

Instruction: purchase_coordinates

rustCopy codepub fn purchase_coordinates(ctx: Context<PurchaseCoordinatesController>,x: i64,y: i64) -> Result<()>

The purchase_coordinates function enables a user to purchase specific coordinates.

Instruction: put_coordinates_on_sale

rustCopy codepub fn put_coordinates_on_sale(ctx: Context<PutCoordinatesOnSaleController>,x: i64,y: i64,price:u64) -> Result<()>

The put_coordinates_on_sale function allows a user to list coordinates for sale with a specified price.

Instruction: retract_coordinates_off_market

rustCopy codepub fn retract_coordinates_off_market(ctx: Context<RetractControllerOffSaleController>, x: i64, y: i64) -> Result<()>

The retract_coordinates_off_market function lets a user retract coordinates that were previously listed for sale.

Instruction: return_coordinates

rustCopy codepub fn return_coordinates(ctx: Context<ReturnCoordinatesController>,x: i64,y: i64) -> Result<()>

The return_coordinates function enables the return of specific coordinates to the protocol.

Instruction: transfer_coordinates

rustCopy codepub fn transfer_coordinates(ctx: Context<TransferCoordinatesController>,x: i64,y: i64,new_owner:Pubkey) -> Result<()>

The transfer_coordinates function facilitates the transfer of ownership of coordinates to a new owner specified by new_owner.

Instruction: put_coordinates_on_auction

rustCopy codepub fn put_coordinates_on_auction(ctx: Context<PutCoordinatesOnAuctionController>,x: i64,y: i64,price:u64,endtime:i64) -> Result<()>

The put_coordinates_on_auction function allows a user to list coordinates for auction with a starting price and an end time for bidding.

Instruction: seller_cancel_auction

rustCopy codepub fn seller_cancel_auction(ctx: Context<SellerCancelAuctionController>,x: i64,y: i64) -> Result<()>

The seller_cancel_auction function enables the seller to cancel an ongoing auction for specific coordinates.

Instruction: bid_on_auction

rustCopy codepub fn bid_on_auction(ctx: Context<BidOnAuctionController>,x: i64,y: i64,price:u64) -> Result<()>

The bid_on_auction function allows a user to place a bid on coordinates listed for auction.

Instruction: seller_confirm_auction_order

rustCopy codepub fn seller_confirm_auction_order(ctx: Context<SellerConfirmAuctionOrderController>,x: i64,y: i64) -> Result<()>

The seller_confirm_auction_order function allows the seller to confirm the auction for specific coordinates, transferring ownership to the highest bidder.

Instruction: buyer_confirm_auction_order

rustCopy codepub fn buyer_confirm_auction_order(ctx: Context<BuyerConfirmAuctionOrderController>,x: i64,y: i64) -> Result<()>

The buyer_confirm_auction_order function allows the highest bidder to confirm the auction for specific coordinates, completing the transaction and transferring ownership.

Instruction: give_offer

rustCopy codepub fn give_offer(ctx: Context<GiveOfferController>,x: i64,y: i64,price:u64) -> Result<()>

The give_offer function enables a user to make an offer for specified coordinates, indicating the amount they are willing to pay.

Instruction: cancel_offer

rustCopy codepub fn cancel_offer(ctx: Context<CancelOfferController>,x: i64,y: i64) -> Result<()>

The cancel_offer function allows the offerer to cancel their offer for the specified coordinates if it hasn't been accepted.

Instruction: accept_offer

rustCopy codepub fn accept_offer(ctx: Context<AcceptOfferController>,x: i64,y: i64) -> Result<()>

The accept_offer function enables the owner of coordinates to accept a specific offer, transferring ownership to the offerer.

Last updated