Skip to content

Commit

Permalink
Adjust json schema type for BigInteger
Browse files Browse the repository at this point in the history
  • Loading branch information
Groxan committed Jun 30, 2024
1 parent 5567ecc commit 477466f
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions Tzkt.Api/Models/Accounts/Delegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public class Delegate : Account
/// <summary>
/// Total amount of issued "pseudo-tokens". These pseudotokens are used for unstaking.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = true)]
public BigInteger? IssuedPseudotokens { get; set; }

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions Tzkt.Api/Models/Accounts/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class User : Account
/// <summary>
/// Amount of "pseudo-tokens" received after staking. These pseudotokens are used for unstaking.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = true)]
public BigInteger? StakedPseudotokens { get; set; }

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Tzkt.Api/Models/Baking/StakingUpdate.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using NJsonSchema.Annotations;

namespace Tzkt.Api.Models
{
Expand Down Expand Up @@ -49,6 +50,7 @@ public class StakingUpdate
/// <summary>
/// Amount of staking pseudotokens minted or burnt.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = true)]
public BigInteger? Pseudotokens { get; set; }

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Tzkt.Api/Models/Operations/IncreasePaidStorageOperation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using NJsonSchema.Annotations;

namespace Tzkt.Api.Models
{
Expand Down Expand Up @@ -90,6 +91,7 @@ public class IncreasePaidStorageOperation : Operation
/// <summary>
/// Amount of storage in bytes prepaid.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger Amount { get; set; }

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Tzkt.Api/Models/Operations/SetDepositsLimitOperation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using NJsonSchema.Annotations;

namespace Tzkt.Api.Models
{
Expand Down Expand Up @@ -75,6 +76,7 @@ public class SetDepositsLimitOperation : Operation
/// <summary>
/// Frozen deposits limit (mutez), or `null` if no limit.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = true)]
public BigInteger? Limit { get; set; }

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Tzkt.Api/Models/Operations/TransferTicketOperation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using NJsonSchema.Annotations;

namespace Tzkt.Api.Models
{
Expand Down Expand Up @@ -87,6 +88,7 @@ public class TransferTicketOperation : Operation
/// <summary>
/// Amount sent
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger Amount { get; set; }

/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions Tzkt.Api/Models/Tickets/Ticket.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Numerics;
using Netezos.Encoding;
using NJsonSchema.Annotations;

namespace Tzkt.Api.Models
{
Expand Down Expand Up @@ -89,16 +90,19 @@ public class Ticket
/// <summary>
/// Total amount minted.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger TotalMinted { get; set; }

/// <summary>
/// Total amount burned.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger TotalBurned { get; set; }

/// <summary>
/// Total amount exists.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger TotalSupply { get; set; }
}
}
2 changes: 2 additions & 0 deletions Tzkt.Api/Models/Tickets/TicketBalance.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using NJsonSchema.Annotations;

namespace Tzkt.Api.Models
{
Expand Down Expand Up @@ -26,6 +27,7 @@ public class TicketBalance
/// Balance.
/// **[sortable]**
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger Balance { get; set; }

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Tzkt.Api/Models/Tickets/TicketBalanceShort.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using NJsonSchema.Annotations;

namespace Tzkt.Api.Models
{
Expand All @@ -25,6 +26,7 @@ public class TicketBalanceShort
/// <summary>
/// Balance.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger Balance { get; set; }
}
}
2 changes: 2 additions & 0 deletions Tzkt.Api/Models/Tickets/TicketInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Numerics;
using Netezos.Encoding;
using NJsonSchema.Annotations;

namespace Tzkt.Api.Models
{
Expand Down Expand Up @@ -43,6 +44,7 @@ public class TicketInfo
/// <summary>
/// Total amount exists.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger TotalSupply { get; set; }
}
}
2 changes: 2 additions & 0 deletions Tzkt.Api/Models/Tickets/TicketTransfer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using NJsonSchema.Annotations;

namespace Tzkt.Api.Models
{
Expand Down Expand Up @@ -43,6 +44,7 @@ public class TicketTransfer
/// Amount of tickets transferred.
/// **[sortable]**
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger Amount { get; set; }

/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions Tzkt.Api/Models/Tokens/Token.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class Token
/// Token id, unique within the contract.
/// **[sortable]**
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger TokenId { get; set; }

/// <summary>
Expand Down Expand Up @@ -75,16 +76,19 @@ public class Token
/// <summary>
/// Total number of minted tokens (raw value, not divided by `decimals`).
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger TotalMinted { get; set; }

/// <summary>
/// Total number of burned tokens (raw value, not divided by `decimals`).
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger TotalBurned { get; set; }

/// <summary>
/// Total number of existing tokens (raw value, not divided by `decimals`).
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger TotalSupply { get; set; }

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions Tzkt.Api/Models/Tokens/TokenBalance.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using NJsonSchema.Annotations;

namespace Tzkt.Api.Models
{
Expand Down Expand Up @@ -26,12 +27,14 @@ public class TokenBalance
/// Balance (raw value, not divided by `decimals`).
/// **[sortable]**
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger Balance { get; set; }

/// <summary>
/// Balance value in mutez, based on the current token price.
/// **[sortable]**
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = true)]
public BigInteger? BalanceValue { get; set; }

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Tzkt.Api/Models/Tokens/TokenBalanceShort.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using NJsonSchema.Annotations;

namespace Tzkt.Api.Models
{
Expand All @@ -20,6 +21,7 @@ public class TokenBalanceShort
/// Balance (raw value, not divided by `decimals`).
/// **[sortable]**
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger Balance { get; set; }
}
}
2 changes: 2 additions & 0 deletions Tzkt.Api/Models/Tokens/TokenInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class TokenInfo
/// <summary>
/// Token id, unique within the contract.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger TokenId { get; set; }

/// <summary>
Expand All @@ -28,6 +29,7 @@ public class TokenInfo
/// <summary>
/// Total number of existing tokens (raw value, not divided by `decimals`).
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger TotalSupply { get; set; }

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions Tzkt.Api/Models/Tokens/TokenInfoShort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class TokenInfoShort
/// <summary>
/// Token id, unique within the contract.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger TokenId { get; set; }

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Tzkt.Api/Models/Tokens/TokenTransfer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using NJsonSchema.Annotations;

namespace Tzkt.Api.Models
{
Expand Down Expand Up @@ -43,6 +44,7 @@ public class TokenTransfer
/// Amount of tokens transferred (raw value, not divided by `decimals`).
/// **[sortable]**
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = false)]
public BigInteger Amount { get; set; }

/// <summary>
Expand Down
8 changes: 8 additions & 0 deletions Tzkt.Api/Parameters/BigIntegerNullableParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class BigIntegerNullableParameter : INormalizable
///
/// Example: `?balance=1234`.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = true)]
public BigInteger? Eq { get; set; }

/// <summary>
Expand All @@ -23,6 +24,7 @@ public class BigIntegerNullableParameter : INormalizable
///
/// Example: `?balance.ne=1234`.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = true)]
public BigInteger? Ne { get; set; }

/// <summary>
Expand All @@ -31,6 +33,7 @@ public class BigIntegerNullableParameter : INormalizable
///
/// Example: `?balance.gt=1234`.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = true)]
public BigInteger? Gt { get; set; }

/// <summary>
Expand All @@ -39,6 +42,7 @@ public class BigIntegerNullableParameter : INormalizable
///
/// Example: `?balance.ge=1234`.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = true)]
public BigInteger? Ge { get; set; }

/// <summary>
Expand All @@ -47,6 +51,7 @@ public class BigIntegerNullableParameter : INormalizable
///
/// Example: `?balance.lt=1234`.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = true)]
public BigInteger? Lt { get; set; }

/// <summary>
Expand All @@ -55,6 +60,7 @@ public class BigIntegerNullableParameter : INormalizable
///
/// Example: `?balance.le=1234`.
/// </summary>
[JsonSchemaType(typeof(string), IsNullable = true)]
public BigInteger? Le { get; set; }

/// <summary>
Expand All @@ -63,6 +69,7 @@ public class BigIntegerNullableParameter : INormalizable
///
/// Example: `?level.in=12,14,52,69`.
/// </summary>
[JsonSchemaType(typeof(List<string>), IsNullable = true)]
public List<BigInteger> In { get; set; }

/// <summary>
Expand All @@ -71,6 +78,7 @@ public class BigIntegerNullableParameter : INormalizable
///
/// Example: `?level.ni=12,14,52,69`.
/// </summary>
[JsonSchemaType(typeof(List<string>), IsNullable = true)]
public List<BigInteger> Ni { get; set; }

/// <summary>
Expand Down

0 comments on commit 477466f

Please sign in to comment.