Makes testnet block explorer link format configurable in discordbot

This commit is contained in:
Ben 2025-06-25 08:29:51 +02:00
parent 7456f5c51a
commit 52f6941244
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
2 changed files with 4 additions and 3 deletions

View File

@ -98,9 +98,7 @@ namespace BiblioTech.Commands
private string FormatTransactionLink(string transaction)
{
TODO! this needs to be configurable when we switch to devnet.
var url = $"https://explorer.testnet.codex.storage/tx/{transaction}";
var url = Program.Config.TransactionLinkFormat.Replace("<ID>", transaction);
return $"- [View on block explorer](<{url}>){Environment.NewLine}Transaction ID - `{transaction}`";
}
}

View File

@ -44,6 +44,9 @@ namespace BiblioTech
[Uniform("codex-endpoint-auth", "cea", "CODEXENDPOINTAUTH", false, "Codex endpoint basic auth. Colon separated username and password. (default: empty, no auth used.)")]
public string CodexEndpointAuth { get; set; } = "";
[Uniform("transaction-link-format", "tlf", "TRANSACTIONLINKFORMAT", false, "Format of links to transactions on the blockchain. Use '<ID>' to inject the transaction ID into this string. (default 'https://explorer.testnet.codex.storage/tx/<ID>')")]
public string TransactionLinkFormat { get; set; } = "https://explorer.testnet.codex.storage/tx/<ID>";
#region Role Rewards
/// <summary>