aboutsummaryrefslogtreecommitdiff
path: root/auction.go
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@codeblau.de>2024-04-05 18:06:35 +0200
committerÖzgür Kesim <oec@codeblau.de>2024-04-05 18:06:35 +0200
commit5733f293044bfe0d3210e7c4688172d53d54a7e0 (patch)
treeb8f3da57d83410a9b3f7efe0b856729ca48d804b /auction.go
parente735cff1d63145b89c4c48b9d73f037d3a4305f4 (diff)
client: started work on API for client, wip
- auction defines description of an auction - client creates auction object, given a description - commitment/* merged into client
Diffstat (limited to 'auction.go')
-rw-r--r--auction.go44
1 files changed, 44 insertions, 0 deletions
diff --git a/auction.go b/auction.go
new file mode 100644
index 0000000..50d6a2b
--- /dev/null
+++ b/auction.go
@@ -0,0 +1,44 @@
+package seal
+
+import (
+ "crypto"
+ "net/url"
+ "time"
+)
+
+type Type int
+
+const (
+ TypHighest = iota
+ TypSecondHighest
+)
+
+// Auction describes the asset of an auction and other
+// relevant meta-data
+type Description struct {
+ DashboardUrl *url.URL // can be empty
+ Start time.Time
+ End time.Time
+ RoundTimeout time.Duration // Timeout per round by which all responses must have arrived
+ BitLength uint8 // Length of the price encoding
+ Currency string
+ Type Type
+ SellerPublicKey crypto.PublicKey // Public key of the Seller
+}
+
+// The SignedAuction contains an Auction and the signature,
+// signed by the seller's public key off the SHA512 hash of
+// the normalized JSON-object.
+// TODO(oec): normalized?
+type SignedDesciption struct {
+ Description
+ SellerSignature string
+}
+
+// Bidder is the interface that the Auction engine uses to communicate
+// with an bidder implementation
+type Bidder interface {
+ Result()
+ Broadcast()
+ Unicast()
+}