Config

Config#

class rizemind.authentication.config.AccountConfig(*, mnemonic: str | None = None, mnemonic_store: MnemonicStoreConfig | None = None, default_account_index: int | None = None)[source]

Bases: BaseConfig

Ethereum account configuration.

Accepts one of two authentication sources: direct mnemonic string or a keystore reference. For example:

  1. Direct mnemonic string `toml [tool.eth.account] mnemonic = "test test junk" `

  2. Keystore reference `toml [tool.eth.account.mnemonic_store] account_name = "bob" passphrase   = "open sesame" `

mnemonic

BIP-39 seed phrase. Leave empty if using mnemonic_store.

Type:

str | None

mnemonic_store

Keystore configuration.

Type:

rizemind.authentication.config.MnemonicStoreConfig | None

default_account_index

The default HD wallet account index to use.

Type:

int | None

default_account_index: int | None
static from_context(context: Context) AccountConfig | None[source]

Get the AccountConfig from the context if it exists.

Parameters:

context – The Flower context.

Returns:

The config if it exists, otherwise None.

get_account(i: int | None = None) BaseAccount[source]

Get the i-th HD wallet account.

Parameters:

i – The account index. If not supplied, the default_account_index from the config will be used.

Returns:

The account.

Raises:

ValueError – If no account index is provided and no default is configured.

mnemonic: str | None
mnemonic_store: MnemonicStoreConfig | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class rizemind.authentication.config.MnemonicStoreConfig(*, account_name: str, passphrase: str)[source]

Bases: BaseModel

A Pydantic model to store mnemonics.

account_name: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

passphrase: str