request method

  1. @override
Future request({
  1. required String topic,
  2. required String chainId,
  3. required SessionRequestParams request,
})
override

Implementation

@override
Future<dynamic> request({
  required String topic,
  required String chainId,
  required SessionRequestParams request,
}) async {
  _checkInitialized();
  await _isValidRequest(
    topic,
    chainId,
    request,
  );

  final session = sessions.get(topic);
  final isLinkMode = _isLinkModeRequest(session);
  if (!isLinkMode) {
    _confirmOnlineStateOrThrow();
  }

  final sessionRequest = WcSessionRequestRequest(
    chainId: chainId,
    request: request,
  );

  return await core.pairing.sendRequest(
    topic,
    MethodConstants.WC_SESSION_REQUEST,
    sessionRequest.toJson(),
    appLink: _getAppLinkIfEnabled(session?.peer.metadata),
  );
}