registerEventEmitter method

  1. @override
void registerEventEmitter({
  1. required String chainId,
  2. required String event,
})
override

Register event emitters for a given namespace or chainId Used to construct the Namespaces map for the session proposal

Implementation

@override
void registerEventEmitter({
  required String chainId,
  required String event,
}) {
  final bool isChainId = NamespaceUtils.isValidChainId(chainId);
  if (!isChainId) {
    throw Errors.getSdkError(
      Errors.UNSUPPORTED_CHAINS,
      context:
          'registerEventEmitter, chain $chainId should conform to "CAIP-2" format',
    ).toSignError();
  }
  final String value = _getRegisterKey(chainId, event);
  SignApiValidatorUtils.isValidAccounts(
    accounts: [value],
    context: 'registerEventEmitter',
  );
  _eventEmitters.add(value);
}