updateChannel method

Future<OpenChannel> updateChannel(
  1. OpenChannelParams params, {
  2. OnUploadProgressCallback? progress,
})

Updates an OpenChannel with given params and optional progress.

ChannelEventHandler.onChannelChanged event can be invoked based on the given params

Implementation

Future<OpenChannel> updateChannel(
  OpenChannelParams params, {
  OnUploadProgressCallback? progress,
}) async {
  params.channelUrl ??= channelUrl;
  if (params.channelUrl != channelUrl) {
    throw InvalidParameterError();
  }

  return _sdk.api.send<OpenChannel>(
      OpenChannelUpdateRequest(params, onProgress: progress));
}