payBip321 method
Pays an instruction from a BIP-321 URI using the selected wallet.
Implementation
Future<PayResponse> payBip321({
String? walletId,
required String payment,
int? amountMsat,
String? payerNote,
Map<String, dynamic>? metadata,
Duration? timeout,
}) 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.payBip321(
wallet,
payment: payment,
amountMsat: amountMsat,
payerNote: payerNote,
metadata: metadata,
timeout: timeout,
);
}