[golang] Bootstrap contracting and refactor the agent code
This commit is contained in:
parent
8fbd912414
commit
3dad3f60f2
8 changed files with 158 additions and 106 deletions
32
golang/pkg/model/contract.go
Normal file
32
golang/pkg/model/contract.go
Normal file
|
@ -0,0 +1,32 @@
|
|||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Contract struct {
|
||||
Accepted bool `json:"accepted"`
|
||||
DeadlineToAccept time.Time `json:"deadlineToAccept"`
|
||||
Expiration time.Time `json:"expiration"`
|
||||
FactionSymbol string `json:"factionSymbol"`
|
||||
Fullfilled bool `json:"fulfilled"`
|
||||
Id string `json:"id"`
|
||||
Terms *Terms `json:"terms"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
type Deliver struct {
|
||||
DestinationSymbol string `json:"destinationSymbol"`
|
||||
TradeSymbol string `json:"tradeSymbol"`
|
||||
UnitsFulfilled int `json:"unitsFulfilled"`
|
||||
UnitsRequired int `json:"unitsRequired"`
|
||||
}
|
||||
|
||||
type Payment struct {
|
||||
OnAccepted int `json:"onAccepted"`
|
||||
OnFulfilled int `json:"onFulfilled"`
|
||||
}
|
||||
|
||||
type Terms struct {
|
||||
Deadline time.Time `json:"deadline"`
|
||||
Payment *Payment `json:"payment"`
|
||||
Deliver []Deliver `json:"deliver"`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue