Documentation ¶
Index ¶
- Constants
- func Bech32ifyPubKey(pkt Bech32PubKeyType, pubkey crypto.PubKey) (string, error)
- func GetPubKeyFromBech32(pkt Bech32PubKeyType, pubkeyStr string) (crypto.PubKey, error)
- func KeyringServiceName() string
- func RegisterCodec(cdc *codec.Codec)
- type Bech32PubKeyType
- type Config
- func (config *Config) GetAddressVerifier() func([]byte) error
- func (config *Config) GetBech32AccountAddrPrefix() string
- func (config *Config) GetBech32AccountPubPrefix() string
- func (config *Config) GetBech32ConsensusAddrPrefix() string
- func (config *Config) GetBech32ConsensusPubPrefix() string
- func (config *Config) GetBech32SdsNodeP2PAddrPrefix() string
- func (config *Config) GetBech32SdsNodeP2PPubPrefix() string
- func (config *Config) GetBech32ValidatorAddrPrefix() string
- func (config *Config) GetBech32ValidatorPubPrefix() string
- func (config *Config) GetCoinType() uint32
- func (config *Config) GetFullFundraiserPath() string
- func (config *Config) GetTxEncoder() sdk.TxEncoder
- func (config *Config) Seal() *Config
- func (config *Config) SetAddressVerifier(addressVerifier func([]byte) error)
- func (config *Config) SetBech32PrefixForAccount(addressPrefix, pubKeyPrefix string)
- func (config *Config) SetBech32PrefixForConsensusNode(addressPrefix, pubKeyPrefix string)
- func (config *Config) SetBech32PrefixForSdsNodeP2P(pubKeyPrefix, p2pAddrPrifx string)
- func (config *Config) SetBech32PrefixForValidator(addressPrefix, pubKeyPrefix string)
- func (config *Config) SetCoinType(coinType uint32)
- func (config *Config) SetFullFundraiserPath(fullFundraiserPath string)
- func (config *Config) SetTxEncoder(encoder sdk.TxEncoder)
- type SdsAddress
- func (a SdsAddress) Bytes() []byte
- func (a SdsAddress) Empty() bool
- func (a SdsAddress) Equals(addr sdk.Address) bool
- func (a SdsAddress) Format(s fmt.State, verb rune)
- func (a SdsAddress) Marshal() ([]byte, error)
- func (a SdsAddress) MarshalJSON() ([]byte, error)
- func (a SdsAddress) MarshalYAML() (interface{}, error)
- func (a SdsAddress) String() string
- func (a *SdsAddress) Unmarshal(data []byte) error
- func (a *SdsAddress) UnmarshalJSON(data []byte) error
- func (a *SdsAddress) UnmarshalYAML(data []byte) error
Constants ¶
const ( StratosBech32Prefix = "st" Bech32PubKeyTypeAccPub Bech32PubKeyType = "accpub" Bech32PubKeyTypeValPub Bech32PubKeyType = "valpub" Bech32PubKeyTypeConsPub Bech32PubKeyType = "conspub" Bech32PubKeyTypeSdsP2PPub Bech32PubKeyType = "sdsp2p" AccountPubKeyPrefix = StratosBech32Prefix + "pub" ValidatorAddressPrefix = StratosBech32Prefix + "valoper" ValidatorPubKeyPrefix = StratosBech32Prefix + "valoperpub" ConsNodeAddressPrefix = StratosBech32Prefix + "valcons" ConsNodePubKeyPrefix = StratosBech32Prefix + "valconspub" SdsNodeP2PPubkeyPrefix = StratosBech32Prefix + "sdspub" SdsNodeP2PAddressPrefix = StratosBech32Prefix + "sds" CoinType = 606 HDPath = "m/44'/606'/0'/0/0" )
Bech32 conversion constants
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
func RegisterCodec ¶ added in v0.7.0
Types ¶
type Bech32PubKeyType ¶
type Bech32PubKeyType string
Bech32PubKeyType defines a string type alias for a Bech32 public key type.
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 GetSealedConfig ¶
GetSealedConfig returns the config instance for the SDK if/once it is sealed.
func (*Config) GetAddressVerifier ¶
GetAddressVerifier returns the function to verify that addresses have the correct format
func (*Config) GetBech32AccountAddrPrefix ¶
GetBech32AccountAddrPrefix returns the Bech32 prefix for account address
func (*Config) GetBech32AccountPubPrefix ¶
GetBech32AccountPubPrefix returns the Bech32 prefix for account public key
func (*Config) GetBech32ConsensusAddrPrefix ¶
GetBech32ConsensusAddrPrefix returns the Bech32 prefix for consensus node address
func (*Config) GetBech32ConsensusPubPrefix ¶
GetBech32ConsensusPubPrefix returns the Bech32 prefix for consensus node public key
func (*Config) GetBech32SdsNodeP2PAddrPrefix ¶ added in v0.7.0
func (*Config) GetBech32SdsNodeP2PPubPrefix ¶
func (*Config) GetBech32ValidatorAddrPrefix ¶
GetBech32ValidatorAddrPrefix returns the Bech32 prefix for validator address
func (*Config) GetBech32ValidatorPubPrefix ¶
GetBech32ValidatorPubPrefix returns the Bech32 prefix for validator public key
func (*Config) GetCoinType ¶
GetCoinType returns the BIP-0044 CoinType code on the config.
func (*Config) GetFullFundraiserPath ¶
GetFullFundraiserPath returns the BIP44Prefix.
func (*Config) GetTxEncoder ¶
GetTxEncoder return function to encode transactions
func (*Config) Seal ¶
Seal seals the config such that the config state could not be modified further
func (*Config) SetAddressVerifier ¶
SetAddressVerifier builds the Config with the provided function for verifying that addresses have the correct format
func (*Config) SetBech32PrefixForAccount ¶
SetBech32PrefixForAccount builds the Config with Bech32 addressPrefix and publKeyPrefix for accounts and returns the config instance
func (*Config) SetBech32PrefixForConsensusNode ¶
SetBech32PrefixForConsensusNode builds the Config with Bech32 addressPrefix and publKeyPrefix for consensus nodes and returns the config instance
func (*Config) SetBech32PrefixForSdsNodeP2P ¶
func (*Config) SetBech32PrefixForValidator ¶
SetBech32PrefixForValidator builds the Config with Bech32 addressPrefix and publKeyPrefix for validators
and returns the config instance
func (*Config) SetCoinType ¶
Set the BIP-0044 CoinType code on the config
func (*Config) SetFullFundraiserPath ¶
Set the FullFundraiserPath (BIP44Prefix) on the config
func (*Config) SetTxEncoder ¶
SetTxEncoder builds the Config with TxEncoder used to marshal StdTx to bytes
type SdsAddress ¶ added in v0.7.0
type SdsAddress []byte
func SdsAddressFromBech32 ¶ added in v0.7.0
func SdsAddressFromBech32(address string) (addr SdsAddress, err error)
AccAddressFromBech32 creates an AccAddress from a Bech32 string.
func (SdsAddress) Bytes ¶ added in v0.7.0
func (a SdsAddress) Bytes() []byte
func (SdsAddress) Empty ¶ added in v0.7.0
func (a SdsAddress) Empty() bool
func (SdsAddress) Marshal ¶ added in v0.7.0
func (a SdsAddress) Marshal() ([]byte, error)
func (SdsAddress) MarshalJSON ¶ added in v0.7.0
func (a SdsAddress) MarshalJSON() ([]byte, error)
func (SdsAddress) MarshalYAML ¶ added in v0.7.0
func (a SdsAddress) MarshalYAML() (interface{}, error)
MarshalYAML marshals to YAML using Bech32.
func (SdsAddress) String ¶ added in v0.7.0
func (a SdsAddress) String() string
func (*SdsAddress) Unmarshal ¶ added in v0.7.0
func (a *SdsAddress) Unmarshal(data []byte) error
Unmarshal sets the address to the given data. It is needed for protobuf compatibility.
func (*SdsAddress) UnmarshalJSON ¶ added in v0.7.0
func (a *SdsAddress) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals from JSON assuming Bech32 encoding.
func (*SdsAddress) UnmarshalYAML ¶ added in v0.7.0
func (a *SdsAddress) UnmarshalYAML(data []byte) error
UnmarshalYAML unmarshals from JSON assuming Bech32 encoding.