Documentation
¶
Overview ¶
Package api ...
Index ¶
Examples ¶
Constants ¶
View Source
const ( // DAOAddress is DAO's address for charging a 10% commission on all rewards DAOAddress = "Mx7f0fc21d932f38ca9444f61703174569066cfa50" // DevelopersAddress is developers' address for charging a 10% commission on all rewards DevelopersAddress = "Mx688568d9d70c57e71d0b9de6480afb0d317f885c" )
View Source
const ( // RoleValidator is validator role RoleValidator = "Validator" // RoleDelegator is delegator role RoleDelegator = "Delegator" // RoleDAO is DAO role RoleDAO = "DAO" // RoleDevelopers is developers role RoleDevelopers = "Developers" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event interface { // GetAddress return owner address GetAddress() string // GetValidatorPublicKey return validator public key GetValidatorPublicKey() string // contains filtered or unexported methods }
Event interface
func ConvertToEvent ¶
ConvertToEvent returns interface of Event
Example ¶
package main import ( "fmt" "github.com/MinterTeam/minter-go-sdk/v2/api" ) func main() { eventValueJSON := `{ "address": "Mx7f0fc21d932f38ca9444f61703174569066cfa50", "amount": "3962700000000000000000", "role": "DAO", "validator_pub_key": "Mpd83e627510eea6aefa46d9914b0715dabf4a561ced78d34267b31d41d5f700b5" }` event, _ := api.ConvertToEvent("minter/RewardEvent", []byte(eventValueJSON)) fmt.Println(event.GetAddress()) fmt.Println(event.GetValidatorPublicKey()) fmt.Printf("%#v", event.(*api.RewardEvent)) }
Output: Mx7f0fc21d932f38ca9444f61703174569066cfa50 Mpd83e627510eea6aefa46d9914b0715dabf4a561ced78d34267b31d41d5f700b5 &api.RewardEvent{Role:"DAO", Address:"Mx7f0fc21d932f38ca9444f61703174569066cfa50", Amount:"3962700000000000000000", ValidatorPubKey:"Mpd83e627510eea6aefa46d9914b0715dabf4a561ced78d34267b31d41d5f700b5"}
type RewardEvent ¶
type RewardEvent struct { Role string `json:"role"` Address string `json:"address"` Amount string `json:"amount"` ValidatorPubKey string `json:"validator_pub_key"` }
RewardEvent is the payment of rewards
func (*RewardEvent) GetAddress ¶
func (e *RewardEvent) GetAddress() string
GetAddress return owner address
func (*RewardEvent) GetValidatorPublicKey ¶
func (e *RewardEvent) GetValidatorPublicKey() string
GetValidatorPublicKey return validator public key
type SlashEvent ¶
type SlashEvent struct { Address string `json:"address"` Amount string `json:"amount"` Coin string `json:"coin"` ValidatorPubKey string `json:"validator_pub_key"` }
SlashEvent is the payment of the validator's penalty by this stake
func (*SlashEvent) GetAddress ¶
func (e *SlashEvent) GetAddress() string
GetAddress return owner address
func (*SlashEvent) GetValidatorPublicKey ¶
func (e *SlashEvent) GetValidatorPublicKey() string
GetValidatorPublicKey return validator public key
type StakeKickEvent ¶
type StakeKickEvent struct { Address string `json:"address"` Amount string `json:"amount"` Coin string `json:"coin"` ValidatorPubKey string `json:"validator_pub_key"` }
StakeKickEvent is the knocking out a stake to the waiting list
func (*StakeKickEvent) GetAddress ¶
func (e *StakeKickEvent) GetAddress() string
GetAddress return owner address
func (*StakeKickEvent) GetValidatorPublicKey ¶
func (e *StakeKickEvent) GetValidatorPublicKey() string
GetValidatorPublicKey return validator public key
type UnbondEvent ¶
type UnbondEvent struct { Address string `json:"address"` Amount string `json:"amount"` Coin string `json:"coin"` ValidatorPubKey string `json:"validator_pub_key"` }
UnbondEvent is the unbinding a stake from a validator
func (*UnbondEvent) GetAddress ¶
func (e *UnbondEvent) GetAddress() string
GetAddress return owner address
func (*UnbondEvent) GetValidatorPublicKey ¶
func (e *UnbondEvent) GetValidatorPublicKey() string
GetValidatorPublicKey return validator public key
Directories
¶
Path | Synopsis |
---|---|
Package grpc_client is the interface for uses gRPC methods.
|
Package grpc_client is the interface for uses gRPC methods. |
Package http_client is the interface for uses API v2 methods.
|
Package http_client is the interface for uses API v2 methods. |
Click to show internal directories.
Click to hide internal directories.