Documentation ¶
Index ¶
- Constants
- func AmtToBaseCoin(amt string) (sdktypes.Coin, error)
- func AmtToBaseStr(amt string) string
- func AmtToTokenDecCoin(amt string) (sdktypes.DecCoin, error)
- func AmtToTokenStr(amt string) string
- func CheckBalances(address string)
- func ConvertAmt(amt string, targetDenom string) string
- func GetBalance(address string) (sdktypes.Coin, error)
- func GetBalancesQuery(address string) (*types.BalancesQuery, error)
- func GetCommission(valopAddress string) (sdktypes.Coin, error)
- func GetDelegationAmountShares(address, valopAddress string) (sdktypes.Coin, string, error)
- func GetRewards(address string) (*types.RewardsQuery, error)
- func GetValidator(search string) (string, string)
- func GetValidatorsQuery() (*types.ValidatorsQuery, error)
- func ImportFromKeyring(l *Accounts, keyring string) (int, error)
- func IsNormalAddress(address string) bool
- func IsSelfDelegate(address string, valoperAddress string) bool
- func IsValidAddress(address string) bool
- func IsValidatorAddress(address string) bool
- func NormalizeAmountDenom(amtstr string) (string, error)
- func OutputAmount(out io.Writer, name, address string, baseAmount string, outType string)
- func PrettifyAmount(amount string) string
- func PrettifyBaseAmt(amt string) string
- func PrettifyTokenAmt(amt string, numDecimals int) string
- func QueryCommission(valopAddress string) (*types.CommissionsQuery, error)
- func QueryDelegation(address, valopAddress string) (*types.DelegationQuery, error)
- func QueryKeyringAddress(name, keyring string) string
- func ShortAddress(address string) string
- func StrSplitAmountDenom(amtstr string) (string, string, error)
- func TxDelegateToValidator(out io.Writer, delegator string, valAddress string, amount string, auto bool, ...) (string, error)
- func TxSend(out io.Writer, fromAddress string, toAddress string, amount string, auto bool, ...) (string, error)
- func TxWithdrawRewards(out io.Writer, name string, auto bool, keyring, outType string) (string, error)
- func TxWithdrawValidatorCommission(out io.Writer, name string, valoperAddress string, auto bool, ...) (string, error)
- type Account
- type Accounts
- func (l *Accounts) Add(alias string, address string) error
- func (l *Accounts) Delete(alias string) error
- func (l *Accounts) DeleteIndex(idx int) error
- func (l *Accounts) GetAddress(alias string) string
- func (l *Accounts) GetIndex(alias string) int
- func (l *Accounts) GetIndexAddress(alias string) (int, string)
- func (l *Accounts) ListFiltered(accountType string, addressOnly bool) string
- func (l *Accounts) Load(filealias string) error
- func (l *Accounts) Modify(idx int, alias string, address string) error
- func (l *Accounts) Save(filename string) error
- func (l *Accounts) String() string
Constants ¶
const ( AccNormal = "normal" AccValoper = "valoper" AccAll = "all" )
const ( RAW = "raw" DETAIL = "detail" HASH = "hash" SHARES = "shares" TOKEN = "token" )
Variables ¶
This section is empty.
Functions ¶
func AmtToBaseCoin ¶
Convert token to base Coin amount Wraps around ParseCoinNormalized
func AmtToBaseStr ¶
Convert amount to base denom anmount (string)
func AmtToTokenDecCoin ¶
Convert base denom to token DecCoin amount
func ConvertAmt ¶
Convert amount to specified denom amount
func GetBalance ¶
Get Balances (first denom) to string amount
func GetBalancesQuery ¶
func GetBalancesQuery(address string) (*types.BalancesQuery, error)
Get Balances Query
func GetCommission ¶
Get commissions (first denom) to decimal amount
func GetDelegationAmountShares ¶
Get Delegation Amount
func GetValidator ¶
Search validators by moniker or valoper-address
func GetValidatorsQuery ¶
func GetValidatorsQuery() (*types.ValidatorsQuery, error)
Query Validators
func ImportFromKeyring ¶
Import addresses from keyring
func IsNormalAddress ¶
Checks if address is a wallet account
func IsSelfDelegate ¶
Simple check if address is self-delegate for validator 1tman8gcu0d8rn7md6q9qdxme0dp74yv3 33 matching characters after the prefix
func IsValidatorAddress ¶
Checks if address is a validator account
func NormalizeAmountDenom ¶
func OutputAmount ¶
func PrettifyAmount ¶
func PrettifyBaseAmt ¶
Insert separator for non-decimal numbers as output
func PrettifyTokenAmt ¶
Parse decimal string to fixed number of digits after the decimal point.
func QueryCommission ¶
func QueryCommission(valopAddress string) (*types.CommissionsQuery, error)
Parse commissions for validator
func QueryDelegation ¶
func QueryDelegation(address, valopAddress string) (*types.DelegationQuery, error)
Query delegation
func QueryKeyringAddress ¶
Query Keyring for address
func ShortAddress ¶
func StrSplitAmountDenom ¶
Split denominated amount to amount and denom
func TxDelegateToValidator ¶
func TxDelegateToValidator(out io.Writer, delegator string, valAddress string, amount string, auto bool, keyring, outType string) (string, error)
Delegate to validator method
func TxSend ¶
func TxSend(out io.Writer, fromAddress string, toAddress string, amount string, auto bool, keyring, outType string) (string, error)
Send tokens between accounts method
Types ¶
type Accounts ¶
type Accounts []Account
func GetKeyringAccounts ¶
Get keyring name and addresses
func (*Accounts) DeleteIndex ¶
Delete account from the list with matching index
func (*Accounts) GetAddress ¶
Get address for given alias
func (*Accounts) GetIndexAddress ¶
Get index for given alias