-
Notifications
You must be signed in to change notification settings - Fork 0
/
external.go
52 lines (45 loc) · 1.22 KB
/
external.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
package mint
import (
"github.com/xpladev/xpla.go/provider"
)
type MintExternal struct {
Xplac provider.XplaClient
}
func NewMintExternal(xplac provider.XplaClient) (e MintExternal) {
e.Xplac = xplac
return e
}
// Query
// Query the current minting parameters.
func (e MintExternal) MintParams() provider.XplaClient {
msg, err := MakeQueryMintParamsMsg()
if err != nil {
return provider.ResetModuleAndMsgXplac(e.Xplac).WithErr(err)
}
e.Xplac.WithModule(MintModule).
WithMsgType(MintQueryMintParamsMsgType).
WithMsg(msg)
return e.Xplac
}
// Query the current minting inflation value.
func (e MintExternal) Inflation() provider.XplaClient {
msg, err := MakeQueryInflationMsg()
if err != nil {
return provider.ResetModuleAndMsgXplac(e.Xplac).WithErr(err)
}
e.Xplac.WithModule(MintModule).
WithMsgType(MintQueryInflationMsgType).
WithMsg(msg)
return e.Xplac
}
// Query the current minting annual provisions value.
func (e MintExternal) AnnualProvisions() provider.XplaClient {
msg, err := MakeQueryAnnualProvisionsMsg()
if err != nil {
return provider.ResetModuleAndMsgXplac(e.Xplac).WithErr(err)
}
e.Xplac.WithModule(MintModule).
WithMsgType(MintQueryAnnualProvisionsMsgType).
WithMsg(msg)
return e.Xplac
}