2017-09-15 16:06:57 +09:00
|
|
|
|
using BTCPayServer.Models;
|
2017-10-20 14:06:37 -05:00
|
|
|
|
using BTCPayServer.Services.Invoices;
|
2017-10-23 19:27:22 +09:00
|
|
|
|
using NBitcoin;
|
|
|
|
|
using NBXplorer;
|
2017-09-13 15:47:34 +09:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2017-09-13 23:50:36 +09:00
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2017-09-13 15:47:34 +09:00
|
|
|
|
using System.Linq;
|
2017-10-23 19:27:22 +09:00
|
|
|
|
using System.Text;
|
2017-09-13 15:47:34 +09:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace BTCPayServer.Data
|
|
|
|
|
{
|
|
|
|
|
public class StoreData
|
|
|
|
|
{
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public string Id
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
set;
|
|
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public List<UserStore> UserStores
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public string DerivationStrategy
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public string StoreName
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public SpeedPolicy SpeedPolicy
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public string StoreWebsite
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public byte[] StoreCertificate
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
2017-09-13 23:50:36 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
[NotMapped]
|
|
|
|
|
public string Role
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
|
|
|
|
public byte[] StoreBlob
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
set;
|
|
|
|
|
}
|
2017-10-23 19:27:22 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public StoreBlob GetStoreBlob(Network network)
|
|
|
|
|
{
|
|
|
|
|
return StoreBlob == null ? new StoreBlob() : new Serializer(network).ToObject<StoreBlob>(Encoding.UTF8.GetString(StoreBlob));
|
|
|
|
|
}
|
2017-10-23 19:27:22 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public void SetStoreBlob(StoreBlob storeBlob, Network network)
|
|
|
|
|
{
|
|
|
|
|
StoreBlob = Encoding.UTF8.GetBytes(new Serializer(network).ToString(storeBlob));
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-10-23 19:27:22 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public class StoreBlob
|
|
|
|
|
{
|
|
|
|
|
public bool NetworkFeeDisabled
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
|
}
|