mirror of
https://github.com/status-im/nft-faucet.git
synced 2025-02-22 11:38:26 +00:00
Add Order to IUploader and IWallet
This commit is contained in:
parent
eceb53d2fe
commit
58b7fe8fb0
6
NftFaucet.Plugins/Models/Abstraction/IEntityWithOrder.cs
Normal file
6
NftFaucet.Plugins/Models/Abstraction/IEntityWithOrder.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace NftFaucet.Plugins.Models.Abstraction;
|
||||
|
||||
public interface IEntityWithOrder
|
||||
{
|
||||
public int? Order { get; }
|
||||
}
|
@ -3,10 +3,9 @@ using NftFaucet.Domain.Models.Enums;
|
||||
|
||||
namespace NftFaucet.Plugins.Models.Abstraction;
|
||||
|
||||
public interface INetwork : INamedEntity
|
||||
public interface INetwork : INamedEntity, IEntityWithOrder
|
||||
{
|
||||
public ulong? ChainId { get; }
|
||||
public int? Order { get; }
|
||||
public string Currency { get; }
|
||||
public bool IsTestnet { get; }
|
||||
public bool IsDeprecated { get; }
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace NftFaucet.Plugins.Models.Abstraction;
|
||||
|
||||
public interface IUploader : INamedEntity, IStateful, IInitializable, IEntityWithProperties, IConfigurable
|
||||
public interface IUploader : INamedEntity, IEntityWithOrder, IStateful, IInitializable, IEntityWithProperties, IConfigurable
|
||||
{
|
||||
public Task<Uri> Upload(string fileName, string fileType, byte[] fileData);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ using NftFaucet.Domain.Models;
|
||||
|
||||
namespace NftFaucet.Plugins.Models.Abstraction;
|
||||
|
||||
public interface IWallet : INamedEntity, IStateful, IInitializable, IEntityWithProperties, IConfigurable
|
||||
public interface IWallet : INamedEntity, IEntityWithOrder, IStateful, IInitializable, IEntityWithProperties, IConfigurable
|
||||
{
|
||||
public bool IsNetworkSupported(INetwork network);
|
||||
public Task<string> GetAddress();
|
||||
|
@ -3,7 +3,7 @@ using NftFaucet.Plugins.Models.Abstraction;
|
||||
|
||||
namespace NftFaucet.Plugins.Models;
|
||||
|
||||
public abstract class DefaultEntity : INamedEntity, IStateful, IInitializable, IEntityWithProperties, IConfigurable
|
||||
public abstract class DefaultEntity : INamedEntity, IEntityWithOrder, IStateful, IInitializable, IEntityWithProperties, IConfigurable
|
||||
{
|
||||
public abstract Guid Id { get; }
|
||||
public abstract string Name { get; }
|
||||
@ -11,6 +11,8 @@ public abstract class DefaultEntity : INamedEntity, IStateful, IInitializable, I
|
||||
public abstract string ImageName { get; }
|
||||
public virtual bool IsSupported { get; } = true;
|
||||
|
||||
public virtual int? Order { get; } = null;
|
||||
|
||||
public virtual Task<string> GetState() => Task.FromResult(string.Empty);
|
||||
public virtual Task SetState(string state) => Task.CompletedTask;
|
||||
|
||||
|
@ -7,7 +7,6 @@ namespace NftFaucet.Plugins.Models;
|
||||
public abstract class Network : DefaultEntity, INetwork
|
||||
{
|
||||
public virtual ulong? ChainId { get; } = null;
|
||||
public virtual int? Order { get; } = null;
|
||||
public virtual string Currency { get; } = null;
|
||||
public virtual bool IsTestnet { get; } = true;
|
||||
public virtual bool IsDeprecated { get; } = false;
|
||||
|
@ -34,7 +34,7 @@ public partial class CreateUploadDialog : BasicComponent
|
||||
|
||||
private void RefreshCards()
|
||||
{
|
||||
UploaderCards = AppState.PluginStorage.Uploaders.Select(MapCardListItem).ToArray();
|
||||
UploaderCards = AppState.PluginStorage.Uploaders.OrderBy(x => x.Order ?? int.MaxValue).Select(MapCardListItem).ToArray();
|
||||
RefreshMediator.NotifyStateHasChangedSafe();
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,8 @@ public class CrustUploader : Uploader
|
||||
public override string ShortName { get; } = "Crust";
|
||||
public override string ImageName { get; } = "crust.svg";
|
||||
|
||||
public override int? Order { get; } = 3;
|
||||
|
||||
private string AuthHeader { get; set; }
|
||||
|
||||
public override Property[] GetProperties()
|
||||
|
@ -16,6 +16,8 @@ public class InfuraUploader : Uploader
|
||||
public override string ImageName { get; } = "infura_black.svg";
|
||||
public override bool IsConfigured { get; protected set; }
|
||||
|
||||
public override int? Order { get; } = 2;
|
||||
|
||||
private const string DefaultGatewayUrl = "https://ipfs.infura.io:5001";
|
||||
private string ProjectId { get; set; }
|
||||
private string ProjectSecret { get; set; }
|
||||
|
@ -10,6 +10,8 @@ public class NftStorageUploader : Uploader
|
||||
public override string ImageName { get; } = "nft-storage.svg";
|
||||
public override bool IsSupported { get; } = false;
|
||||
|
||||
public override int? Order { get; } = 1;
|
||||
|
||||
public override Task<Uri> Upload(string fileName, string fileType, byte[] fileData)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
Loading…
x
Reference in New Issue
Block a user