Skip to content

geeorgipehlianov1/auction-icp-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auctions Service

A simple DFINITY Canister smart contract for managing auctions.

Features

  • Create Auctions: Easily create new auctions with essential details.
  • Update Auctions: Owners can update auction information.
  • End Auctions: Owners can end auctions, marking them as inactive.
  • Retrieve Auctions: Fetch auctions based on various criteria, such as ID, status, and owner.
  • Validation: Ensure valid auction status before retrieval or creation.

Usage

Query Functions

  1. Get All Auctions:

    • /getAllAuctions: Retrieve a list of all auctions.
  2. Get Auction by ID:

    • /getAuctionById/{auctionId}: Retrieve details of a specific auction by ID.
  3. Get Owner's Auctions:

    • /getOwnersAuctions: Retrieve auctions owned by the caller.
  4. Get Auctions by Status:

    • /getAuctionsByStatus/{status}: Retrieve auctions with a specific status.
  5. Get Active Auctions:

    • /getActiveAuctions: Retrieve auctions with an active status.
  6. Get Expired Auctions:

    • /getExpiredAuctions: Retrieve auctions with an inactive status.

Update Functions

  1. Create Auction:

    • /createAuction: Create a new auction with provided details.
  2. Update Auction:

    • /updateAuction/{auctionId}: Update details of an existing auction.
  3. End Auction:

    • /endAuction/{auctionId}: End an auction, marking it as inactive.
  4. Delete Auction:

    • /deleteAuction/{auctionId}: Delete an auction (owner only).

Helper Function

  1. Is Auction Status Valid:
    • Function: isAuctionStatusValid(status: string)
    • Returns: Boolean indicating whether the provided auction status is valid.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published