Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type AccountDoesNotExistError
- type KeyringBackend
- type Option
- type Registry
- func (r Registry) Create(name string) (acc Account, mnemonic string, err error)
- func (r Registry) DeleteByName(name string) error
- func (r Registry) EnsureDefaultAccount() error
- func (r Registry) Export(name, passphrase string) (key string, err error)
- func (r Registry) ExportHex(name, passphrase string) (hex string, err error)
- func (r Registry) GetByName(name string) (Account, error)
- func (r Registry) Import(name, secret, passphrase string) (Account, error)
- func (r Registry) List() ([]Account, error)
Constants ¶
View Source
const ( // KeyringServiceName used for the name of keyring in OS backend. KeyringServiceName = "starport" // DefaultAccount is the name of the default account. DefaultAccount = "default" )
View Source
const (
AccountPrefixCosmos = "cosmos"
)
Variables ¶
View Source
var (
ErrAccountExists = errors.New("account already exists")
)
View Source
var KeyringHome = os.ExpandEnv("$HOME/.ignite/accounts")
KeyringHome used to store account related data.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { // Name of the account. Name string // Info holds additional info about the account. Info keyring.Info }
Account represents an Cosmos SDK account.
type AccountDoesNotExistError ¶
type AccountDoesNotExistError struct {
Name string
}
func (*AccountDoesNotExistError) Error ¶
func (e *AccountDoesNotExistError) Error() string
type KeyringBackend ¶
type KeyringBackend string
KeyringBackend is the backend for where keys are stored.
const ( // KeyringTest is the test keyring backend. With this backend, your keys will be // stored under your app's data dir, KeyringTest KeyringBackend = "test" // KeyringOS is the OS keyring backend. with this backend, your keys will be // stored in your operating system's secured keyring. KeyringOS KeyringBackend = "os" // KeyringMemory is in memory keyring backend, your keys will be stored in application memory. KeyringMemory KeyringBackend = "memory" )
type Option ¶
type Option func(*Registry)
Option configures your registry.
func WithKeyringBackend ¶
func WithKeyringBackend(backend KeyringBackend) Option
func WithKeyringServiceName ¶
type Registry ¶
Registry for accounts.
func NewInMemory ¶
func NewStandalone ¶
func (Registry) DeleteByName ¶
DeleteByName deletes an account by name.
func (Registry) EnsureDefaultAccount ¶
EnsureDefaultAccount ensures that default account exists.
Click to show internal directories.
Click to hide internal directories.