Some checks are pending
Docs Deploy / build_and_deploy (push) Waiting to run
Generate Docs / cli (push) Waiting to run
Generate Config Doc / cli (push) Waiting to run
Go formatting / go-formatting (push) Waiting to run
Check links / markdown-link-check (push) Waiting to run
Integration / pre-test (push) Waiting to run
Integration / test on (push) Blocked by required conditions
Integration / status (push) Blocked by required conditions
Lint / Lint Go code (push) Waiting to run
Test / test (ubuntu-latest) (push) Waiting to run
1.5 KiB
1.5 KiB
| sidebar_position | title | slug |
|---|---|---|
| 2 | Account Registry (cosmosaccount) | /packages/cosmosaccount |
Account Registry (cosmosaccount)
The cosmosaccount package manages Cosmos keyring accounts (create/import/export/list/delete) with configurable backend and Bech32 settings.
For full API details, see the
cosmosaccount Go package documentation.
When to use
- Manage CLI account keys in Ignite services and commands.
- Switch between
test,os, andmemorykeyring backends. - Resolve addresses/public keys from named keyring entries.
Key APIs
New(options ...Option) (Registry, error)NewInMemory(options ...Option) (Registry, error)WithKeyringBackend(backend KeyringBackend) OptionWithHome(path string) Option(Registry) Create(name string) (Account, mnemonic string, err error)(Registry) Import(name, secret, passphrase string) (Account, error)(Registry) Export(name, passphrase string) (key string, err error)(Registry) GetByName(name string) (Account, error)(Registry) List() ([]Account, error)(Account) Address(accPrefix string) (string, error)
Common Tasks
- Instantiate one
Registrywith backend/home options and reuse it for all key operations. - Call
EnsureDefaultAccountin setup paths that require a predictable signer account. - Resolve addresses with
Account.Address(prefix)when your app uses non-default Bech32 prefixes.
Basic import
import "github.com/ignite/cli/v29/ignite/pkg/cosmosaccount"