subscribe method

Future<String> subscribe({
  1. String identifier = '',
  2. required String topic,
  3. int duration = 400000,
  4. String fee = '0',
  5. String meta = '',
  6. int? nonce,
})

subscribe to a topic with an identifier for a number of blocks. Client using the same key pair and identifier will be able to receive messages from this topic. If this (identifier, public key) pair is already subscribed to this topic, the subscription expiration will be extended to current block height + duration. The signerRPCClient can be a client, multiclient or wallet.

Implementation

Future<String> subscribe({
  String identifier = '',
  required String topic,
  int duration = 400000,
  String fee = '0',
  String meta = '',
  int? nonce,
}) async {
  try {
    String hash = await _methodChannel.invokeMethod('subscribe', {
      '_id': this.address,
      'identifier': identifier,
      'topic': topic,
      'duration': duration,
      'fee': fee,
      'meta': meta,
      'nonce': nonce,
    });
    return hash;
  } catch (e) {
    rethrow;
  }
}