send method

Future<PayInvoiceResponse> send({
  1. String? walletId,
  2. required String invoice,
})

Send payment

Implementation

Future<PayInvoiceResponse> send(
    {String? walletId, required String invoice}) async {
  await _initializationFuture;
  walletId ??= _repository.getDefaultWalletIdForSending();
  if (walletId == null) {
    throw StateError('No default wallet set');
  }
  final wallet = await _getWalletForOperation(walletId);
  final provider = _providers[wallet.type];
  if (provider == null) {
    throw ArgumentError('No provider for wallet type: ${wallet.type}');
  }
  return provider.send(wallet, invoice);
}