Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fee selection added for channel requests operations #194

Merged
merged 8 commits into from
Jun 20, 2023
2 changes: 2 additions & 0 deletions src/Data/Models/ChannelOperationRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ public decimal Amount
/// </summary>
public string? ClosingReason { get; set; }

public decimal? FeeRate { get; set; }

#region Relationships

public ICollection<ChannelOperationRequestPSBT> ChannelOperationRequestPsbts { get; set; }
Expand Down
10 changes: 5 additions & 5 deletions src/Helpers/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public static readonly bool ENABLE_REMOTE_SIGNER;
public static readonly bool PUSH_NOTIFICATIONS_ONESIGNAL_ENABLED;
public static readonly bool ENABLE_HW_SUPPORT;
public static readonly bool FEE_SELECTION_ENABLED = false; // Incomplete feature, remove this line when it's ready
public static readonly bool FEE_SELECTION_ENABLED = true; // Incomplete feature, remove this line when it's ready
markettes marked this conversation as resolved.
Show resolved Hide resolved

// Connections
public static readonly string POSTGRES_CONNECTIONSTRING = "Host=localhost;Port=5432;Database=fundsmanager;Username=rw_dev;Password=rw_dev";
Expand Down Expand Up @@ -70,9 +70,9 @@
public static readonly long ANCHOR_CLOSINGS_MINIMUM_SATS;
public static readonly string DEFAULT_DERIVATION_PATH = "48'/1'";
public static readonly int SESSION_TIMEOUT_MILLISECONDS = 3_600_000;

//Sat/vb ratio
public static decimal MIN_SAT_PER_VB_RATIO = 0.9m;
public static decimal MIN_SAT_PER_VB_RATIO = 0.9m;
public static decimal MAX_SAT_PER_VB_RATIO = 2.0m;
/// <summary>
/// Max ratio of the tx total input sum that could be used as fee
Expand All @@ -92,7 +92,7 @@
return envVariable;
}

static Constants()

Check warning on line 95 in src/Helpers/Constants.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Non-nullable field 'NBXPLORER_URI' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
{
IS_DEV_ENVIRONMENT = StringHelper.IsTrue(Environment.GetEnvironmentVariable("IS_DEV_ENVIRONMENT"));
// Features
Expand All @@ -105,7 +105,7 @@
// Connections
POSTGRES_CONNECTIONSTRING = Environment.GetEnvironmentVariable("POSTGRES_CONNECTIONSTRING") ?? POSTGRES_CONNECTIONSTRING;

NBXPLORER_URI = GetEnvironmentalVariableOrThrowIfNotTesting("NBXPLORER_URI");

Check warning on line 108 in src/Helpers/Constants.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Possible null reference assignment.

NBXPLORER_BTCRPCURL = Environment.GetEnvironmentVariable("NBXPLORER_BTCRPCURL");

Expand All @@ -130,7 +130,7 @@

if (PUSH_NOTIFICATIONS_ONESIGNAL_ENABLED)
{
PUSH_NOTIFICATIONS_ONESIGNAL_APP_ID = GetEnvironmentalVariableOrThrowIfNotTesting("PUSH_NOTIFICATIONS_ONESIGNAL_APP_ID", "if PUSH_NOTIFICATIONS_ONESIGNAL_ENABLED is set, PUSH_NOTIFICATIONS_ONESIGNAL_APP_ID");

Check warning on line 133 in src/Helpers/Constants.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Possible null reference assignment.

PUSH_NOTIFICATIONS_ONESIGNAL_API_BASE_PATH = GetEnvironmentalVariableOrThrowIfNotTesting("PUSH_NOTIFICATIONS_ONESIGNAL_API_BASE_PATH", "if PUSH_NOTIFICATIONS_ONESIGNAL_ENABLED is set,PUSH_NOTIFICATIONS_ONESIGNAL_API_BASE_PATH");

Expand Down Expand Up @@ -177,7 +177,7 @@
}

// Usage
BITCOIN_NETWORK = Environment.GetEnvironmentVariable("BITCOIN_NETWORK");

Check warning on line 180 in src/Helpers/Constants.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Possible null reference assignment.

var minChannelCapacity = GetEnvironmentalVariableOrThrowIfNotTesting("MINIMUM_CHANNEL_CAPACITY_SATS");
if (minChannelCapacity != null) MINIMUM_CHANNEL_CAPACITY_SATS = long.Parse(minChannelCapacity, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture);
Expand All @@ -198,11 +198,11 @@

var timeout = Environment.GetEnvironmentVariable("SESSION_TIMEOUT_MILLISECONDS");
if (timeout != null) SESSION_TIMEOUT_MILLISECONDS = int.Parse(timeout);

//Sat/vb ratio
var minSatPerVbRatioEnv = Environment.GetEnvironmentVariable("MIN_SAT_PER_VB_RATIO");
MIN_SAT_PER_VB_RATIO = minSatPerVbRatioEnv!= null ? decimal.Parse(minSatPerVbRatioEnv) : MIN_SAT_PER_VB_RATIO;

var maxSatPerVbRatioEnv = Environment.GetEnvironmentVariable("MAX_SAT_PER_VB_RATIO");
MAX_SAT_PER_VB_RATIO = maxSatPerVbRatioEnv!= null ? decimal.Parse(maxSatPerVbRatioEnv) : MAX_SAT_PER_VB_RATIO;

Expand Down
Loading
Loading