forked from irinazheltisheva/powergate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
37 lines (32 loc) · 748 Bytes
/
types.go
File metadata and controls
37 lines (32 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package ask
import (
"time"
)
// Module provides information about storage asks.
type Module interface {
Get() Index
Query(q Query) ([]StorageAsk, error)
Listen() <-chan struct{}
Unregister(c chan struct{})
}
// Index contains Ask information from markets.
type Index struct {
LastUpdated time.Time
StorageMedianPrice uint64
Storage map[string]StorageAsk
}
// StorageAsk has information about an active ask from a storage miner.
type StorageAsk struct {
Miner string
Price uint64
MinPieceSize uint64
Timestamp int64
Expiry int64
}
// Query specifies filtering and paging data to retrieve active Asks.
type Query struct {
MaxPrice uint64
PieceSize uint64
Limit int
Offset int
}