github.com/algorand/go-algorand-sdk@v1.24.0/types/auction.go (about)

     1  package types
     2  
     3  // Bid represents a bid by a user as part of an auction.
     4  type Bid struct {
     5  	_struct struct{} `codec:",omitempty,omitemptyarray"`
     6  
     7  	// BidderKey identifies the bidder placing this bid.
     8  	BidderKey Address `codec:"bidder"`
     9  
    10  	// BidCurrency specifies how much external currency the bidder
    11  	// is putting in with this bid.
    12  	BidCurrency uint64 `codec:"cur"`
    13  
    14  	// MaxPrice specifies the maximum price, in units of external
    15  	// currency per Algo, that the bidder is willing to pay.
    16  	// This must be at least as high as the current price of the
    17  	// auction in the block in which this bid appears.
    18  	MaxPrice uint64 `codec:"price"`
    19  
    20  	// BidID identifies this bid.  The first bid by a bidder (identified
    21  	// by BidderKey) with a particular BidID on the blockchain will be
    22  	// considered, preventing replay of bids.  Specifying a different
    23  	// BidID allows the bidder to place multiple bids in an auction.
    24  	BidID uint64 `codec:"id"`
    25  
    26  	// AuctionKey specifies the auction for this bid.
    27  	AuctionKey Address `codec:"auc"`
    28  
    29  	// AuctionID identifies the auction for which this bid is intended.
    30  	AuctionID uint64 `codec:"aid"`
    31  }
    32  
    33  // SignedBid represents a signed bid by a bidder.
    34  type SignedBid struct {
    35  	_struct struct{} `codec:",omitempty,omitemptyarray"`
    36  
    37  	// Bid contains information about the bid.
    38  	Bid Bid `codec:"bid"`
    39  
    40  	// Sig is a signature by the bidder, as identified in the bid
    41  	// (Bid.BidderKey) over the hash of the Bid.
    42  	Sig Signature `codec:"sig"`
    43  }
    44  
    45  // NoteFieldType indicates a type of auction message encoded into a
    46  // transaction's Note field.
    47  type NoteFieldType string
    48  
    49  const (
    50  	// NoteDeposit indicates a SignedDeposit message.
    51  	NoteDeposit NoteFieldType = "d"
    52  
    53  	// NoteBid indicates a SignedBid message.
    54  	NoteBid NoteFieldType = "b"
    55  
    56  	// NoteSettlement indicates a SignedSettlement message.
    57  	NoteSettlement NoteFieldType = "s"
    58  
    59  	// NoteParams indicates a SignedParams message.
    60  	NoteParams NoteFieldType = "p"
    61  )
    62  
    63  // NoteField is the struct that represents an auction message.
    64  type NoteField struct {
    65  	_struct struct{} `codec:",omitempty,omitemptyarray"`
    66  
    67  	// Type indicates which type of a message this is
    68  	Type NoteFieldType `codec:"t"`
    69  
    70  	// SignedBid, for NoteBid type
    71  	SignedBid SignedBid `codec:"b"`
    72  }