Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BlockChainTransactionUnit {
- /// <summary>
- /// Transaction senders address
- /// </summary>
- [JsonProperty("from")]
- public string From {
- get;
- protected set;
- }
- /// <summary>
- /// Transaction recipient address
- /// </summary>
- [JsonProperty("to")]
- public string To {
- get;
- protected set;
- }
- /// <summary>
- /// Unit currency or token
- /// </summary>
- [JsonProperty("currency")]
- public string Currency {
- get;
- protected set;
- }
- /// <summary>
- /// Amount asset
- /// </summary>
- [JsonProperty("amount")]
- public string Amount {
- get;
- protected set;
- }
- /// <summary>
- /// Fee asset
- /// </summary>
- [JsonProperty("fee")]
- public string Fee {
- get;
- protected set;
- }
- /// <summary>
- /// Transaction data field
- /// </summary>
- [JsonProperty("data")]
- public string Data {
- get;
- protected set;
- }
- }
- public class BlockChainTransaction {
- /// <summary>
- /// Available transaction states
- /// </summary>
- public enum TransactionState {
- None,
- Created,
- Accepted,
- Published,
- Pending,
- Suspended,
- Irreversible,
- Rejected
- }
- /// <summary>
- /// Binary transaction representation
- /// </summary>
- public class TrxBody {
- [JsonProperty("address")]
- public string Address;
- [JsonProperty("body")]
- public string Body;
- [JsonProperty("sign", NullValueHandling = NullValueHandling.Ignore)]
- public string Sign = null;
- [JsonProperty("context", NullValueHandling = NullValueHandling.Ignore)]
- public string Context = null;
- }
- /// <summary>
- /// Current transaction state
- /// </summary>
- [JsonProperty("state")]
- public TransactionState State {
- get;
- protected set;
- }
- /// <summary>
- /// Transaction id according to blockchain specification
- /// </summary>
- [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
- public string Id {
- get;
- protected set;
- }
- /// <summary>
- /// Transaction reference block
- /// </summary>
- [JsonProperty("block")]
- public long Block {
- get;
- protected set;
- }
- /// <summary>
- /// Transaction creation or appear time
- /// </summary>
- [JsonProperty("created")]
- public int Created {
- get;
- protected set;
- }
- /// <summary>
- /// Transaction units
- /// </summary>
- [JsonProperty("units", NullValueHandling = NullValueHandling.Ignore)]
- public List<BlockChainTransactionUnit> Units {
- get;
- protected set;
- }
- /// <summary>
- /// Transaction binary bodies and signatures
- /// </summary>
- [JsonProperty("signatures", NullValueHandling = NullValueHandling.Ignore)]
- public List<TrxBody> Body {
- get;
- protected set;
- }
- }
- /// <summary>
- /// Transaction details
- /// </summary>
- public class DetailedTransaction : BlockChainTransaction {
- [JsonProperty("seq")]
- public long Sequence;
- [JsonProperty("src_account", NullValueHandling = NullValueHandling.Ignore)]
- public List<string> AccountFrom;
- [JsonProperty("dst_account", NullValueHandling = NullValueHandling.Ignore)]
- public List<string> AccountTo;
- [JsonProperty("src_agent", NullValueHandling = NullValueHandling.Ignore)]
- public List<string> AgentFrom;
- [JsonProperty("dst_agent", NullValueHandling = NullValueHandling.Ignore)]
- public List<string> AgentTo;
- [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)]
- public string OrderId;
- /// <summary>
- /// Base CTOR
- /// </summary>
- public DetailedTransaction() {
- }
- /// <summary>
- /// Copy CTOR
- /// </summary>
- public DetailedTransaction(BlockChainTransaction trx) : base(trx) {
- }
- /// <summary>
- /// Forced state setup
- /// </summary>
- public void ForceState(TransactionState state) {
- State = state;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement