params method
Returns the JSON RPC request's params
property value.
Implementation
@override
Object? params([
final Commitment? commitment,
]) {
// Serialize the configurations object.
final Map<String, dynamic> object = config?.toJson() ?? const {};
// Methods that query bank state contain a commitment parameter.
// Check if this method queries bank state and apply the provided commitment level as a default.
if (object.containsKey(JsonRpcRequest.commitmentKey)) {
object[JsonRpcRequest.commitmentKey] ??= commitment;
}
return object.isEmpty ? values : [...values, object];
}