2021-03-11 13:34:52 +01:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using BTCPayServer.JsonConverters;
|
|
|
|
using NBitcoin;
|
|
|
|
using NBitcoin.JsonConverters;
|
|
|
|
using Newtonsoft.Json;
|
2022-11-16 04:11:17 +01:00
|
|
|
using Newtonsoft.Json.Linq;
|
2021-03-11 13:34:52 +01:00
|
|
|
|
|
|
|
namespace BTCPayServer.Client.Models
|
|
|
|
{
|
2022-11-16 04:11:17 +01:00
|
|
|
public class OnChainWalletObjectId
|
|
|
|
{
|
2022-11-19 00:04:46 +09:00
|
|
|
public OnChainWalletObjectId()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
public OnChainWalletObjectId(string type, string id)
|
|
|
|
{
|
|
|
|
Type = type;
|
|
|
|
Id = id;
|
|
|
|
}
|
2022-11-16 04:11:17 +01:00
|
|
|
public string Type { get; set; }
|
|
|
|
public string Id { get; set; }
|
|
|
|
}
|
2022-11-19 00:04:46 +09:00
|
|
|
public class AddOnChainWalletObjectLinkRequest : OnChainWalletObjectId
|
|
|
|
{
|
|
|
|
public AddOnChainWalletObjectLinkRequest()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
public AddOnChainWalletObjectLinkRequest(string objectType, string objectId) : base(objectType, objectId)
|
|
|
|
{
|
2022-11-16 04:11:17 +01:00
|
|
|
|
2022-11-19 00:04:46 +09:00
|
|
|
}
|
|
|
|
public JObject Data { get; set; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public class GetWalletObjectsRequest
|
2022-11-16 04:11:17 +01:00
|
|
|
{
|
2022-11-19 00:04:46 +09:00
|
|
|
public string Type { get; set; }
|
|
|
|
public string[] Ids { get; set; }
|
|
|
|
public bool? IncludeNeighbourData { get; set; }
|
2022-11-16 04:11:17 +01:00
|
|
|
}
|
2022-11-19 00:04:46 +09:00
|
|
|
|
|
|
|
public class AddOnChainWalletObjectRequest : OnChainWalletObjectId
|
2022-11-16 04:11:17 +01:00
|
|
|
{
|
2022-11-19 00:04:46 +09:00
|
|
|
public AddOnChainWalletObjectRequest()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
public AddOnChainWalletObjectRequest(string objectType, string objectId) : base(objectType, objectId)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
public JObject Data { get; set; }
|
2022-11-16 04:11:17 +01:00
|
|
|
}
|
|
|
|
|
2022-11-19 00:04:46 +09:00
|
|
|
public class OnChainWalletObjectData : OnChainWalletObjectId
|
2022-11-16 04:11:17 +01:00
|
|
|
{
|
2022-11-19 00:04:46 +09:00
|
|
|
public OnChainWalletObjectData()
|
2022-11-16 04:11:17 +01:00
|
|
|
{
|
2022-11-19 00:04:46 +09:00
|
|
|
|
2022-11-16 04:11:17 +01:00
|
|
|
}
|
2022-11-19 00:04:46 +09:00
|
|
|
public OnChainWalletObjectData(string type, string id) : base(type, id)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public class OnChainWalletObjectLink : OnChainWalletObjectId
|
|
|
|
{
|
|
|
|
public OnChainWalletObjectLink()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
public OnChainWalletObjectLink(string type, string id) : base(type, id)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
public JObject LinkData { get; set; }
|
|
|
|
public JObject ObjectData { get; set; }
|
|
|
|
}
|
|
|
|
public JObject Data { get; set; }
|
|
|
|
public OnChainWalletObjectLink[] Links { get; set; }
|
2022-11-16 04:11:17 +01:00
|
|
|
}
|
2022-11-19 00:04:46 +09:00
|
|
|
|
2021-03-11 13:34:52 +01:00
|
|
|
public class OnChainWalletTransactionData
|
|
|
|
{
|
|
|
|
[JsonConverter(typeof(UInt256JsonConverter))]
|
|
|
|
public uint256 TransactionHash { get; set; }
|
|
|
|
|
|
|
|
public string Comment { get; set; }
|
2022-10-11 17:34:29 +09:00
|
|
|
#pragma warning disable CS0612 // Type or member is obsolete
|
2021-03-11 13:34:52 +01:00
|
|
|
public Dictionary<string, LabelData> Labels { get; set; } = new Dictionary<string, LabelData>();
|
2022-10-11 17:34:29 +09:00
|
|
|
#pragma warning restore CS0612 // Type or member is obsolete
|
2021-03-11 13:34:52 +01:00
|
|
|
|
|
|
|
[JsonConverter(typeof(NumericStringJsonConverter))]
|
|
|
|
public decimal Amount { get; set; }
|
|
|
|
|
|
|
|
[JsonConverter(typeof(UInt256JsonConverter))]
|
|
|
|
public uint256 BlockHash { get; set; }
|
|
|
|
|
2022-04-05 14:46:42 +09:00
|
|
|
public long? BlockHeight { get; set; }
|
2021-03-11 13:34:52 +01:00
|
|
|
|
2022-04-05 14:46:42 +09:00
|
|
|
public long Confirmations { get; set; }
|
2021-03-11 13:34:52 +01:00
|
|
|
|
|
|
|
[JsonConverter(typeof(DateTimeToUnixTimeConverter))]
|
|
|
|
public DateTimeOffset Timestamp { get; set; }
|
|
|
|
|
|
|
|
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
|
|
|
|
public TransactionStatus Status { get; set; }
|
|
|
|
}
|
|
|
|
}
|