createMessage method

  1. @override
Future<String> createMessage({
  1. required String chainId,
  2. required String address,
})
override

Implementation

@override
Future<String> createMessage({
  required String chainId,
  required String address,
}) async {
  if (!enabled) throw Exception('siweConfig not enabled');
  //
  final nonce = await getNonce();
  final messageParams = await _siweConfig!.getMessageParams();
  //
  final createMessageArgs = SIWECreateMessageArgs.fromSIWEMessageArgs(
    messageParams,
    address: '$chainId:$address',
    chainId: chainId,
    nonce: nonce,
    type: messageParams.type ?? CacaoHeader(t: 'eip4361'),
  );

  return _siweConfig!.createMessage(createMessageArgs);
}