WalletStore constructor

WalletStore(
  1. String _walletPath
)

Constructs a wallet at file-system path path.

Implementation

WalletStore(this._walletPath) {
  Hive.init(_walletPath);
  _nameExpansion = _walletPath.replaceAll('/', '_').replaceAll(r'\', '_');
  var split = _nameExpansion.split('_');
  if (split.length > 3) {
    _nameExpansion =
        '${split[split.length - 3]}${split[split.length - 2]}${split[split.length - 1]}';
  }
  if (!Hive.isAdapterRegistered(CredentialAdapter().typeId)) {
    Hive.registerAdapter(CredentialAdapter());
  }
  if (!Hive.isAdapterRegistered(ConnectionAdapter().typeId)) {
    Hive.registerAdapter(ConnectionAdapter());
  }
  if (!Hive.isAdapterRegistered(ExchangeHistoryEntryAdapter().typeId)) {
    Hive.registerAdapter(ExchangeHistoryEntryAdapter());
  }
  if (!Hive.isAdapterRegistered(DidcommConversationAdapter().typeId)) {
    Hive.registerAdapter(DidcommConversationAdapter());
  }
}