예제 #1
0
        /// <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;
        }
예제 #2
0
        /// <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;
        }
예제 #4
0
 /// <summary>
 /// Creates the root namespace.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="deadline">The deadline.</param>
 /// <param name="namespaceName">Name of the namespace.</param>
 /// <param name="duration">The duration.</param>
 /// <returns>RegisterNamespaceTransaction.</returns>
 public static RegisterNamespaceTransaction CreateRootNamespace(NetworkType.Types type, Deadline deadline, string namespaceName, ulong duration)
 {
     return(new RegisterNamespaceTransaction(type, 3, deadline, 0, 0x00, duration, null, NamespaceId.Create(namespaceName)));
 }
예제 #5
0
 /// <summary>
 /// Creates the specified deadline.
 /// </summary>
 /// <param name="deadline">The deadline.</param>
 /// <param name="mosaic">The mosaic.</param>
 /// <param name="duration">The duration.</param>
 /// <param name="fee">The fee.</param>
 /// <param name="hashAlgo">The hash algo.</param>
 /// <param name="secret">The secret.</param>
 /// <param name="recipient">The recipient.</param>
 /// <param name="netowrkType">Type of the netowrk.</param>
 /// <returns>SecretLockTransaction.</returns>
 public static SecretLockTransaction Create(NetworkType.Types netowrkType, int version, Deadline deadline, ulong fee, Mosaic mosaic, ulong duration, HashType.Types hashAlgo, string secret, Address recipient)
 {
     return(new SecretLockTransaction(netowrkType, version, deadline, fee, mosaic, duration, hashAlgo, secret, recipient, null, null, null));
 }
예제 #6
0
 /// <summary>
 /// Static create an instance of <see cref="ModifyMultisigAccountTransaction" />
 /// </summary>
 /// <param name="deadline">The deadline.</param>
 /// <param name="minApprovalDelta">The minimum approval delta.</param>
 /// <param name="minRemovalDelta">The minimum removal delta.</param>
 /// <param name="modifications">The modifications to make.</param>
 /// <param name="networkType">The network type.</param>
 /// <returns><see cref="ModifyMultisigAccountTransaction" />.</returns>
 public static ModifyMultisigAccountTransaction Create(NetworkType.Types networkType, Deadline deadline, int minApprovalDelta, int minRemovalDelta, List <MultisigCosignatoryModification> modifications)
 {
     return(new ModifyMultisigAccountTransaction(networkType, 3, deadline, 0, minApprovalDelta, minRemovalDelta, modifications));
 }
예제 #7
0
 /// <summary>
 /// Creates the specified HashLockTransaction.
 /// </summary>
 /// <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="netowrkType">Type of the netowrk.</param>
 /// <returns><see cref="LockFundsTransaction"/>.</returns>
 public static LockFundsTransaction Create(NetworkType.Types netowrkType, Deadline deadline, ulong fee, Mosaic mosaic, ulong duration, SignedTransaction transaction)
 {
     return(new LockFundsTransaction(netowrkType, 3, deadline, fee, mosaic, duration, transaction));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MosaicSupplyChangeTransaction"/> class.
 /// </summary>
 /// <param name="mosaicId">The mosaic identifier.</param>
 /// <param name="delta">The delta.</param>
 /// <param name="direction">The direction.</param>
 /// <param name="version">The transaction version.</param>
 /// <param name="deadline">The deadline.</param>
 /// <param name="fee">The fee.</param>
 /// <param name="networkType">Type of the network.</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)
     : this(networkType, version, deadline, fee, mosaicId, direction, delta, null, null, null)
 {
 }
예제 #9
0
 /// <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;
 }
예제 #10
0
 /// <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>
 public AggregateTransaction(NetworkType.Types networkType, int version, TransactionTypes.Types transactionType, Deadline deadline, ulong fee, List <Transaction> innerTransactions, List <AggregateTransactionCosignature> cosignatures)
     : this(networkType, version, transactionType, deadline, fee, innerTransactions, cosignatures, null, null, null)
 {
 }
예제 #11
0
        /// <summary>
        /// Creates the bonded.
        /// </summary>
        /// <param name="networkType">Type of the network.</param>
        /// <param name="deadline">The deadline.</param>
        /// <param name="innerTransactions">The inner transactions.</param>
        /// <param name="cosignatures">The cosignatures.</param>
        /// <returns>AggregateTransaction.</returns>
        /// <exception cref="InvalidEnumArgumentException">networkType</exception>
        public static AggregateTransaction CreateBonded(NetworkType.Types networkType, Deadline deadline, List <Transaction> innerTransactions, List <AggregateTransactionCosignature> cosignatures)
        {
            if (!Enum.IsDefined(typeof(NetworkType.Types), networkType))
            {
                throw new InvalidEnumArgumentException(nameof(networkType), (int)networkType, typeof(NetworkType.Types));
            }


            return(new AggregateTransaction(networkType, 2, TransactionTypes.Types.AggregateBonded, deadline, 0, innerTransactions, cosignatures));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SecretProofTransaction"/> class.
 /// </summary>
 /// <param name="version">The transaction version</param>
 /// <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)
     : this(networkType, 3, deadline, fee, hashAlgo, secret, proof, null, null, null)
 {
 }
 /// <summary>
 /// Creates the specified <see cref="SecretProofTransaction"/>.
 /// </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="netowrkType">Type of the netowrk.</param>
 /// <returns><see cref="SecretProofTransaction"/></returns>
 public static SecretProofTransaction Create(NetworkType.Types netowrkType, Deadline deadline, ulong fee, HashType.Types hashAlgo, string secret, string proof)
 {
     return(new SecretProofTransaction(netowrkType, 3, deadline, fee, hashAlgo, secret, proof));
 }
예제 #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ModifyMultisigAccountTransaction"/> 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="minApprovalDelta">The minimum approval delta.</param>
 /// <param name="minRemovalDelta">The minimum removal delta.</param>
 /// <param name="modifications">The modifications.</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)
     : this(networkType, version, deadline, fee, minApprovalDelta, minRemovalDelta, modifications, null, null, null)
 {
 }
예제 #15
0
 /// <summary>
 /// Creates the sub namespace.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="deadline">The deadline.</param>
 /// <param name="parentId">The parent identifier.</param>
 /// <param name="namespaceName">Name of the namespace.</param>
 /// <returns>RegisterNamespaceTransaction.</returns>
 public static RegisterNamespaceTransaction CreateSubNamespace(NetworkType.Types type, Deadline deadline, string parentId, string namespaceName)
 {
     return(new RegisterNamespaceTransaction(type, 3, deadline, 0, 0x01, 0, NamespaceId.Create(parentId), NamespaceId.Create(namespaceName)));
 }
예제 #16
0
 /// <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>
 public RegisterNamespaceTransaction(NetworkType.Types type, int version, Deadline deadline, ulong fee, byte namespaceType, ulong duration, NamespaceId parentId, NamespaceId namespaceName)
     : this(type, version, deadline, fee, namespaceType, duration, parentId, namespaceName, null, null, null)
 {
 }
 public static MosaicDefinitionTransaction Create(NetworkType.Types networkType, Deadline deadline, string namespaceId, string mosaicName, MosaicProperties properties)
 {
     return(new MosaicDefinitionTransaction(
                networkType,
                3,
                deadline,
                0,
                mosaicName,
                NamespaceId.Create(namespaceId),
                MosaicId.CreateFromMosaicIdentifier(namespaceId + ":" + mosaicName),
                properties
                ));
 }
 /// <summary>
 /// Creates the specified MosaicSupplyChangeTransaction.
 /// </summary>
 /// <param name="mosaicId">The mosaic identifier.</param>
 /// <param name="delta">The delta.</param>
 /// <param name="direction">The direction.</param>
 /// <param name="deadline">The deadline.</param>
 /// <param name="networkType">Type of the network.</param>
 /// <returns>MosaicSupplyChangeTransaction.</returns>
 public static MosaicSupplyChangeTransaction Create(NetworkType.Types networkType, Deadline deadline, MosaicId mosaicId, MosaicSupplyType.Type direction, ulong delta)
 {
     return(new MosaicSupplyChangeTransaction(networkType, 3, deadline, 0, mosaicId, direction, delta));
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 public MosaicDefinitionTransaction(NetworkType.Types networkType, int version, Deadline deadline, ulong fee, string mosaicName, NamespaceId namespaceId, MosaicId mosaicId, MosaicProperties properties)
     : this(networkType, version, deadline, fee, mosaicName, namespaceId, mosaicId, properties, null, null, null)
 {
 }
예제 #20
0
 /// <summary>
 /// Statically creates an instance of <see cref="TransferTransaction" />.
 /// </summary>
 /// <param name="deadline">The deadline.</param>
 /// <param name="address">The address.</param>
 /// <param name="mosaics">The mosaics.</param>
 /// <param name="message">The message.</param>
 /// <param name="netowrkType">Type of the netowrk.</param>
 /// <param name="signer">The signer.</param>
 /// <returns><see cref="TransferTransaction" />.</returns>
 public static TransferTransaction Create(NetworkType.Types netowrkType, Deadline deadline, Address address, List <Mosaic> mosaics, IMessage message)
 {
     return(new TransferTransaction(netowrkType, 3, deadline, 0, address, mosaics, message));
 }
 /// <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;
 }
예제 #22
0
 /// <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>
 public LockFundsTransaction(NetworkType.Types networkType, int version, Deadline deadline, ulong fee, Mosaic mosaic, ulong duration, SignedTransaction transaction)
     : this(networkType, version, deadline, fee, mosaic, duration, transaction, null, null, null)
 {
 }
예제 #23
0
 /// <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>
 public SecretLockTransaction(NetworkType.Types networkType, int version, Deadline deadline, ulong fee, Mosaic mosaic, ulong duration, HashType.Types hashAlgo, string secret, Address recipient)
     : this(networkType, version, deadline, fee, mosaic, duration, hashAlgo, secret, recipient, null, null, null)
 {
 }