smart_contract_repository.dart

PHOTO EMBED

Sun Jun 19 2022 15:05:52 GMT+0000 (Coordinated Universal Time)

Saved by @alefl10 #dart

import 'package:smart_contract_client/smart_contract_client.dart';
import 'package:smart_contract_repository/smart_contract_repository.dart';

class SmartContractRepository {
  const SmartContractRepository({required SmartContractClient client})
      : _client = client;

  final SmartContractClient _client;

  Future<String> getName() async {
    try {
      return _client.getName();
    } catch (e) {
      throw SmartContractRepositoryException(e);
    }
  }

  Future<String> setName({required String name}) async {
    try {
      return _client.setName(name: name);
    } catch (e) {
      throw SmartContractRepositoryException(e);
    }
  }
}
content_copyCOPY