formatUri static method
Implementation
static Uri formatUri({
required String protocol,
required String version,
required String topic,
required String symKey,
required Relay relay,
required List<List<String>>? methods,
int? expiry,
}) {
Map<String, String> params = formatRelayParams(relay);
params['symKey'] = symKey;
if (methods != null) {
final uriMethods = methods.expand((e) => e).toList();
params['methods'] =
uriMethods.map((e) => jsonEncode(e)).join(',').replaceAll('"', '');
}
if (expiry != null) {
params['expiryTimestamp'] = expiry.toString();
}
return Uri(
scheme: protocol,
path: '$topic@$version',
queryParameters: params,
);
}