printed lnurl if it exists as qr code

This commit is contained in:
Vishal 2022-12-26 20:23:52 +05:30
parent 27ce32bd1b
commit a64fd45409
2 changed files with 24 additions and 7 deletions

View File

@ -307,6 +307,14 @@ void printProfile(Store node, String profilePubkey) {
pronoun = "They";
}
String about = gKindONames[profilePubkey]?.about??"";
String picture = gKindONames[profilePubkey]?.picture??"";
String lud16 = gKindONames[profilePubkey]?.lud16??"";
int dateLastUpdated = gKindONames[profilePubkey]?.createdAt??0;
bool verified = gKindONames[profilePubkey]?.nip05Verified??false;
String nip05Id = gKindONames[profilePubkey]?.nip05Id??"";
// print QR code
print("The QR code for public key:\n\n");
try {
@ -315,13 +323,19 @@ void printProfile(Store node, String profilePubkey) {
print("Could not generate qr code. \n");
}
print("");
String about = gKindONames[profilePubkey]?.about??"";
String picture = gKindONames[profilePubkey]?.picture??"";
String lud16 = gKindONames[profilePubkey]?.lud16??"";
int dateLastUpdated = gKindONames[profilePubkey]?.createdAt??0;
bool verified = gKindONames[profilePubkey]?.nip05Verified??false;
String nip05Id = gKindONames[profilePubkey]?.nip05Id??"";
// print LNRUL if it exists
if( lud16.length > gMinLud16AddressLength) {
try {
List<int>? typesAndModule = getTypeAndModule(lud16);
if( typesAndModule != null) {
print("The LNRUL in lud16 as QR:\n\n");
print(getPubkeyAsQrString(lud16, typesAndModule[0], typesAndModule[1]));
}
} catch(e) {
print("Could not generate qr code for the lnurl given. \n");
}
}
print("\nName : $authorName ( ${profilePubkey} ).");
print("About : $about");
print("Picture : $picture");

View File

@ -191,6 +191,9 @@ const int gMinEventIdLenInSearch = gEventLenPrinted;
int gInvalidInputCount = 0;
const int gMaxInValidInputAccepted = 40;
// LN settings
const int gMinLud16AddressLength = 10; // used in printProfile
// https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html#8-colors
// Color related settings
const String defaultTextColor = "green";