-
Notifications
You must be signed in to change notification settings - Fork 16
/
gov_request_types.go
124 lines (107 loc) · 4.12 KB
/
gov_request_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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package client
import (
"github.com/Oneledger/protocol/action"
"github.com/Oneledger/protocol/data/balance"
"github.com/Oneledger/protocol/data/governance"
"github.com/Oneledger/protocol/data/keys"
)
type CreateProposalRequest struct {
ProposalID string `json:"proposalId"`
ProposalType string `json:"proposalType"`
Headline string `json:"headline"`
Description string `json:"description"`
Proposer keys.Address `json:"proposer"`
InitialFunding action.Amount `json:"initialFunding"`
GasPrice action.Amount `json:"gasPrice"`
Gas int64 `json:"gas"`
FundingDeadline int64 `json:"fundingDeadline"`
FundingGoal *balance.Amount `json:"fundingGoal"`
VotingDeadline int64 `json:"votingDeadline"`
PassPercentage int `json:"passPercentage"`
ConfigUpdate string `json:"configUpdate"`
}
type ListProposalRequest struct {
ProposalId governance.ProposalID `json:"proposalId"`
}
type ListProposalsRequest struct {
State governance.ProposalState `json:"state"`
Proposer keys.Address `json:"proposer"`
ProposalType governance.ProposalType `json:"proposalType"`
}
type ProposalStat struct {
Proposal governance.Proposal `json:"proposal"`
Funds balance.Amount `json:"funds"`
Votes governance.VoteStatus `json:"votes"`
}
type ListProposalsReply struct {
ProposalStats []ProposalStat `json:"proposalStats"`
Height int64 `json:"height"`
}
type LastUpdateHeights struct {
Proposal int64 `json:"proposal"`
Rewards int64 `json:"rewards"`
Ons int64 `json:"ons"`
Eth int64 `json:"eth"`
Btc int64 `json:"btc"`
Staking int64 `json:"staking"`
Currency int64 `json:"currency"`
Fee int64 `json:"fee"`
Evidence int64 `json:"evidence"`
}
type GovernanceOptionsRequest struct {
}
type GovernanceOptionsReply struct {
GovOptions governance.GovernanceState `json:"govOptions"`
LastUpdateHeight LastUpdateHeights `json:"lastUpdateHeight"`
}
type VoteProposalRequest struct {
ProposalId string `json:"proposalId"`
Opinion governance.VoteOpinion `json:"opinion"`
Address keys.Address `json:"address"`
GasPrice action.Amount `json:"gasPrice"`
Gas int64 `json:"gas"`
}
type VoteProposalReply struct {
RawTx []byte `json:"rawTx"`
Signature action.Signature `json:"signature"`
}
type FundProposalRequest struct {
ProposalId governance.ProposalID `json:"proposalId"`
FundValue action.Amount `json:"fundValue"`
FunderAddress action.Address `json:"funderAddress"`
GasPrice action.Amount `json:"gasPrice"`
Gas int64 `json:"gas"`
}
type CancelProposalRequest struct {
ProposalId governance.ProposalID `json:"proposalId"`
Proposer keys.Address `json:"proposer"`
Reason string `json:"reason"`
GasPrice action.Amount `json:"gasPrice"`
Gas int64 `json:"gas"`
}
type WithdrawFundsRequest struct {
ProposalID governance.ProposalID `json:"proposalId"`
Funder keys.Address `json:"funderAddress"`
WithdrawValue action.Amount `json:"withdrawValue"`
Beneficiary keys.Address `json:"beneficiaryAddress"`
GasPrice action.Amount `json:"gasPrice"`
Gas int64 `json:"gas"`
}
type FinalizeProposalRequest struct {
ProposalId governance.ProposalID `json:"proposalId"`
Proposer action.Address `json:"proposer"`
GasPrice action.Amount `json:"gasPrice"`
Gas int64 `json:"gas"`
}
type GetProposalOptionsRequest struct{}
type GetProposalOptionsReply struct {
ProposalOptions governance.ProposalOptionSet `json:"proposalOptions"`
Height int64 `json:"height"`
}
type GetFundsForProposalByFunderRequest struct {
ProposalId governance.ProposalID `json:"proposalId"`
Funder keys.Address `json:"funderAddress"`
}
type GetFundsForProposalByFunderReply struct {
Amount balance.Amount `json:"amount"`
}