internal TokenBurnTransactionBody(Hashgraph.Address token, ulong amount) : this() { if (amount < 1) { throw new ArgumentOutOfRangeException(nameof(amount), "The token amount must be greater than zero."); } Token = new TokenID(token); Amount = amount; }
internal ConsensusSubmitMessageTransactionBody(Hashgraph.Address topic, ReadOnlyMemory <byte> message, bool isSegment, Hashgraph.TxId?parentTx, int segmentIndex, int segmentTotalCount) : this() { if (message.IsEmpty) { throw new ArgumentOutOfRangeException(nameof(message), "Topic Message can not be empty."); } TopicID = new TopicID(topic); Message = ByteString.CopyFrom(message.Span); ChunkInfo = isSegment ? createChunkInfo(parentTx, segmentIndex, segmentTotalCount) : null;
internal TokenMintTransactionBody(Hashgraph.Address token, IEnumerable <ReadOnlyMemory <byte> > metadata) : this() { if (metadata is null) { throw new ArgumentOutOfRangeException(nameof(metadata), "Metadata for creating assets was not provided."); } Token = new TokenID(token); Metadata.AddRange(metadata.Select(m => ByteString.CopyFrom(m.Span))); }
internal TokenWipeAccountTransactionBody(Hashgraph.Address token, AddressOrAlias address, ulong amount) : this() { if (amount == 0) { throw new ArgumentOutOfRangeException(nameof(amount), "The amount to confiscate must be greater than zero."); } Token = new TokenID(token); Account = new AccountID(address); Amount = amount; }
internal TokenBurnTransactionBody(Hashgraph.Address asset, IEnumerable <long> serialNumbers) : this() { if (serialNumbers is null) { throw new ArgumentOutOfRangeException(nameof(serialNumbers), "The list of serial numbers must not be null."); } Token = new TokenID(asset); SerialNumbers.AddRange(serialNumbers); if (SerialNumbers.Count == 0) { throw new ArgumentOutOfRangeException(nameof(serialNumbers), "The list of serial numbers must not be empty."); } }
internal ScheduleSignTransactionBody(Hashgraph.Address pending) : this() { ScheduleID = new ScheduleID(pending); }
internal TokenDissociateTransactionBody(IEnumerable <Hashgraph.Address> tokens, Hashgraph.Address account) : this() { if (tokens is null) { throw new ArgumentNullException(nameof(tokens), "The list of tokens cannot be null."); } Tokens.AddRange(tokens.Select(token => { if (token.IsNullOrNone()) { throw new ArgumentOutOfRangeException(nameof(tokens), "The list of tokens cannot contain an empty or null address."); } return(new TokenID(token)); })); if (Tokens.Count == 0) { throw new ArgumentOutOfRangeException(nameof(tokens), "The list of tokens cannot be empty."); } Account = new AccountID(account); }