diff --git a/dotnet-algorand-sdk/Account.cs b/dotnet-algorand-sdk/Account.cs
index 7b025d93..cc2c0d9d 100644
--- a/dotnet-algorand-sdk/Account.cs
+++ b/dotnet-algorand-sdk/Account.cs
@@ -34,9 +34,9 @@ public class Account
/// the rebuilded account
public static Account AccountFromPrivateKey(byte[] privateKey)
{
- if(privateKey.Length != SK_SIZE)
+ if(privateKey.Length != SK_SIZE)
throw new ArgumentException("Incorrect private key length");
-
+
var privateKeyRebuild = new Ed25519PrivateKeyParameters(privateKey, 0);
var publicKeyRebuild = privateKeyRebuild.GeneratePublicKey();
var act = new Account
diff --git a/dotnet-algorand-sdk/Algod/Model/AssetParams.cs b/dotnet-algorand-sdk/Algod/Model/AssetParams.cs
index 2c6b9aa0..3ba3b84b 100644
--- a/dotnet-algorand-sdk/Algod/Model/AssetParams.cs
+++ b/dotnet-algorand-sdk/Algod/Model/AssetParams.cs
@@ -1,4 +1,4 @@
-/*
+/*
* Algod REST API.
*
* API Endpoint for AlgoD Operations.
@@ -73,7 +73,7 @@ public partial class AssetParams : IEquatable, IValidatableObject
this.Unitname = unitname;
this.Url = url;
}
-
+
///
/// AssetName specifies the name of this asset, as supplied by the creator.
///
@@ -173,7 +173,7 @@ public override string ToString()
sb.Append("}\n");
return sb.ToString();
}
-
+
///
/// Returns the JSON string presentation of the object
///
@@ -203,57 +203,57 @@ public bool Equals(AssetParams input)
if (input == null)
return false;
- return
+ return
(
this.Assetname == input.Assetname ||
(this.Assetname != null &&
this.Assetname.Equals(input.Assetname))
- ) &&
+ ) &&
(
this.Clawbackaddr == input.Clawbackaddr ||
(this.Clawbackaddr != null &&
this.Clawbackaddr.Equals(input.Clawbackaddr))
- ) &&
+ ) &&
(
this.Creator == input.Creator ||
(this.Creator != null &&
this.Creator.Equals(input.Creator))
- ) &&
+ ) &&
(
this.Defaultfrozen == input.Defaultfrozen ||
(this.Defaultfrozen != null &&
this.Defaultfrozen.Equals(input.Defaultfrozen))
- ) &&
+ ) &&
(
this.Freezeaddr == input.Freezeaddr ||
(this.Freezeaddr != null &&
this.Freezeaddr.Equals(input.Freezeaddr))
- ) &&
+ ) &&
(
this.Managerkey == input.Managerkey ||
(this.Managerkey != null &&
this.Managerkey.Equals(input.Managerkey))
- ) &&
+ ) &&
(
this.Metadatahash == input.Metadatahash ||
(this.Metadatahash != null &&
this.Metadatahash.Equals(input.Metadatahash))
- ) &&
+ ) &&
(
this.Reserveaddr == input.Reserveaddr ||
(this.Reserveaddr != null &&
this.Reserveaddr.Equals(input.Reserveaddr))
- ) &&
+ ) &&
(
this.Total == input.Total ||
(this.Total != null &&
this.Total.Equals(input.Total))
- ) &&
+ ) &&
(
this.Unitname == input.Unitname ||
(this.Unitname != null &&
this.Unitname.Equals(input.Unitname))
- ) &&
+ ) &&
(
this.Url == input.Url ||
(this.Url != null &&
diff --git a/dotnet-algorand-sdk/Algod/Model/TransactionParams.cs b/dotnet-algorand-sdk/Algod/Model/TransactionParams.cs
index 16f407d3..ef0d8d27 100644
--- a/dotnet-algorand-sdk/Algod/Model/TransactionParams.cs
+++ b/dotnet-algorand-sdk/Algod/Model/TransactionParams.cs
@@ -1,4 +1,4 @@
-/*
+/*
* Algod REST API.
*
* API Endpoint for AlgoD Operations.
@@ -87,7 +87,7 @@ public partial class TransactionParams : IEquatable, IValida
}
this.MinFee = minFee;
}
-
+
///
/// ConsensusVersion indicates the consensus protocol version as of LastRound.
///
@@ -147,7 +147,7 @@ public override string ToString()
sb.Append("}\n");
return sb.ToString();
}
-
+
///
/// Returns the JSON string presentation of the object
///
@@ -177,32 +177,32 @@ public bool Equals(TransactionParams input)
if (input == null)
return false;
- return
+ return
(
this.ConsensusVersion == input.ConsensusVersion ||
(this.ConsensusVersion != null &&
this.ConsensusVersion.Equals(input.ConsensusVersion))
- ) &&
+ ) &&
(
this.Fee == input.Fee ||
(this.Fee != null &&
this.Fee.Equals(input.Fee))
- ) &&
+ ) &&
(
this.GenesisID == input.GenesisID ||
(this.GenesisID != null &&
this.GenesisID.Equals(input.GenesisID))
- ) &&
+ ) &&
(
this.Genesishashb64 == input.Genesishashb64 ||
(this.Genesishashb64 != null &&
this.Genesishashb64.Equals(input.Genesishashb64))
- ) &&
+ ) &&
(
this.LastRound == input.LastRound ||
(this.LastRound != null &&
this.LastRound.Equals(input.LastRound))
- ) &&
+ ) &&
(
this.MinFee == input.MinFee ||
(this.MinFee != null &&
diff --git a/dotnet-algorand-sdk/Transaction.cs b/dotnet-algorand-sdk/Transaction.cs
index 29586a8b..92e582df 100644
--- a/dotnet-algorand-sdk/Transaction.cs
+++ b/dotnet-algorand-sdk/Transaction.cs
@@ -4,8 +4,6 @@
using System.Text;
using System.Linq;
using System.Collections.Generic;
-using System.Threading;
-using Algorand.V2.Algod.Model;
namespace Algorand
{
@@ -799,7 +797,7 @@ public static Transaction CreateAssetRevokeTransaction(// AssetTransaction
genesisHash)
{
assetReceiver = assetReceiver, //arcv
- assetSender = assetRevokedFrom, //asnd
+ assetSender = assetRevokedFrom, //asnd
assetAmount = assetAmount, // aamt
sender = transactionSender // snd
}; // gh
@@ -919,10 +917,11 @@ public class Type
public static readonly Type AssetTransfer = new Type(4);
public static readonly Type AssetFreeze = new Type(5);
public static readonly Type ApplicationCall = new Type(6);
+ public static readonly Type StateProof = new Type(7);
private static Dictionary namesMap = new Dictionary {
{"", 0 }, {"pay", 1}, {"keyreg", 2},
- { "acfg", 3}, {"axfer", 4}, { "afrz", 5}, { "appl", 6}
+ { "acfg", 3}, {"axfer", 4}, { "afrz", 5}, { "appl", 6}, { "sptf", 7}
};
///
/// Return the enumeration for the given string value. Required for JSON serialization.
diff --git a/dotnet-algorand-sdk/Util/Utils.cs b/dotnet-algorand-sdk/Util/Utils.cs
index be4fb443..bfa3e577 100644
--- a/dotnet-algorand-sdk/Util/Utils.cs
+++ b/dotnet-algorand-sdk/Util/Utils.cs
@@ -31,10 +31,10 @@ public static string WaitTransactionToComplete(AlgodApi instance, string txID)
{
return "Transaction " + b3.Tx + " confirmed in round " + b3.Round;
}
- // loops 4 times per second, > 5 times per second will fail using TestNet Purestake Free verison
- // also blocks are created in under 5 seconds so no real need to poll constantly -
+ // loops 4 times per second, > 5 times per second will fail using TestNet Purestake Free verison
+ // also blocks are created in under 5 seconds so no real need to poll constantly -
// a few times per second should be fine
- System.Threading.Thread.Sleep(250);
+ System.Threading.Thread.Sleep(250);
}
}
///
@@ -44,14 +44,14 @@ public static string WaitTransactionToComplete(AlgodApi instance, string txID)
/// transaction ID
/// how many rounds do you wish to check pending transactions for
/// The pending transaction response
- public static async Task WaitTransactionToComplete(V2.Algod.DefaultApi instance, string txID, ulong timeout = 3)
+ public static async Task WaitTransactionToComplete(V2.Algod.DefaultApi instance, string txID, ulong timeout = 3)
{
if (instance == null || txID == null || txID.Length == 0 || timeout < 0)
{
throw new ArgumentException("Bad arguments for waitForConfirmation.");
}
- V2.Algod.Model.NodeStatusResponse nodeStatusResponse = await instance.StatusAsync();
+ V2.Algod.Model.NodeStatusResponse nodeStatusResponse = await instance.StatusAsync();
var startRound = nodeStatusResponse.LastRound + 1;
var currentRound = startRound;
while (currentRound < (startRound + timeout))
@@ -84,7 +84,7 @@ public static string WaitTransactionToComplete(AlgodApi instance, string txID)
///
public static TransactionID SubmitTransaction(AlgodApi instance, SignedTransaction signedTx) //throws Exception
{
- byte[] encodedTxBytes = Encoder.EncodeToMsgPack(signedTx);
+ byte[] encodedTxBytes = Encoder.EncodeToMsgPack(signedTx);
return instance.RawTransaction(encodedTxBytes);
}
///
@@ -100,7 +100,7 @@ public static TransactionID SubmitTransaction(AlgodApi instance, SignedTransacti
{
return await instance.TransactionsAsync(ms);
}
- }
+ }
///
/// encode and submit signed transactions using algod v2 api
///
@@ -143,7 +143,7 @@ public static Transaction GetPaymentTransaction(Address from, Address to, ulong?
return GetPaymentTransactionWithInfo(from, to, amount, message, trans.Fee, trans.LastRound, trans.GenesisID, trans.Genesishashb64);
}
///
- ///
+ ///
///
///
///
@@ -154,7 +154,7 @@ public static Transaction GetPaymentTransaction(Address from, Address to, ulong?
///
///
///
- public static Transaction GetPaymentTransactionWithInfo(Address from, Address to, ulong? amount, string message,
+ public static Transaction GetPaymentTransactionWithInfo(Address from, Address to, ulong? amount, string message,
ulong? fee, ulong? lastRound, string genesisId, string genesishashb64)
{
var tx = GetPaymentTransactionWithFlatFee(from, to, amount, message, fee, lastRound, genesisId, genesishashb64);
@@ -162,7 +162,7 @@ public static Transaction GetPaymentTransactionWithInfo(Address from, Address to
return tx;
}
///
- ///
+ ///
///
///
///
@@ -191,7 +191,7 @@ public static Transaction GetPaymentTransactionWithFlatFee(Address from, Address
/// message
/// Transaction Params(use AlgodApi.TransactionParams() function to get the params)
/// payment transaction
- public static Transaction GetPaymentTransaction(Address from, Address to, ulong? amount, string message,
+ public static Transaction GetPaymentTransaction(Address from, Address to, ulong? amount, string message,
TransactionParametersResponse trans)
{
if (trans is null)
@@ -217,9 +217,9 @@ public static string GetRandomAssetMetaHash()
/// The asset infomation
/// The blockchain infomation
/// The message for the transaction(have no affect to the assect)
- /// A value of 0 represents an asset that is not divisible,
- /// while a value of 1 represents an asset that is divisible into tenths and so on, i.e,
- /// the number of digits to display after the decimal place when displaying the asset.
+ /// A value of 0 represents an asset that is not divisible,
+ /// while a value of 1 represents an asset that is divisible into tenths and so on, i.e,
+ /// the number of digits to display after the decimal place when displaying the asset.
/// This value must be between 0 and 19
/// transaction
public static Transaction GetCreateAssetTransaction(AssetParams asset, TransactionParams trans, string message = "", int decimals = 0, ulong? flatFee = null)
@@ -261,7 +261,7 @@ public static Transaction GetCreateAssetTransaction(AssetParams asset, Transacti
}
return tx;
- }
+ }
///
/// Generate a create asset transaction V2
@@ -269,9 +269,9 @@ public static Transaction GetCreateAssetTransaction(AssetParams asset, Transacti
/// The asset infomation
/// The blockchain infomation
/// The message for the transaction(have no affect to the assect)
- /// A value of 0 represents an asset that is not divisible,
- /// while a value of 1 represents an asset that is divisible into tenths and so on, i.e,
- /// the number of digits to display after the decimal place when displaying the asset.
+ /// A value of 0 represents an asset that is not divisible,
+ /// while a value of 1 represents an asset that is divisible into tenths and so on, i.e,
+ /// the number of digits to display after the decimal place when displaying the asset.
/// This value must be between 0 and 19
/// transaction
public static Transaction GetCreateAssetTransaction(V2.Algod.Model.AssetParams asset, V2.Algod.Model.TransactionParametersResponse trans, string message = "", ulong? flatFee = null)
@@ -281,10 +281,10 @@ public static Transaction GetCreateAssetTransaction(V2.Algod.Model.AssetParams a
var tx = Transaction.CreateAssetCreateTransaction(new Address(asset.Creator), (ulong?)trans.Fee, (ulong?)trans.LastRound, (ulong?)trans.LastRound + 1000,
Encoding.UTF8.GetBytes(message), trans.GenesisId, new Digest(trans.GenesisHash),
asset.Total, (int)asset.Decimals, (bool)asset.DefaultFrozen, asset.UnitName, asset.Name, asset.Url,
- asset.MetadataHash,
- asset.Manager==""||asset.Manager==null ? null : new Address(asset.Manager),
+ asset.MetadataHash,
+ asset.Manager==""||asset.Manager==null ? null : new Address(asset.Manager),
asset.Reserve==""||asset.Reserve==null ? null : new Address(asset.Reserve),
- asset.Freeze==""||asset.Freeze==null ? null : new Address(asset.Freeze),
+ asset.Freeze==""||asset.Freeze==null ? null : new Address(asset.Freeze),
asset.Clawback==""||asset.Clawback==null ? null : new Address(asset.Clawback));
if (flatFee is null || flatFee == 0)
@@ -294,7 +294,7 @@ public static Transaction GetCreateAssetTransaction(V2.Algod.Model.AssetParams a
else
{
tx.fee = flatFee;
- }
+ }
return tx;
}
///
@@ -312,7 +312,7 @@ public static Transaction GetConfigAssetTransaction(Address sender, ulong? asset
//sender must be manager
var tx = Transaction.CreateAssetConfigureTransaction(sender, 1,
trans.LastRound, trans.LastRound + 1000, Encoding.UTF8.GetBytes(message), trans.GenesisID,
- new Digest(trans.Genesishashb64), assetId, new Address(asset.Managerkey),
+ new Digest(trans.Genesishashb64), assetId, new Address(asset.Managerkey),
new Address(asset.Reserveaddr), new Address(asset.Freezeaddr), new Address(asset.Clawbackaddr), false);
if (flatFee is null || flatFee == 0)
{
@@ -325,7 +325,7 @@ public static Transaction GetConfigAssetTransaction(Address sender, ulong? asset
return tx;
}
- public static Transaction GetConfigAssetTransaction(Address sender, V2.Algod.Model.Asset asset, TransactionParametersResponse trans,
+ public static Transaction GetConfigAssetTransaction(Address sender, V2.Algod.Model.Asset asset, TransactionParametersResponse trans,
string message = "", ulong? flatFee = null)
{
ValidateAsset(asset.Params);
@@ -357,9 +357,9 @@ public static Transaction GetConfigAssetTransaction(Address sender, V2.Algod.Mod
/// The blockchain infomation
/// The message for the transaction(have no affect to the assect)
/// transaction
- public static Transaction GetActivateAssetTransaction(Address sender, ulong? assetId, TransactionParams trans,
+ public static Transaction GetActivateAssetTransaction(Address sender, ulong? assetId, TransactionParams trans,
string message = "", ulong? flatFee = null)
- {
+ {
return GetAssetOptingInTransaction(sender, assetId, trans, message, flatFee);
}
///
@@ -371,7 +371,7 @@ public static Transaction GetActivateAssetTransaction(Address sender, ulong? ass
/// The blockchain infomation
/// The message for the transaction(have no affect to the assect)
/// transaction
- public static Transaction GetAssetOptingInTransaction(Address sender, ulong? assetId, TransactionParams trans,
+ public static Transaction GetAssetOptingInTransaction(Address sender, ulong? assetId, TransactionParams trans,
string message = "", ulong? flatFee = null)
{
var tx = Transaction.CreateAssetAcceptTransaction(sender, 1, trans.LastRound,
@@ -388,7 +388,7 @@ public static Transaction GetAssetOptingInTransaction(Address sender, ulong? ass
//Account.SetFeeByFeePerByte(tx, trans.Fee);
return tx;
}
- public static Transaction GetAssetOptingInTransaction(Address sender, ulong? assetID, TransactionParametersResponse trans,
+ public static Transaction GetAssetOptingInTransaction(Address sender, ulong? assetID, TransactionParametersResponse trans,
string message = "", ulong? flatFee = null)
{
var tx = Transaction.CreateAssetAcceptTransaction(sender, 1, (ulong?)trans.LastRound,
@@ -406,10 +406,10 @@ public static Transaction GetAssetOptingInTransaction(Address sender, ulong? ass
return tx;
}
- public static Transaction GetTransferAssetTransaction(Address from, Address to, ulong? assetId, ulong amount, TransactionParams trans,
+ public static Transaction GetTransferAssetTransaction(Address from, Address to, ulong? assetId, ulong amount, TransactionParams trans,
Address closeTo = null, string message = "", ulong? flatFee = null) {
var tx = Transaction.CreateAssetTransferTransaction(from, to, closeTo, amount, 1,
- trans.LastRound, trans.LastRound + 1000, Encoding.UTF8.GetBytes(message), trans.GenesisID,
+ trans.LastRound, trans.LastRound + 1000, Encoding.UTF8.GetBytes(message), trans.GenesisID,
new Digest(trans.Genesishashb64), assetId);
if (flatFee is null || flatFee == 0)
{
@@ -422,7 +422,7 @@ public static Transaction GetTransferAssetTransaction(Address from, Address to,
//Account.SetFeeByFeePerByte(tx, trans.Fee);
return tx;
}
- public static Transaction GetTransferAssetTransaction(Address from, Address to, ulong? assetId, ulong amount,
+ public static Transaction GetTransferAssetTransaction(Address from, Address to, ulong? assetId, ulong amount,
TransactionParametersResponse trans, Address closeTo = null, string message = "", ulong? flatFee = null)
{
var tx = Transaction.CreateAssetTransferTransaction(from, to, closeTo, amount, 1,
@@ -450,7 +450,7 @@ public static Transaction GetTransferAssetTransaction(Address from, Address to,
/// The blockchain infomation
/// The message for the transaction(have no affect to the assect)
/// transaction
- public static Transaction GetFreezeAssetTransaction(Address sender, Address toFreeze, ulong? assetId, bool freezeState,
+ public static Transaction GetFreezeAssetTransaction(Address sender, Address toFreeze, ulong? assetId, bool freezeState,
TransactionParams trans, string message = "", ulong? flatFee = null)
{
var tx = Transaction.CreateAssetFreezeTransaction(sender, toFreeze, freezeState, 1, trans.LastRound,
@@ -467,7 +467,7 @@ public static Transaction GetFreezeAssetTransaction(Address sender, Address toFr
return tx;
}
- public static Transaction GetFreezeAssetTransaction(Address sender, Address toFreeze, ulong? assetId, bool freezeState,
+ public static Transaction GetFreezeAssetTransaction(Address sender, Address toFreeze, ulong? assetId, bool freezeState,
TransactionParametersResponse trans, string message = "", ulong? flatFee = null)
{
var tx = Transaction.CreateAssetFreezeTransaction(sender, toFreeze, freezeState, 1, (ulong?)trans.LastRound,
@@ -484,7 +484,7 @@ public static Transaction GetFreezeAssetTransaction(Address sender, Address toFr
return tx;
}
///
- ///
+ ///
///
///
///
@@ -494,11 +494,11 @@ public static Transaction GetFreezeAssetTransaction(Address sender, Address toFr
///
///
///
- public static Transaction GetRevokeAssetTransaction(Address reserve, Address revokedFrom, Address receiver, ulong? assetId,
+ public static Transaction GetRevokeAssetTransaction(Address reserve, Address revokedFrom, Address receiver, ulong? assetId,
ulong amount, TransactionParams trans, string message = "", ulong? flatFee = null)
{
var tx = Transaction.CreateAssetRevokeTransaction(reserve, revokedFrom, receiver, amount, 1, trans.LastRound,
- trans.LastRound + 1000, Encoding.UTF8.GetBytes(message), trans.GenesisID,
+ trans.LastRound + 1000, Encoding.UTF8.GetBytes(message), trans.GenesisID,
new Digest(trans.Genesishashb64), assetId);
if (flatFee is null || flatFee == 0)
{
@@ -512,7 +512,7 @@ public static Transaction GetRevokeAssetTransaction(Address reserve, Address rev
return tx;
}
///
- ///
+ ///
///
///
///
@@ -523,7 +523,7 @@ public static Transaction GetRevokeAssetTransaction(Address reserve, Address rev
///
///
///
- public static Transaction GetRevokeAssetTransaction(Address reserve, Address revokedFrom, Address receiver, ulong? assetId,
+ public static Transaction GetRevokeAssetTransaction(Address reserve, Address revokedFrom, Address receiver, ulong? assetId,
ulong amount, TransactionParametersResponse trans, string message = "", ulong? flatFee = null)
{
var tx = Transaction.CreateAssetRevokeTransaction(reserve, revokedFrom, receiver, amount, 1, (ulong?)trans.LastRound,
@@ -542,17 +542,17 @@ public static Transaction GetRevokeAssetTransaction(Address reserve, Address rev
}
///
- ///
+ ///
///
///
///
///
///
///
- public static Transaction GetDestroyAssetTransaction(Address manager, ulong? assetId, TransactionParams trans,
+ public static Transaction GetDestroyAssetTransaction(Address manager, ulong? assetId, TransactionParams trans,
string message = "", ulong? flatFee = null)
{
- var tx = Transaction.CreateAssetDestroyTransaction(manager, 1, trans.LastRound, trans.LastRound + 1000,
+ var tx = Transaction.CreateAssetDestroyTransaction(manager, 1, trans.LastRound, trans.LastRound + 1000,
Encoding.UTF8.GetBytes(message), new Digest(trans.Genesishashb64), assetId);
if (flatFee is null || flatFee == 0)
{
@@ -565,7 +565,7 @@ public static Transaction GetDestroyAssetTransaction(Address manager, ulong? ass
//Account.SetFeeByFeePerByte(tx, trans.Fee);
return tx;
}
- public static Transaction GetDestroyAssetTransaction(Address manager, ulong? assetId, TransactionParametersResponse trans,
+ public static Transaction GetDestroyAssetTransaction(Address manager, ulong? assetId, TransactionParametersResponse trans,
string message = "", ulong? flatFee = null)
{
var tx = Transaction.CreateAssetDestroyTransaction(manager, 1, (ulong?)trans.LastRound, (ulong?)trans.LastRound + 1000,
@@ -585,26 +585,26 @@ private static void ValidateAsset(AssetParams asset)
{
if (asset.Creator is null || asset.Creator == "") throw new ArgumentException("The sender must be specified.");
else if (!Address.IsValid(asset.Creator)) throw new ArgumentException("The sender address is not valid.");
-
+
if (asset.Assetname is null || asset.Assetname == "") throw new ArgumentException("The asset name must be specified.");
-
+
if (asset.Unitname is null || asset.Unitname == "") throw new ArgumentException("The unit name must be specified.");
else if (asset.Unitname.Length > 8) throw new ArgumentException(string.Format("The length of unit name is {0} > 8.", asset.Unitname.Length));
-
+
if (asset.Total is null || asset.Total < 1) throw new ArgumentException("The total number of the asset must be specified and bigger than zero.");
-
+
if (asset.Managerkey is null) asset.Managerkey = asset.Creator;
else if (asset.Managerkey != "" && !Address.IsValid(asset.Managerkey)) throw new ArgumentException("The manager address is not valid.");
-
+
if (asset.Reserveaddr is null) asset.Reserveaddr = asset.Managerkey;
else if (asset.Reserveaddr != "" && !Address.IsValid(asset.Reserveaddr)) throw new ArgumentException("The reserve address is not valid.");
-
+
if (asset.Freezeaddr is null) asset.Freezeaddr = asset.Managerkey;
else if (asset.Freezeaddr != "" && !Address.IsValid(asset.Freezeaddr)) throw new ArgumentException("The freeze address is not valid.");
-
+
if (asset.Clawbackaddr is null) asset.Clawbackaddr = asset.Managerkey;
else if (asset.Clawbackaddr != "" && !Address.IsValid(asset.Clawbackaddr)) throw new ArgumentException("The clawback address is not valid.");
-
+
if (asset.Metadatahash is null || asset.Metadatahash == "")
asset.Metadatahash = GetRandomAssetMetaHash();//auto generate metahash by sdk
else if (Convert.FromBase64String(asset.Metadatahash).Length != 32)
@@ -615,26 +615,26 @@ private static void ValidateAsset(V2.Algod.Model.AssetParams asset)
{
if (asset.Creator is null || asset.Creator == "") throw new ArgumentException("The sender must be specified.");
else if (!Address.IsValid(asset.Creator)) throw new ArgumentException("The sender address is not valid.");
-
+
if (asset.Name is null || asset.Name == "") throw new ArgumentException("The asset name must be specified.");
-
+
if (asset.UnitName is null || asset.UnitName == "") throw new ArgumentException("The unit name must be specified.");
else if (asset.UnitName.Length > 8) throw new ArgumentException(string.Format("The length of unit name is {0} > 8.", asset.UnitName.Length));
-
+
if (asset.Total is null || asset.Total < 1) throw new ArgumentException("The total number of the asset must be specified and bigger than zero.");
-
+
if (asset.Manager is null) asset.Manager = asset.Creator;
else if (asset.Manager != "" && !Address.IsValid(asset.Manager)) throw new ArgumentException("The manager address is not valid.");
-
+
if (asset.Reserve is null) asset.Reserve = asset.Manager;
else if (asset.Reserve != "" && !Address.IsValid(asset.Reserve)) throw new ArgumentException("The reserve address is not valid.");
-
+
if (asset.Freeze is null) asset.Freeze = asset.Manager;
else if (asset.Freeze != "" && !Address.IsValid(asset.Freeze)) throw new ArgumentException("The freeze address is not valid.");
-
+
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)
@@ -643,7 +643,7 @@ private static void ValidateAsset(V2.Algod.Model.AssetParams asset)
if (asset.DefaultFrozen is null) asset.DefaultFrozen = false;
}
///
- ///
+ ///
///
///
///
@@ -669,7 +669,7 @@ public static Transaction GetBidTransaction(Address bidder, Address auction, Sig
return tx;
}
/////
- /////
+ /////
/////
/////
/////
@@ -682,7 +682,7 @@ public static Transaction GetBidTransaction(Address bidder, Address auction, Sig
/////
/////
/////
- //public static Transaction GetApplicationTransaction(Address sender, long firstValid, long lastValid, string genesishashb64,
+ //public static Transaction GetApplicationTransaction(Address sender, long firstValid, long lastValid, string genesishashb64,
// OnCompletion onCompletion, long applicationId, List applicationArgs, List accounts, List foreignApps, List foreignAssets)
//{
// var txn = new Transaction
@@ -701,7 +701,7 @@ public static Transaction GetBidTransaction(Address bidder, Address auction, Sig
// if (applicationId >= 0) txn.applicationId = (ulong?)applicationId;
// else throw new ArgumentException("Please set right application Id.");
- // //if (onCompletion != new OnCompletion())
+ // //if (onCompletion != new OnCompletion())
// txn.onCompletion = onCompletion;
// //else throw new ArgumentException("OnCompletion is required, please file a bug report.");
// if (applicationArgs != null) txn.applicationArgs = applicationArgs;
@@ -799,7 +799,7 @@ public static Transaction GetApplicationCallTransaction(Address sender, ulong? a
/// clear program
/// suggested transaction params
/// update application transaction
- public static Transaction GetApplicationUpdateTransaction(Address sender, ulong? applicationId,
+ public static Transaction GetApplicationUpdateTransaction(Address sender, ulong? applicationId,
TEALProgram approvalProgram, TEALProgram clearProgram, TransactionParametersResponse trans)
{
var fee = (ulong?)trans.Fee;
@@ -892,7 +892,7 @@ public static Transaction GetApplicationCloseTransaction(Address sender, ulong?
return txn;
}
/////
- /////
+ /////
/////
/////
/////
@@ -909,10 +909,10 @@ public static Transaction GetApplicationCloseTransaction(Address sender, ulong?
// Account.SetFeeByFeePerByte(tx, trans.Fee);
// return tx;
//}
- //public static Transaction GetLogicSignatureTransaction(LogicsigSignature lsig, Address receiver,
+ //public static Transaction GetLogicSignatureTransaction(LogicsigSignature lsig, Address receiver,
// TransactionParametersResponse trans, string message = "")
//{
- // var tx = new Transaction(lsig.ToAddress(), receiver, 1, (ulong?)trans.LastRound,
+ // var tx = new Transaction(lsig.ToAddress(), receiver, 1, (ulong?)trans.LastRound,
// (ulong?)trans.LastRound + 1000, trans.GenesisId, new Digest(trans.GenesisHash))
// {
// note = Encoding.UTF8.GetBytes(message)
@@ -932,7 +932,7 @@ public static Transaction GetApplicationCloseTransaction(Address sender, ulong?
// return tx;
//}
///
- ///
+ ///
///
///
///
@@ -942,7 +942,7 @@ public static Transaction GetApplicationCloseTransaction(Address sender, ulong?
{
List sources = new List();
List stxns = new List();
- //compiled
+ //compiled
if (source is null)
{
stxns.Add(stxn);
diff --git a/dotnet-algorand-sdk/V2/Algod/Model/Model.cs b/dotnet-algorand-sdk/V2/Algod/Model/Model.cs
index e3f1c7ea..f7c420cd 100644
--- a/dotnet-algorand-sdk/V2/Algod/Model/Model.cs
+++ b/dotnet-algorand-sdk/V2/Algod/Model/Model.cs
@@ -14,6 +14,7 @@
namespace Algorand.V2.Algod.Model
{
+ using System.Numerics;
using System = global::System;
/// Account information at a given round.
@@ -148,7 +149,7 @@ public partial class Asset
{
/// unique asset identifier
[Newtonsoft.Json.JsonProperty("index", Required = Newtonsoft.Json.Required.Always)]
- public int Index { get; set; }
+ public BigInteger Index { get; set; }
[Newtonsoft.Json.JsonProperty("params", Required = Newtonsoft.Json.Required.Always)]
[System.ComponentModel.DataAnnotations.Required]
@@ -166,16 +167,11 @@ public partial class AssetHolding
{
/// \[a\] number of units held.
[Newtonsoft.Json.JsonProperty("amount", Required = Newtonsoft.Json.Required.Always)]
- public ulong Amount { get; set; }
+ public BigInteger Amount { get; set; }
/// Asset ID of the holding.
[Newtonsoft.Json.JsonProperty("asset-id", Required = Newtonsoft.Json.Required.Always)]
- public ulong AssetId { get; set; }
-
- /// Address that created this asset. This is the address where the parameters for this asset can be found, and also the address where unwanted asset units can be sent in the worst case.
- [Newtonsoft.Json.JsonProperty("creator", Required = Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
- public string Creator { get; set; }
+ public BigInteger AssetId { get; set; }
/// \[f\] whether or not the holding is frozen.
[Newtonsoft.Json.JsonProperty("is-frozen", Required = Newtonsoft.Json.Required.Always)]
diff --git a/dotnet-algorand-sdk/V2/Indexer/LookupApi.cs b/dotnet-algorand-sdk/V2/Indexer/LookupApi.cs
index 30462562..f504a0fe 100644
--- a/dotnet-algorand-sdk/V2/Indexer/LookupApi.cs
+++ b/dotnet-algorand-sdk/V2/Indexer/LookupApi.cs
@@ -419,9 +419,6 @@ public System.Threading.Tasks.Task TransactionsGetAsync(int? limit, s
/// A server side error occurred.
public async System.Threading.Tasks.Task TransactionsGetAsync(int? limit, string next, string note_prefix, TxType? tx_type, SigType? sig_type, string txid, ulong? round, ulong? min_round, ulong? max_round, int? asset_id, System.DateTimeOffset? before_time, System.DateTimeOffset? after_time, ulong? currency_greater_than, ulong? currency_less_than, string account_id, bool? rekey_to, System.Threading.CancellationToken cancellationToken)
{
- if (account_id == null)
- throw new System.ArgumentNullException("account_id");
-
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/accounts/{account-id}/transactions?");
urlBuilder_.Replace("{account-id}", System.Uri.EscapeDataString(ConvertToString(account_id, System.Globalization.CultureInfo.InvariantCulture)));
diff --git a/dotnet-algorand-sdk/V2/Indexer/Model/Model.cs b/dotnet-algorand-sdk/V2/Indexer/Model/Model.cs
index bc21e519..f30eece9 100644
--- a/dotnet-algorand-sdk/V2/Indexer/Model/Model.cs
+++ b/dotnet-algorand-sdk/V2/Indexer/Model/Model.cs
@@ -15,11 +15,15 @@
namespace Algorand.V2.Indexer.Model
{
using Newtonsoft.Json;
+ using Newtonsoft.Json.Linq;
+ using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.IO;
+ using System.Numerics;
+ using System.Runtime.Serialization;
using System = global::System;
@@ -38,11 +42,11 @@ public partial class Account
/// \[algo\] total number of MicroAlgos in the account
[Newtonsoft.Json.JsonProperty("amount")] //, Required = Newtonsoft.Json.Required.Always)]
- public ulong Amount { get; set; }
+ public BigInteger Amount { get; set; }
/// specifies the amount of MicroAlgos in the account, without the pending rewards.
[Newtonsoft.Json.JsonProperty("amount-without-pending-rewards")]//)] //)] //, Required = Newtonsoft.Json.Required.Always)]
- public ulong AmountWithoutPendingRewards { get; set; }
+ public BigInteger AmountWithoutPendingRewards { get; set; }
/// \[appl\] applications local data stored in this account.
///
@@ -369,7 +373,7 @@ public partial class AssetHolding
{
/// \[a\] number of units held.
[Newtonsoft.Json.JsonProperty("amount")] //, Required = Newtonsoft.Json.Required.Always)]
- public ulong Amount { get; set; }
+ public BigInteger Amount { get; set; }
/// Asset ID of the holding.
[Newtonsoft.Json.JsonProperty("asset-id")] //, Required = Newtonsoft.Json.Required.Always)]
@@ -452,7 +456,7 @@ public partial class AssetParams
/// \[t\] The total number of units of this asset.
[Newtonsoft.Json.JsonProperty("total")] //, Required = Newtonsoft.Json.Required.Always)]
- public ulong Total { get; set; }
+ public BigInteger Total { get; set; }
/// \[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.
[Newtonsoft.Json.JsonProperty("unit-name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
@@ -469,8 +473,6 @@ public partial class AssetParams
/// Base64 encoded URL where more information about the asset can be retrieved.
[Newtonsoft.Json.JsonProperty("url-b64", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public byte[] UrlB64 { get; set; }
-
-
}
/// Block information.
@@ -663,7 +665,7 @@ public partial class MiniAssetHolding
public string Address { get; set; }
[Newtonsoft.Json.JsonProperty("amount")] //, Required = Newtonsoft.Json.Required.Always)]
- public ulong Amount { get; set; }
+ public BigInteger Amount { get; set; }
[Newtonsoft.Json.JsonProperty("is-frozen")] //, Required = Newtonsoft.Json.Required.Always)]
public bool IsFrozen { get; set; }
@@ -898,11 +900,11 @@ public partial class Transaction
/// \[rc\] rewards applied to close-remainder-to account.
[Newtonsoft.Json.JsonProperty("close-rewards", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
- public long? CloseRewards { get; set; }
+ public BigInteger? CloseRewards { get; set; }
/// \[ca\] closing amount for transaction.
[Newtonsoft.Json.JsonProperty("closing-amount", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
- public long? ClosingAmount { get; set; }
+ public BigInteger? ClosingAmount { get; set; }
/// Round when the transaction was confirmed.
[Newtonsoft.Json.JsonProperty("confirmed-round", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
@@ -994,19 +996,21 @@ public partial class Transaction
///
* \[acfg\] asset-config-transaction
///
* \[axfer\] asset-transfer-transaction
///
* \[afrz\] asset-freeze-transaction
- ///
* \[appl\] application-transaction
+ ///
* \[appl\] application-transaction
+ ///
* \[stpf\] state-proof-transaction
+ ///
[Newtonsoft.Json.JsonProperty("tx-type")] //, Required = Newtonsoft.Json.Required.Always)]
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public TransactionTxType TxType { get; set; }
/// \[ld\] Local state key/value changes for the application being executed by this transaction.
- [Newtonsoft.Json.JsonProperty("local-state-delta", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
- public System.Collections.Generic.ICollection LocalStateDelta { get; set; }
+ //[Newtonsoft.Json.JsonProperty("local-state-delta", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
+ //public System.Collections.Generic.ICollection LocalStateDelta { get; set; }
/// \[gd\] Global state key/value changes for the application being executed by this transaction.
- [Newtonsoft.Json.JsonProperty("global-state-delta", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
- public StateDelta GlobalStateDelta { get; set; }
+ //[Newtonsoft.Json.JsonProperty("global-state-delta", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
+ //public StateDelta GlobalStateDelta { get; set; }
/// \[lg\] Logs for the application being executed by this transaction.
[Newtonsoft.Json.JsonProperty("logs", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
@@ -1125,15 +1129,15 @@ public partial class TransactionAssetTransfer
{
/// \[aamt\] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map.
[Newtonsoft.Json.JsonProperty("amount")] //, Required = Newtonsoft.Json.Required.Always)]
- public ulong Amount { get; set; }
+ public BigInteger Amount { get; set; }
/// \[xaid\] ID of the asset being transferred.
[Newtonsoft.Json.JsonProperty("asset-id")] //, Required = Newtonsoft.Json.Required.Always)]
- public ulong AssetId { get; set; }
+ public BigInteger AssetId { get; set; }
/// Number of assets transfered to the close-to account as part of the transaction.
[Newtonsoft.Json.JsonProperty("close-amount", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
- public ulong? CloseAmount { get; set; }
+ public BigInteger? CloseAmount { get; set; }
/// \[aclose\] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account.
[Newtonsoft.Json.JsonProperty("close-to", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
@@ -1194,11 +1198,11 @@ public partial class TransactionPayment
{
/// \[amt\] number of MicroAlgos intended to be transferred.
[Newtonsoft.Json.JsonProperty("amount")] //, Required = Newtonsoft.Json.Required.Always)]
- public ulong Amount { get; set; }
+ public BigInteger Amount { get; set; }
/// Number of MicroAlgos that were sent to the close-remainder-to address when closing the sender account.
[Newtonsoft.Json.JsonProperty("close-amount", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
- public long? CloseAmount { get; set; }
+ public BigInteger? CloseAmount { get; set; }
/// \[close\] when set, indicates that the sending account should be closed and all remaining funds be transferred to this address.
[Newtonsoft.Json.JsonProperty("close-remainder-to", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
@@ -1311,7 +1315,12 @@ public enum TxType
[System.Runtime.Serialization.EnumMember(Value = @"appl")]
Appl = 5,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"stpf")]
+ Stpf = 6,
+ [System.Runtime.Serialization.EnumMember(Value = @"hb")]
+ Hb = 7
}
/// SigType filters just results using the specified type of signature:
@@ -1619,6 +1628,11 @@ public enum TransactionTxType
[System.Runtime.Serialization.EnumMember(Value = @"appl")]
Appl = 5,
+ [System.Runtime.Serialization.EnumMember(Value = @"stpf")]
+ Stpf = 6,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"hb")]
+ Hb = 7
}
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.14.5.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v12.0.0.0))")]
diff --git a/dotnet-algorand-sdk/dotnet-algorand-sdk.csproj b/dotnet-algorand-sdk/dotnet-algorand-sdk.csproj
index 319d576b..90ee523a 100644
--- a/dotnet-algorand-sdk/dotnet-algorand-sdk.csproj
+++ b/dotnet-algorand-sdk/dotnet-algorand-sdk.csproj
@@ -1,12 +1,12 @@
- netstandard2.0
+ net6.0
Algorand
Algorand
true
true
- 0.2.1.0
+ 0.2.2.0-beta19
Riley Ge
Tson Tec
Algorand .NET SDK
@@ -16,8 +16,8 @@
The Algorand SDK.
AVM 1.0 , Indexer 2.8 branch and Algo rel/stable branch (Nov 2021)
true
- 0.2.1.0
- 0.2.1.0
+ 0.2.2.0
+ 0.2.2.0
LICENSE
diff --git a/sdk-examples/sdk-examples.csproj b/sdk-examples/sdk-examples.csproj
index 688a785b..8b7c2bbf 100644
--- a/sdk-examples/sdk-examples.csproj
+++ b/sdk-examples/sdk-examples.csproj
@@ -2,7 +2,7 @@
Exe
- netcoreapp2.1
+ net6.0
sdk_examples
sdk_examples.Program
diff --git a/test/test.csproj b/test/test.csproj
index c29272af..1232016e 100644
--- a/test/test.csproj
+++ b/test/test.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net6.0
false