signNode function
Implementation
Future<TTNode> signNode(TTNode node, PairReturnType pair,
[String? encoding]) async {
encoding ??= DEFAULT_OPTS.encode;
final TTNode signedNode = TTNode.fromJson({'_': node.nodeMetaData?.toJson()});
final soul = node.nodeMetaData?.key;
for (final key in node.keys) {
if (key == 'pub' /*|| key === "alias"*/ && soul == "~${pair.pub}") {
signedNode[key] = node[key];
continue;
}
signedNode[key] =
jsonEncode(await signNodeValue(node, key, pair, encoding));
}
return signedNode;
}