Result types after method

This commit is contained in:
Slavomir 2021-07-20 14:17:21 +02:00
parent 318968d9b2
commit 2c8e89bf11
2 changed files with 26 additions and 26 deletions

View File

@ -7,26 +7,6 @@ import (
"github.com/gagliardetto/solana-go"
)
type GetStakeActivationResult struct {
// The stake account's activation state, one of: active, inactive, activating, deactivating.
State ActivationStateType `json:"state"`
// Stake active during the epoch.
Active bin.Uint64 `json:"active"`
// Stake inactive during the epoch.
Inactive bin.Uint64 `json:"inactive"`
}
type ActivationStateType string
const (
ActivationStateActive ActivationStateType = "active"
ActivationStateInactive ActivationStateType = "inactive"
ActivationStateActivating ActivationStateType = "activating"
ActivationStateDeactivating ActivationStateType = "deactivating"
)
// GetStakeActivation returns epoch activation information for a stake account.
func (cl *Client) GetStakeActivation(
ctx context.Context,
@ -55,3 +35,23 @@ func (cl *Client) GetStakeActivation(
err = cl.rpcClient.CallFor(&out, "getStakeActivation", params)
return
}
type GetStakeActivationResult struct {
// The stake account's activation state, one of: active, inactive, activating, deactivating.
State ActivationStateType `json:"state"`
// Stake active during the epoch.
Active bin.Uint64 `json:"active"`
// Stake inactive during the epoch.
Inactive bin.Uint64 `json:"inactive"`
}
type ActivationStateType string
const (
ActivationStateActive ActivationStateType = "active"
ActivationStateInactive ActivationStateType = "inactive"
ActivationStateActivating ActivationStateType = "activating"
ActivationStateDeactivating ActivationStateType = "deactivating"
)

View File

@ -6,6 +6,12 @@ import (
bin "github.com/dfuse-io/binary"
)
// GetVersion returns the current solana versions running on the node.
func (cl *Client) GetVersion(ctx context.Context) (out *GetVersionResult, err error) {
err = cl.rpcClient.CallFor(&out, "getVersion")
return
}
type GetVersionResult struct {
// Software version of solana-core.
SolanaCore string `json:"solana-core"`
@ -13,9 +19,3 @@ type GetVersionResult struct {
// Unique identifier of the current software's feature set.
FeatureSet bin.Int64 `json:"feature-set"`
}
// GetVersion returns the current solana versions running on the node.
func (cl *Client) GetVersion(ctx context.Context) (out *GetVersionResult, err error) {
err = cl.rpcClient.CallFor(&out, "getVersion")
return
}