cosmosutil

package
v0.0.0-...-d298eb8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ChainConfigDir = "config"
)
View Source
const GentxFilename = "gentx.json"

Variables

This section is empty.

Functions

func ChangeAddressPrefix

func ChangeAddressPrefix(address, newPrefix string) (string, error)

ChangeAddressPrefix returns the address with another prefix.

func GetAddressPrefix

func GetAddressPrefix(address string) (string, error)

GetAddressPrefix returns the bech 32 prefix used by the address.

Types

type Gentx

type Gentx struct {
	Body struct {
		Messages []struct {
			DelegatorAddress string `json:"delegator_address"`
			ValidatorAddress string `json:"validator_address"`
			PubKey           struct {
				Type string `json:"@type"`
				Key  string `json:"key"`
			} `json:"pubkey"`
			Value struct {
				Denom  string `json:"denom"`
				Amount string `json:"amount"`
			} `json:"value"`
		} `json:"messages"`
		Memo string `json:"memo"`
	} `json:"body"`
}

Gentx represents the gentx file.

type GentxInfo

type GentxInfo struct {
	DelegatorAddress string
	PubKey           ed25519.PubKey
	SelfDelegation   sdk.Coin
	Memo             string
}

GentxInfo represents the basic info about gentx file.

func GentxFromPath

func GentxFromPath(path string) (info GentxInfo, gentx []byte, err error)

GentxFromPath returns GentxInfo from the json file.

func ParseGentx

func ParseGentx(gentxBz []byte) (info GentxInfo, err error)

ParseGentx returns GentxInfo and the gentx file in bytes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL