Skip to content
9 changes: 5 additions & 4 deletions dotnet-algorand-sdk/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Numerics;

namespace Algorand
{
Expand Down Expand Up @@ -311,7 +312,7 @@ public Transaction(Address sender, ulong? fee, ulong? firstValid, ulong? lastVal
/// <param name="freeze">account which can freeze or unfreeze holder accounts</param>
/// <param name="clawback">account which can issue clawbacks against holder accounts</param>
private Transaction(Address sender, ulong? fee, ulong? firstValid, ulong? lastValid, byte[] note,
string genesisID, Digest genesisHash, ulong? assetTotal, int assetDecimals, bool defaultFrozen,
string genesisID, Digest genesisHash, BigInteger? assetTotal, int assetDecimals, bool defaultFrozen,
string assetUnitName, string assetName, string url, byte[] metadataHash,
Address manager, Address reserve, Address freeze, Address clawback)
{
Expand Down Expand Up @@ -578,7 +579,7 @@ private Transaction(Type type,
/// <param name="clawback">account which can issue clawbacks against holder accounts</param>
/// <returns></returns>
public static Transaction CreateAssetCreateTransaction(Address sender, ulong? fee, ulong? firstValid, ulong? lastValid, byte[] note,
string genesisID, Digest genesisHash, ulong? assetTotal, int assetDecimals, bool defaultFrozen,
string genesisID, Digest genesisHash, BigInteger? assetTotal, int assetDecimals, bool defaultFrozen,
string assetUnitName, string assetName, string url, byte[] metadataHash,
Address manager, Address reserve, Address freeze, Address clawback)
{
Expand Down Expand Up @@ -1059,7 +1060,7 @@ public class AssetParams
/// </summary>
[JsonProperty(PropertyName = "t")]
[DefaultValue(0)]
public ulong? assetTotal = 0;
public BigInteger? assetTotal = 0;

/// <summary>
/// Decimals specifies the number of digits to display after the decimal
Expand Down Expand Up @@ -1131,7 +1132,7 @@ public class AssetParams
public Address assetClawback = new Address();

public AssetParams(
ulong? assetTotal,
BigInteger? assetTotal,
int assetDecimals,
bool defaultFrozen,
string assetUnitName,
Expand Down
4 changes: 1 addition & 3 deletions dotnet-algorand-sdk/Util/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,7 @@ private static void ValidateAsset(V2.Algod.Model.AssetParams asset)
if (asset.Clawback is null) asset.Clawback = asset.Manager;
else if (asset.Clawback != "" && !Address.IsValid(asset.Clawback)) throw new ArgumentException("The clawback address is not valid.");

if (asset.MetadataHash is null || asset.MetadataHash.Length == 0)
asset.MetadataHash = Encoding.UTF8.GetBytes(GetRandomAssetMetaHash());//auto generate metahash by sdk
else if (asset.MetadataHash.Length != 32)
if (asset.MetadataHash is not null && asset.MetadataHash.Length != 32)
throw new ArgumentException("The metadata hash should be 32 bytes.");

if (asset.DefaultFrozen is null) asset.DefaultFrozen = false;
Expand Down
6 changes: 3 additions & 3 deletions dotnet-algorand-sdk/V2/Algod/Model/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public partial class Asset
{
/// <summary>unique asset identifier</summary>
[Newtonsoft.Json.JsonProperty("index", Required = Newtonsoft.Json.Required.Always)]
public BigInteger Index { get; set; }
public ulong Index { get; set; }

[Newtonsoft.Json.JsonProperty("params", Required = Newtonsoft.Json.Required.Always)]
[System.ComponentModel.DataAnnotations.Required]
Expand All @@ -171,7 +171,7 @@ public partial class AssetHolding

/// <summary>Asset ID of the holding.</summary>
[Newtonsoft.Json.JsonProperty("asset-id", Required = Newtonsoft.Json.Required.Always)]
public BigInteger AssetId { get; set; }
public ulong AssetId { get; set; }

/// <summary>\[f\] whether or not the holding is frozen.</summary>
[Newtonsoft.Json.JsonProperty("is-frozen", Required = Newtonsoft.Json.Required.Always)]
Expand Down Expand Up @@ -233,7 +233,7 @@ public partial class AssetParams

/// <summary>\[t\] The total number of units of this asset.</summary>
[Newtonsoft.Json.JsonProperty("total", Required = Newtonsoft.Json.Required.Always)]
public ulong? Total { get; set; }
public BigInteger? Total { get; set; }

/// <summary>\[un\] Name of a unit of this asset, as supplied by the creator. Included only when the name of a unit of this asset is composed of printable utf-8 characters.</summary>
[Newtonsoft.Json.JsonProperty("unit-name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
Expand Down
10 changes: 5 additions & 5 deletions dotnet-algorand-sdk/V2/Indexer/LookupApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Algorand.V2.Indexer
{
using System = global::System;
using Algorand.V2.Indexer.Model;

using System.Numerics;

[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.14.5.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v12.0.0.0))")]
public partial interface ILookupApi
Expand Down Expand Up @@ -116,13 +116,13 @@ public partial interface ILookupApi
/// <param name="include_all">Include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates.</param>
/// <returns>(empty)</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<Response9> AssetsAsync(int asset_id, bool? include_all);
System.Threading.Tasks.Task<Response9> AssetsAsync(ulong asset_id, bool? include_all);

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <param name="include_all">Include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates.</param>
/// <returns>(empty)</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<Response9> AssetsAsync(int asset_id, bool? include_all, System.Threading.CancellationToken cancellationToken);
System.Threading.Tasks.Task<Response9> AssetsAsync(ulong asset_id, bool? include_all, System.Threading.CancellationToken cancellationToken);

/// <param name="include_all">Include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates.</param>
/// <param name="limit">Maximum number of results to return. There could be additional pages even if the limit is not reached.</param>
Expand Down Expand Up @@ -786,7 +786,7 @@ public async System.Threading.Tasks.Task<Response8> LogsAsync(int application_id
/// <param name="include_all">Include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates.</param>
/// <returns>(empty)</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public System.Threading.Tasks.Task<Response9> AssetsAsync(int asset_id, bool? include_all)
public System.Threading.Tasks.Task<Response9> AssetsAsync(ulong asset_id, bool? include_all)
{
return AssetsAsync(asset_id, include_all, System.Threading.CancellationToken.None);
}
Expand All @@ -795,7 +795,7 @@ public System.Threading.Tasks.Task<Response9> AssetsAsync(int asset_id, bool? in
/// <param name="include_all">Include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates.</param>
/// <returns>(empty)</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public async System.Threading.Tasks.Task<Response9> AssetsAsync(int asset_id, bool? include_all, System.Threading.CancellationToken cancellationToken)
public async System.Threading.Tasks.Task<Response9> AssetsAsync(ulong asset_id, bool? include_all, System.Threading.CancellationToken cancellationToken)
{
if (asset_id == null)
throw new System.ArgumentNullException("asset_id");
Expand Down
4 changes: 2 additions & 2 deletions dotnet-algorand-sdk/V2/Indexer/Model/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public partial class Asset
{
/// <summary>unique asset identifier</summary>
[Newtonsoft.Json.JsonProperty("index")] //, Required = Newtonsoft.Json.Required.Always)]
public int Index { get; set; }
public ulong Index { get; set; }

/// <summary>Whether or not this asset is currently deleted.</summary>
[Newtonsoft.Json.JsonProperty("deleted", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
Expand Down Expand Up @@ -1132,7 +1132,7 @@ public partial class TransactionAssetTransfer

/// <summary>\[xaid\] ID of the asset being transferred.</summary>
[Newtonsoft.Json.JsonProperty("asset-id")] //, Required = Newtonsoft.Json.Required.Always)]
public BigInteger AssetId { get; set; }
public ulong AssetId { get; set; }

/// <summary>Number of assets transfered to the close-to account as part of the transaction.</summary>
[Newtonsoft.Json.JsonProperty("close-amount", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
Expand Down
Loading