-
Notifications
You must be signed in to change notification settings - Fork 4
/
types.go
71 lines (59 loc) · 2.19 KB
/
types.go
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package v0_10
import (
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
)
const ModuleName = "dex"
type (
// GenesisState - all dex state that must be provided at genesis
GenesisState struct {
Params Params `json:"params"`
TokenPairs []*TokenPair `json:"token_pairs"`
WithdrawInfos WithdrawInfos `json:"withdraw_infos"`
ProductLocks ProductLockMap `json:"product_locks"`
}
// Params defines param object
Params struct {
ListFee sdk.SysCoin `json:"list_fee"`
TransferOwnershipFee sdk.SysCoin `json:"transfer_ownership_fee"`
// maximum period for okt holders to deposit on a dex delist proposal
DelistMaxDepositPeriod time.Duration `json:"delist_max_deposit_period"`
// minimum deposit for a critical dex delist proposal to enter voting period
DelistMinDeposit sdk.SysCoins `json:"delist_min_deposit"`
// length of the critical voting period for dex delist proposal
DelistVotingPeriod time.Duration `json:"delist_voting_period"`
WithdrawPeriod time.Duration `json:"withdraw_period"`
}
// TokenPair represents token pair object
TokenPair struct {
BaseAssetSymbol string `json:"base_asset_symbol"`
QuoteAssetSymbol string `json:"quote_asset_symbol"`
InitPrice sdk.Dec `json:"price"`
MaxPriceDigit int64 `json:"max_price_digit"`
MaxQuantityDigit int64 `json:"max_size_digit"`
MinQuantity sdk.Dec `json:"min_trade_size"`
ID uint64 `json:"token_pair_id"`
Delisting bool `json:"delisting"`
Owner sdk.AccAddress `json:"owner"`
Deposits sdk.SysCoin `json:"deposits"`
BlockHeight int64 `json:"block_height"`
}
// WithdrawInfo represents infos for withdrawing
WithdrawInfo struct {
Owner sdk.AccAddress `json:"owner"`
Deposits sdk.SysCoin `json:"deposits"`
CompleteTime time.Time `json:"complete_time"`
}
// WithdrawInfos defines list of WithdrawInfo
WithdrawInfos []WithdrawInfo
ProductLock struct {
BlockHeight int64
Price sdk.Dec
Quantity sdk.Dec
BuyExecuted sdk.Dec
SellExecuted sdk.Dec
}
ProductLockMap struct {
Data map[string]*ProductLock
}
)