From 52f6941244baff668d5dd62edb1c16ed5f9f0875 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 25 Jun 2025 08:29:51 +0200 Subject: [PATCH] Makes testnet block explorer link format configurable in discordbot --- Tools/BiblioTech/Commands/MintCommand.cs | 4 +--- Tools/BiblioTech/Configuration.cs | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Tools/BiblioTech/Commands/MintCommand.cs b/Tools/BiblioTech/Commands/MintCommand.cs index c2a6eafb..47126bf0 100644 --- a/Tools/BiblioTech/Commands/MintCommand.cs +++ b/Tools/BiblioTech/Commands/MintCommand.cs @@ -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("", transaction); return $"- [View on block explorer](<{url}>){Environment.NewLine}Transaction ID - `{transaction}`"; } } diff --git a/Tools/BiblioTech/Configuration.cs b/Tools/BiblioTech/Configuration.cs index a8187379..a7baff45 100644 --- a/Tools/BiblioTech/Configuration.cs +++ b/Tools/BiblioTech/Configuration.cs @@ -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 '' to inject the transaction ID into this string. (default 'https://explorer.testnet.codex.storage/tx/')")] + public string TransactionLinkFormat { get; set; } = "https://explorer.testnet.codex.storage/tx/"; + #region Role Rewards ///