signWithIntent method

SignatureWithBytes signWithIntent(
  1. Uint8List bytes,
  2. IntentScope intent
)

Implementation

SignatureWithBytes signWithIntent(Uint8List bytes, IntentScope intent) {
	final intentMessage = messageWithIntent(intent, bytes);
	final digest = blake2b(intentMessage);

	final signature = toSerializedSignature(
		getKeyScheme(),
		sign(digest),
		getPublicKey()
	);

	return SignatureWithBytes(
		signature,
		base64Encode(bytes)
    );
}