updateExpiry method

  1. @override
Future<void> updateExpiry({
  1. required String topic,
  2. required int expiry,
})
override

Implementation

@override
Future<void> updateExpiry({
  required String topic,
  required int expiry,
}) async {
  _checkInitialized();

  // Validate the expiry is less than 30 days
  if (expiry > ReownCoreUtils.calculateExpiry(ReownConstants.THIRTY_DAYS)) {
    throw const ReownCoreError(
      code: -1,
      message: 'Expiry cannot be more than 30 days away',
    );
  }

  await pairings.update(topic, expiry: expiry);
  await core.expirer.set(topic, expiry);
}