/// <summary> /// Initializes a new instance of the <see cref="ModifyMultisigAccountTransaction"/> class. /// </summary> /// <param name="networkType">Type of the network.</param> /// <param name="version">The transaction version.</param> /// <param name="deadline">The deadline.</param> /// <param name="fee">The fee.</param> /// <param name="minApprovalDelta">The minimum approval delta.</param> /// <param name="minRemovalDelta">The minimum removal delta.</param> /// <param name="modifications">The modifications.</param> /// <param name="signature">The signature.</param> /// <param name="signer">The signer.</param> /// <param name="transactionInfo">The transaction information.</param> /// <exception cref="ArgumentNullException">modifications</exception> /// <exception cref="InvalidEnumArgumentException">networkType</exception> public ModifyMultisigAccountTransaction(NetworkType.Types networkType, int version, Deadline deadline, ulong fee, int minApprovalDelta, int minRemovalDelta, List <MultisigCosignatoryModification> modifications, string signature, PublicAccount signer, TransactionInfo transactionInfo) { if (modifications == null) { throw new ArgumentNullException(nameof(modifications)); } if (!Enum.IsDefined(typeof(NetworkType.Types), networkType)) { throw new InvalidEnumArgumentException(nameof(networkType), (int)networkType, typeof(NetworkType.Types)); } Deadline = deadline; NetworkType = networkType; Version = version; Fee = fee; MinRemovalDelta = minRemovalDelta; MinApprovalDelta = minApprovalDelta; Modifications = modifications.ToArray(); TransactionType = TransactionTypes.Types.ModifyMultisigAccount; Signer = signer; Signature = signature; TransactionInfo = transactionInfo; }
/// <summary> /// Initializes a new instance of the <see cref="MosaicSupplyChangeTransaction"/> class. /// </summary> /// <param name="networkType">Type of the network.</param> /// <param name="version">The transaction version.</param> /// <param name="deadline">The deadline.</param> /// <param name="fee">The fee.</param> /// <param name="mosaicId">The mosaic identifier.</param> /// <param name="direction">The direction.</param> /// <param name="delta">The delta.</param> /// <param name="signature">The signature.</param> /// <param name="signer">The signer.</param> /// <param name="transactionInfo">The transaction information.</param> /// <exception cref="ArgumentOutOfRangeException">direction</exception> /// <exception cref="InvalidEnumArgumentException">networkType</exception> /// <exception cref="ArgumentNullException">mosaicId</exception> public MosaicSupplyChangeTransaction(NetworkType.Types networkType, int version, Deadline deadline, ulong fee, MosaicId mosaicId, MosaicSupplyType.Type direction, ulong delta, string signature, PublicAccount signer, TransactionInfo transactionInfo) { if (direction.GetValue() >= 2) { throw new ArgumentOutOfRangeException(nameof(direction)); } if (!Enum.IsDefined(typeof(NetworkType.Types), networkType)) { throw new InvalidEnumArgumentException(nameof(networkType), (int)networkType, typeof(NetworkType.Types)); } MosaicId = mosaicId ?? throw new ArgumentNullException(nameof(mosaicId)); Delta = delta; SupplyType = direction; Version = version; Deadline = deadline; Fee = fee; NetworkType = networkType; TransactionType = TransactionTypes.Types.MosaicSupplyChange; Signer = signer; Signature = signature; TransactionInfo = transactionInfo; }
/// <summary> /// Initializes a new instance of the <see cref="LockFundsTransaction"/> class. /// </summary> /// <param name="version">The transaction version.</param> /// <param name="deadline">The deadline.</param> /// <param name="duration">The duration.</param> /// <param name="fee">The transaction fee.</param> /// <param name="mosaic">The mosaic.</param> /// <param name="transaction">The transaction.</param> /// <param name="networkType">Type of the network.</param> /// <param name="signature">The signature.</param> /// <param name="signer">The signer.</param> /// <param name="transactionInfo">The transaction information.</param> public LockFundsTransaction(NetworkType.Types networkType, int version, Deadline deadline, ulong fee, Mosaic mosaic, ulong duration, SignedTransaction transaction, string signature, PublicAccount signer, TransactionInfo transactionInfo) { if (transaction.TransactionType != TransactionTypes.Types.AggregateBonded) { throw new ArgumentException("Cannot lock non-aggregate-bonded transaction"); } Deadline = deadline; Version = version; Duration = duration; Mosaic = mosaic; NetworkType = networkType; Transaction = transaction; TransactionType = TransactionTypes.Types.LockFunds; Signer = signer; Signature = signature; TransactionInfo = transactionInfo; Fee = fee; }
/// <summary> /// Initializes a new instance of the <see cref="TransferTransaction"/> class. /// </summary> /// <param name="networkType">Type of the network.</param> /// <param name="version">The version.</param> /// <param name="deadline">The deadline.</param> /// <param name="fee">The fee.</param> /// <param name="recipient">The recipient.</param> /// <param name="mosaics">The mosaics.</param> /// <param name="message">The message.</param> /// <param name="signature">The signature.</param> /// <param name="signer">The signer.</param> /// <param name="transactionInfo">The transaction information.</param> /// <exception cref="ArgumentNullException"> /// mosaics /// or /// recipient /// </exception> internal TransferTransaction(NetworkType.Types networkType, int version, Deadline deadline, ulong fee, Address recipient, List <Mosaic> mosaics, IMessage message, string signature, PublicAccount signer, TransactionInfo transactionInfo) { if (mosaics == null) { throw new ArgumentNullException(nameof(mosaics)); } Address = recipient ?? throw new ArgumentNullException(nameof(recipient)); mosaics.Sort((c1, c2) => string.CompareOrdinal(c1.MosaicId.MosaicName, c2.MosaicId.MosaicName)); TransactionType = TransactionTypes.Types.Transfer; Version = version; Deadline = deadline; Message = message ?? EmptyMessage.Create(); Mosaics = mosaics; NetworkType = networkType; Fee = fee; Signature = signature; Signer = signer; TransactionInfo = transactionInfo; }
/// <summary> /// Initializes a new instance of the <see cref="RegisterNamespaceTransaction"/> class. /// </summary> /// <param name="type">The type.</param> /// <param name="version">The version.</param> /// <param name="deadline">The deadline.</param> /// <param name="fee">The fee.</param> /// <param name="namespaceType">Type of the namespace.</param> /// <param name="duration">The duration.</param> /// <param name="parentId">The parent identifier.</param> /// <param name="namespaceName">Name of the namespace.</param> /// <param name="signer">The signer.</param> /// <param name="signature">The signature.</param> /// <param name="transactionInfo">The transaction information.</param> /// <exception cref="ArgumentNullException">parentId</exception> /// <exception cref="InvalidEnumArgumentException">type</exception> /// <exception cref="ArgumentOutOfRangeException">namespaceType</exception> public RegisterNamespaceTransaction(NetworkType.Types type, int version, Deadline deadline, ulong fee, byte namespaceType, ulong duration, NamespaceId parentId, NamespaceId namespaceName, PublicAccount signer, string signature, TransactionInfo transactionInfo) { if (parentId == null && namespaceName == null) { throw new ArgumentNullException(nameof(parentId) + " and " + nameof(namespaceName) + " cannot both be null"); } if (!Enum.IsDefined(typeof(NetworkType.Types), type)) { throw new InvalidEnumArgumentException(nameof(type), (int)type, typeof(NetworkType.Types)); } if (namespaceType != 0 && namespaceType != 1) { throw new ArgumentOutOfRangeException(nameof(namespaceType)); } NetworkType = type; Version = version; Deadline = deadline; Fee = fee; NamespaceType = NamespaceTypes.GetRawValue(namespaceType); TransactionType = TransactionTypes.Types.RegisterNamespace; Duration = duration; ParentId = parentId; NamespaceId = namespaceName; Signer = signer; Signature = signature; TransactionInfo = transactionInfo; }
/// <summary> /// Initializes a new instance of the <see cref="SecretLockTransaction"/> class. /// </summary> /// <param name="networkType">Type of the network.</param> /// <param name="deadline">The deadline.</param> /// <param name="fee">The fee.</param> /// <param name="mosaic">The mosaic.</param> /// <param name="duration">The duration.</param> /// <param name="hashAlgo">The hash algo.</param> /// <param name="secret">The secret.</param> /// <param name="recipient">The recipient.</param> /// <param name="signature">The signature.</param> /// <param name="signer">The signer.</param> /// <param name="transactionInfo">The transaction information.</param> /// <exception cref="ArgumentException">invalid secret</exception> public SecretLockTransaction(NetworkType.Types networkType, int version, Deadline deadline, ulong fee, Mosaic mosaic, ulong duration, HashType.Types hashAlgo, string secret, Address recipient, string signature, PublicAccount signer, TransactionInfo transactionInfo) { if (hashAlgo.GetHashTypeValue() == 0 && secret.Length != 128) { throw new ArgumentException("invalid secret"); } Deadline = deadline; Version = version; Fee = fee; Duration = duration; Mosaic = mosaic; NetworkType = networkType; HashAlgo = hashAlgo; Secret = secret.FromHex(); Recipient = recipient; TransactionType = TransactionTypes.Types.SecretLock; Signer = signer; Signature = signature; TransactionInfo = transactionInfo; }
/// <summary> /// Constructor. /// </summary> public MosaicDefinitionTransaction(NetworkType.Types networkType, int version, Deadline deadline, ulong fee, string mosaicName, NamespaceId namespaceId, MosaicId mosaicId, MosaicProperties properties, string signature, PublicAccount signer, TransactionInfo transactionInfo) { Deadline = deadline; NetworkType = networkType; Version = version; Properties = properties; MosaicId = mosaicId; NamespaceId = namespaceId; MosaicName = mosaicName; Fee = fee; TransactionType = TransactionTypes.Types.MosaicDefinition; Signature = signature; Signer = signer; TransactionInfo = transactionInfo; }
/// <summary> /// Initializes a new instance of the <see cref="AggregateTransaction"/> class. /// </summary> /// <param name="networkType">Type of the network.</param> /// <param name="version">The transaction version.</param> /// <param name="transactionType">Type of the transaction.</param> /// <param name="deadline">The deadline.</param> /// <param name="fee">The fee.</param> /// <param name="innerTransactions">The inner transactions.</param> /// <param name="cosignatures">The cosignatures.</param> /// <param name="signature">The signature.</param> /// <param name="signer">The signer.</param> /// <param name="transactionInfo">The transaction information.</param> public AggregateTransaction(NetworkType.Types networkType, int version, TransactionTypes.Types transactionType, Deadline deadline, ulong fee, List <Transaction> innerTransactions, List <AggregateTransactionCosignature> cosignatures, string signature, PublicAccount signer, TransactionInfo transactionInfo) { InnerTransactions = innerTransactions; Cosignatures = cosignatures; Deadline = deadline; NetworkType = networkType; Fee = fee; TransactionType = transactionType; Version = version; Signature = signature; Signer = signer; TransactionInfo = transactionInfo; }
/// <summary> /// Initializes a new instance of the <see cref="SecretProofTransaction"/> class. /// </summary> /// <param name="deadline">The deadline.</param> /// <param name="hashAlgo">The hash algo.</param> /// <param name="secret">The secret.</param> /// <param name="proof">The proof.</param> /// <param name="networkType">Type of the network.</param> public SecretProofTransaction(NetworkType.Types networkType, int version, Deadline deadline, ulong fee, HashType.Types hashAlgo, string secret, string proof, string signature, PublicAccount signer, TransactionInfo transactionInfo) { Deadline = deadline; Version = version; Fee = fee; NetworkType = networkType; HashAlgo = hashAlgo; Secret = secret.FromHex(); Proof = proof.FromHex(); TransactionType = TransactionTypes.Types.SecretProof; Signer = signer; Signature = signature; TransactionInfo = transactionInfo; }