toUrl method

String toUrl()

Implementation

String toUrl() {
  final queryParameters = <String, dynamic>{
    'amount': amount?.toString(),
    'spl-token': splToken?.toBase58(),
    'reference': reference?.map((r) => r.toBase58()).toList(),
    'label': label,
    'message': message,
    'memo': memo,
  };

  return Uri(
    scheme: solanaPayScheme,
    path: recipient.toBase58(),
    queryParameters: Map<String, dynamic>.fromEntries(
      queryParameters.entries.where((e) => e.value != null),
    ),
  ).toString().replaceAll('+', '%20');
}