receive method
Create a Lightning invoice to receive funds Returns the invoice string
Implementation
Future<String> receive({String? walletId, required int amountSats}) async {
await _initializationFuture;
walletId ??= _repository.getDefaultWalletIdForReceiving();
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.receive(wallet, amountSats);
}