Documentation
¶
Index ¶
- func AddressFromKey(kr keyring.Keyring, keyName, hrp string) (string, error)
- func GetKey(kr keyring.Keyring, keyName string) (*keyring.Record, error)
- func ImportKeyFromMnemonic(kr keyring.Keyring, keyName, mnemonicFile, hrp string) ([]byte, string, error)
- func LoadKeyringFromMnemonic(keyName, mnemonicFile string) (keyring.Keyring, []byte, string, error)
- func NewDefaultTxConfig() client.TxConfig
- func NewKeyring(p KeyringParams) (keyring.Keyring, error)
- func SignTxWithKeyring(ctx context.Context, txCfg client.TxConfig, kr keyring.Keyring, keyName string, ...) error
- type KeyringParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddressFromKey ¶
AddressFromKey derives an account address for the given HRP from the public key stored in the keyring under keyName, without mutating the global bech32 prefix configuration.
func ImportKeyFromMnemonic ¶
func ImportKeyFromMnemonic(kr keyring.Keyring, keyName, mnemonicFile, hrp string) ([]byte, string, error)
ImportKeyFromMnemonic imports the mnemonic into an existing keyring (if needed), returning the pubkey bytes and address for the provided HRP.
func LoadKeyringFromMnemonic ¶
LoadKeyringFromMnemonic creates a test keyring, imports the mnemonic, and returns the keyring, pubkey bytes, and Lumera address.
func NewDefaultTxConfig ¶
NewDefaultTxConfig constructs a client.TxConfig backed by a protobuf codec, registering Lumera action message interfaces as required for signing/encoding.
func NewKeyring ¶
func NewKeyring(p KeyringParams) (keyring.Keyring, error)
NewKeyring creates a new Cosmos keyring with the provided parameters.
func SignTxWithKeyring ¶
func SignTxWithKeyring( ctx context.Context, txCfg client.TxConfig, kr keyring.Keyring, keyName string, builder client.TxBuilder, chainID string, accountNumber uint64, sequence uint64, overwrite bool, ) error
SignTxWithKeyring signs the provided TxBuilder using the given keyring identity. The caller must supply chainID, account number and sequence. Set overwrite=false for the first signature; true for subsequent signers on the same tx.
Types ¶
type KeyringParams ¶
type KeyringParams struct {
// AppName names the keyring namespace. Default: "lumera"
AppName string
// Backend selects the keyring backend ("os" | "file" | "test"). Default: "os"
Backend string
// Dir is the root directory for the keyring (if Backend="file"). Default: $HOME/.lumera
Dir string
// Input is an optional io.Reader for interactive backends (nil for non-interactive)
Input io.Reader
}
KeyringParams holds configuration for initializing a Cosmos keyring.
func DefaultKeyringParams ¶
func DefaultKeyringParams() KeyringParams
DefaultKeyringParams returns sensible defaults:
- AppName: "lumera"
- Backend: "os"
- Dir: $HOME/.lumera