Skip to content

Commit

Permalink
Merge pull request #28 from cardano-community/revisiting-after-major-…
Browse files Browse the repository at this point in the history
…update

Revisiting after major update
  • Loading branch information
nothingalike authored Nov 13, 2023
2 parents 19fbfc1 + 5aea551 commit d794f00
Show file tree
Hide file tree
Showing 24 changed files with 640 additions and 44 deletions.
2 changes: 1 addition & 1 deletion CardanoSharp.Koios.Client/CardanoSharp.Koios.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.0.11</Version>
<Version>2.0.0</Version>
<LangVersion>8.0</LangVersion>
</PropertyGroup>

Expand Down
49 changes: 49 additions & 0 deletions CardanoSharp.Koios.Client/Contracts/AccountUtxo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace CardanoSharp.Koios.Client.Contracts
{
[DataContract]
public class AccountUtxo: AddressTransaction
{
[DataMember]
[JsonPropertyName("tx_index")]
public uint TxIndex { get; set; }

[DataMember]
[JsonPropertyName("address")]
public string? Address { get; set; }

[DataMember]
[JsonPropertyName("value")]
public string? Value { get; set; }

[DataMember]
[JsonPropertyName("stake_address")]
public string? StakeAddress { get; set; }

[DataMember]
[JsonPropertyName("payment_cred")]
public string? PaymentCred { get; set; }

[DataMember]
[JsonPropertyName("datum_hash")]
public string? DatumHash { get; set; }

[DataMember]
[JsonPropertyName("inline_datum")]
public InlineDatum? InlineDatum { get; set; }

[DataMember]
[JsonPropertyName("asset_list")]
public AssetListInformation[]? AssetList { get; set; }

[DataMember]
[JsonPropertyName("reference_script")]
public ReferenceScript? ReferenceScript { get; set; }

[DataMember]
[JsonPropertyName("is_spent")]
public bool IsSpent { get; set; }
}
}
13 changes: 13 additions & 0 deletions CardanoSharp.Koios.Client/Contracts/AddressUtxo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace CardanoSharp.Koios.Client.Contracts
{
[DataContract]
public class AddressUtxo: Utxo
{
[DataMember]
[JsonPropertyName("is_spent")]
public bool IsSpent { get; set; }
}
}
7 changes: 4 additions & 3 deletions CardanoSharp.Koios.Client/Contracts/AssetAddress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ namespace CardanoSharp.Koios.Client.Contracts
[DataContract]
public class AssetAddress
{
///<summary>
///Refered to as "payment_address" in the koios docs.
///</summary>
[DataMember]
[JsonPropertyName("asset_name")]
public string? AssetName { get; set; }

[DataMember]
[JsonPropertyName("payment_address")]
public string? Address { get; set; }
Expand Down
4 changes: 4 additions & 0 deletions CardanoSharp.Koios.Client/Contracts/AssetInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,9 @@ public class AssetInformation
[DataMember]
[JsonPropertyName("burn_cnt")]
public ulong BurnCount { get; set; }

[DataMember]
[JsonPropertyName("cip68_metadata")]
public object? Cip68Metadata { get; set; }
}
}
4 changes: 4 additions & 0 deletions CardanoSharp.Koios.Client/Contracts/AssetListInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ public class AssetListInformation
[DataMember]
[JsonPropertyName("fingerprint")]
public string? Fingerprint { get; set; }

[DataMember]
[JsonPropertyName("decimal")]
public uint Decimal { get; set; }
}
}
12 changes: 10 additions & 2 deletions CardanoSharp.Koios.Client/Contracts/AssetPolicyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,17 @@ public class AssetPolicyInfo
[DataMember]
[JsonPropertyName("total_supply")]
public string? TotalSupply { get; set; }

[DataMember]
[JsonPropertyName("creation_time")]
public ulong CreationTime { get; set; }
public ulong? CreationTime { get; set; }

[DataMember]
[JsonPropertyName("mint_cnt")]
public ulong MintCount { get; set; }

[DataMember]
[JsonPropertyName("burn_cnt")]
public ulong BurnCount { get; set; }
}
}
41 changes: 41 additions & 0 deletions CardanoSharp.Koios.Client/Contracts/AssetTokenRegistry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace CardanoSharp.Koios.Client.Contracts
{
[DataContract]
public class AssetTokenRegistry
{
[DataMember]
[JsonPropertyName("policy_id")]
public string? PolicyId { get; set; }

[DataMember]
[JsonPropertyName("asset_name")]
public string? AssetName { get; set; }

[DataMember]
[JsonPropertyName("asset_name_ascii")]
public string? AssetNameAscii { get; set; }

[DataMember]
[JsonPropertyName("ticker")]
public string? Ticker { get; set; }

[DataMember]
[JsonPropertyName("description")]
public string? Description { get; set; }

[DataMember]
[JsonPropertyName("url")]
public string? Url { get; set; }

[DataMember]
[JsonPropertyName("logo")]
public string? Logo { get; set; }

[DataMember]
[JsonPropertyName("decimals")]
public uint? Decimals { get; set; }
}
}
14 changes: 5 additions & 9 deletions CardanoSharp.Koios.Client/Contracts/Block.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ public class Block
public uint EpochSlot { get; set; }

[DataMember]
[JsonPropertyName("height")]
[JsonPropertyName("block_height")]
public uint Height { get; set; }

[DataMember]
[JsonPropertyName("block_size")]
public uint? BlockSize { get; set; }

[DataMember]
[JsonPropertyName("block_time")]
public ulong? BlockTime { get; set; }
Expand Down Expand Up @@ -53,13 +57,5 @@ public class Block
[DataMember]
[JsonPropertyName("proto_minor")]
public uint ProtoMinor { get; set; }

[DataMember]
[JsonPropertyName("parent_hash")]
public string? ParentHash { get; set; }

[DataMember]
[JsonPropertyName("child_hash")]
public string? ChildHash { get; set; }
}
}
33 changes: 33 additions & 0 deletions CardanoSharp.Koios.Client/Contracts/BlockInformation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace CardanoSharp.Koios.Client.Contracts
{
[DataContract]
public class BlockInformation: Block
{
[DataMember]
[JsonPropertyName("op_cert")]
public string? OpCert { get; set; }

[DataMember]
[JsonPropertyName("total_output")]
public string? TotalOutput { get; set; }

[DataMember]
[JsonPropertyName("total_fees")]
public string? TotalFees { get; set; }

[DataMember]
[JsonPropertyName("num_confirmations")]
public uint? NumConfirmations { get; set; }

[DataMember]
[JsonPropertyName("parent_hash")]
public string? ParentHash { get; set; }

[DataMember]
[JsonPropertyName("child_hash")]
public string? ChildHash { get; set; }
}
}
12 changes: 12 additions & 0 deletions CardanoSharp.Koios.Client/Contracts/BlockTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,17 @@ public class BlockTransaction
[DataMember]
[JsonPropertyName("tx_hashes")]
public string[]? TxHashes { get; set; }

[DataMember]
[JsonPropertyName("epoch_no")]
public uint? Epoch { get; set; }

[DataMember]
[JsonPropertyName("block_height")]
public uint? BlockHeight { get; set; }

[DataMember]
[JsonPropertyName("block_time")]
public ulong? BlockTime { get; set; }
}
}
29 changes: 29 additions & 0 deletions CardanoSharp.Koios.Client/Contracts/ParamUpdateProposal.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace CardanoSharp.Koios.Client.Contracts
{
[DataContract]
public class ParamUpdateProposal
{
[DataMember]
[JsonPropertyName("tx_hash")]
public string? TxHash { get; set; }

[DataMember]
[JsonPropertyName("block_height")]
public uint BlockHeight { get; set; }

[DataMember]
[JsonPropertyName("block_time")]
public uint BlockTime { get; set; }

[DataMember]
[JsonPropertyName("epoch_no")]
public uint EpochNo { get; set; }

[DataMember]
[JsonPropertyName("data")]
public object Data { get; set; }
}
}
25 changes: 25 additions & 0 deletions CardanoSharp.Koios.Client/Contracts/PolicyAsset.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace CardanoSharp.Koios.Client.Contracts
{
[DataContract]
public class PolicyAsset
{
[DataMember]
[JsonPropertyName("asset_name")]
public string? AssetName { get; set; }

[DataMember]
[JsonPropertyName("fingerprint")]
public string? Fingerprint { get; set; }

[DataMember]
[JsonPropertyName("total_supply")]
public string? TotalSupply { get; set; }

[DataMember]
[JsonPropertyName("decimals")]
public uint? Decimals { get; set; }
}
}
10 changes: 9 additions & 1 deletion CardanoSharp.Koios.Client/Contracts/ProtocolParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public class ProtocolParameters

[DataMember]
[JsonPropertyName("cost_models")]
public string? CostModels { get; set; }
public CostModel CostModels { get; set; }

[DataMember]
[JsonPropertyName("price_mem")]
Expand Down Expand Up @@ -134,4 +134,12 @@ public class ProtocolParameters
[JsonPropertyName("coins_per_utxo_size")]
public string? CoinsPerUtxoSize { get; set; }
}

[DataContract]
public class CostModel
{
[DataMember]
[JsonPropertyName("PlutusV1")]
public object PlutusV1 { get; set; }
}
}
37 changes: 37 additions & 0 deletions CardanoSharp.Koios.Client/Contracts/ReserveWithdrawal.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace CardanoSharp.Koios.Client.Contracts
{
[DataContract]
public class ReserveWithdrawal
{
[DataMember]
[JsonPropertyName("tx_hash")]
public string? TxHash { get; set; }

[DataMember]
[JsonPropertyName("block_height")]
public uint BlockHeight { get; set; }

[DataMember]
[JsonPropertyName("block_hash")]
public string? BlockHash { get; set; }

[DataMember]
[JsonPropertyName("amount")]
public string? Amount { get; set; }

[DataMember]
[JsonPropertyName("epoch_no")]
public uint EpochNo { get; set; }

[DataMember]
[JsonPropertyName("epoch_slot")]
public uint EpochSlot { get; set; }

[DataMember]
[JsonPropertyName("stake_address")]
public string? StakeAddress { get; set; }
}
}
Loading

0 comments on commit d794f00

Please sign in to comment.