sendResult method

Future<void> sendResult(
  1. int id,
  2. String topic,
  3. String method,
  4. dynamic result,
)
override

Implementation

Future<void> sendResult(
  int id,
  String topic,
  String method,
  dynamic result,
) async {
  // print('sending result');
  final Map<String, dynamic> payload = PairingUtils.formatJsonRpcResponse(
    id,
    result,
  );
  final String message = await core.crypto.encode(topic, payload);
  // final JsonRpcRecord? record = core.history.get(id);
  // if (record == null) {
  //   return;
  // }
  final RpcOptions opts = RPCConstants.PAIRING_RPC_OPTS[method]['res'];
  await core.relayClient.publish(topic, message, opts.ttl);
  // await core.history.resolve(payload);
}