Interface Wallet.Factory

Enclosing interface:
Wallet

public static interface Wallet.Factory
Factory that turns a WalletSpec into a live Wallet. One concrete implementation per backend (in-memory, env keystore, KMS, hardware, …); ships separately in P3+.
  • Method Details

    • backend

      String backend()
      Backend identifier this factory handles, matching the WalletSpec.backend() field. Lowercase, kebab-case (e.g. "in-memory", "env-keystore").
    • create

      Wallet create(WalletSpec spec)
      Build a wallet for spec. Implementations should fail fast — missing required attributes raise IllegalArgumentException with an operator-actionable message instead of returning a half-constructed wallet.
    • discover

      static Optional<Wallet.Factory> discover()
      First Wallet.Factory registered via ServiceLoader. Returns Optional.empty() when no factory is on the classpath — callers can then fall back to constructing a known wallet impl directly.

      P2 ships no production factory. Callers needing a wallet for tests should instantiate InMemoryWallet explicitly.

    • discover

      static Optional<Wallet.Factory> discover(String backendId)
      Like discover() but selects the factory whose backend() matches backendId. Useful when more than one factory ships on the classpath (e.g. an agent that wants both KMS and env-keystore available).