getCryptoCurrencyPaymentMethods method

Future<List<PaymentMethod>> getCryptoCurrencyPaymentMethods()

Fetches all the cryptocurrency payment methods supported by the Haveno daemon.

Returns a List of PaymentMethod if the operation is successful.

Throws a DaemonNotConnectedException if the client is not connected. Returns an empty list if the operation fails.

Implementation

Future<List<PaymentMethod>> getCryptoCurrencyPaymentMethods() async {
  if (!havenoChannel.isConnected) {
    throw DaemonNotConnectedException();
  }
  List<PaymentMethod> cryptoCurrencyPaymentMethods = [];
  try {
    final getCryptoCurrencyPaymentMethodsReply = await havenoChannel
        .paymentAccountsClient!
        .getCryptoCurrencyPaymentMethods(
            GetCryptoCurrencyPaymentMethodsRequest());
    cryptoCurrencyPaymentMethods = getCryptoCurrencyPaymentMethodsReply.paymentMethods;
    return cryptoCurrencyPaymentMethods;
  } on GrpcError catch (e) {
    handleGrpcError(e);
    return cryptoCurrencyPaymentMethods;
  }
}