types

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const DefaultKeyringServiceName = "stratos"

DefaultKeyringServiceName defines a default service name for the keyring.

Variables

This section is empty.

Functions

func Bech32ifyPubKey

func Bech32ifyPubKey(pkt Bech32PubKeyType, pubkey crypto.PubKey) (string, error)

Bech32ifyPubKey returns a Bech32 encoded string containing the appropriate prefix based on the key type provided for a given PublicKey.

func GetPubKeyFromBech32

func GetPubKeyFromBech32(pkt Bech32PubKeyType, pubkeyStr string) (crypto.PubKey, error)

GetPubKeyFromBech32 returns a PublicKey from a bech32-encoded PublicKey with a given key type.

func KeyringServiceName

func KeyringServiceName() string

Types

type Bech32PubKeyType

type Bech32PubKeyType string

Bech32PubKeyType defines a string type alias for a Bech32 public key type.

const (
	Bech32PubKeyTypeAccPub    Bech32PubKeyType = "accpub"
	Bech32PubKeyTypeValPub    Bech32PubKeyType = "valpub"
	Bech32PubKeyTypeConsPub   Bech32PubKeyType = "conspub"
	Bech32PubKeyTypeSdsP2PPub Bech32PubKeyType = "sdsp2p"
)

Bech32 conversion constants

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is the structure that holds the SDK configuration parameters. This could be used to initialize certain configuration parameters for the SDK.

func GetConfig

func GetConfig() *Config

GetConfig returns the config instance for the SDK.

func GetSealedConfig

func GetSealedConfig(ctx context.Context) (*Config, error)

GetSealedConfig returns the config instance for the SDK if/once it is sealed.

func NewConfig

func NewConfig() *Config

New returns a new Config with default values.

func (*Config) GetAddressVerifier

func (config *Config) GetAddressVerifier() func([]byte) error

GetAddressVerifier returns the function to verify that addresses have the correct format

func (*Config) GetBech32AccountAddrPrefix

func (config *Config) GetBech32AccountAddrPrefix() string

GetBech32AccountAddrPrefix returns the Bech32 prefix for account address

func (*Config) GetBech32AccountPubPrefix

func (config *Config) GetBech32AccountPubPrefix() string

GetBech32AccountPubPrefix returns the Bech32 prefix for account public key

func (*Config) GetBech32ConsensusAddrPrefix

func (config *Config) GetBech32ConsensusAddrPrefix() string

GetBech32ConsensusAddrPrefix returns the Bech32 prefix for consensus node address

func (*Config) GetBech32ConsensusPubPrefix

func (config *Config) GetBech32ConsensusPubPrefix() string

GetBech32ConsensusPubPrefix returns the Bech32 prefix for consensus node public key

func (*Config) GetBech32SdsNodeP2PPubPrefix

func (config *Config) GetBech32SdsNodeP2PPubPrefix() string

func (*Config) GetBech32ValidatorAddrPrefix

func (config *Config) GetBech32ValidatorAddrPrefix() string

GetBech32ValidatorAddrPrefix returns the Bech32 prefix for validator address

func (*Config) GetBech32ValidatorPubPrefix

func (config *Config) GetBech32ValidatorPubPrefix() string

GetBech32ValidatorPubPrefix returns the Bech32 prefix for validator public key

func (*Config) GetCoinType

func (config *Config) GetCoinType() uint32

GetCoinType returns the BIP-0044 CoinType code on the config.

func (*Config) GetFullFundraiserPath

func (config *Config) GetFullFundraiserPath() string

GetFullFundraiserPath returns the BIP44Prefix.

func (*Config) GetTxEncoder

func (config *Config) GetTxEncoder() sdk.TxEncoder

GetTxEncoder return function to encode transactions

func (*Config) Seal

func (config *Config) Seal() *Config

Seal seals the config such that the config state could not be modified further

func (*Config) SetAddressVerifier

func (config *Config) SetAddressVerifier(addressVerifier func([]byte) error)

SetAddressVerifier builds the Config with the provided function for verifying that addresses have the correct format

func (*Config) SetBech32PrefixForAccount

func (config *Config) SetBech32PrefixForAccount(addressPrefix, pubKeyPrefix string)

SetBech32PrefixForAccount builds the Config with Bech32 addressPrefix and publKeyPrefix for accounts and returns the config instance

func (*Config) SetBech32PrefixForConsensusNode

func (config *Config) SetBech32PrefixForConsensusNode(addressPrefix, pubKeyPrefix string)

SetBech32PrefixForConsensusNode builds the Config with Bech32 addressPrefix and publKeyPrefix for consensus nodes and returns the config instance

func (*Config) SetBech32PrefixForSdsNodeP2P

func (config *Config) SetBech32PrefixForSdsNodeP2P(pubKeyPrefix string)

func (*Config) SetBech32PrefixForValidator

func (config *Config) SetBech32PrefixForValidator(addressPrefix, pubKeyPrefix string)

SetBech32PrefixForValidator builds the Config with Bech32 addressPrefix and publKeyPrefix for validators

and returns the config instance

func (*Config) SetCoinType

func (config *Config) SetCoinType(coinType uint32)

Set the BIP-0044 CoinType code on the config

func (*Config) SetFullFundraiserPath

func (config *Config) SetFullFundraiserPath(fullFundraiserPath string)

Set the FullFundraiserPath (BIP44Prefix) on the config

func (*Config) SetTxEncoder

func (config *Config) SetTxEncoder(encoder sdk.TxEncoder)

SetTxEncoder builds the Config with TxEncoder used to marshal StdTx to bytes

Jump to

Keyboard shortcuts

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