public class AggregateTransactionFactory extends TransactionFactory<AggregateTransaction>
AggregateTransaction
Modifier and Type | Field and Description |
---|---|
static int |
COSIGNATURE_SIZE |
Modifier and Type | Method and Description |
---|---|
AggregateTransactionFactory |
addCosignatures(AggregateTransactionCosignature... newCosignatures)
Adds cosignatures to the factory if they have been signed independently
|
AggregateTransaction |
build() |
AggregateTransactionFactory |
calculateMaxFeeForAggregate(long feeMultiplier,
int requiredCosignatures)
Set transaction maxFee using fee multiplier for only aggregate transactions.
|
AggregateTransactionFactory |
calculateMaxFeeFromMultiplier(long feeMultiplier)
Builder method used to to re-calculate the max fee based on the configured feeMultiplier.
|
static AggregateTransactionFactory |
create(TransactionType type,
NetworkType networkType,
Deadline deadline,
java.util.List<Transaction> innerTransactions,
java.util.List<AggregateTransactionCosignature> cosignatures)
Create an aggregate transaction factory that can be customized.
|
static AggregateTransactionFactory |
create(TransactionType type,
NetworkType networkType,
Deadline deadline,
java.lang.String transactionsHash,
java.util.List<Transaction> innerTransactions,
java.util.List<AggregateTransactionCosignature> cosignatures)
Create an aggregate transaction factory that can be customized.
|
static AggregateTransactionFactory |
createBonded(NetworkType networkType,
Deadline deadline,
java.util.List<Transaction> innerTransactions)
Create an aggregate bonded transaction factory that can be customized.
|
static AggregateTransactionFactory |
createComplete(NetworkType networkType,
Deadline deadline,
java.util.List<Transaction> innerTransactions)
Create an aggregate complete transaction factory that can be customized.
|
java.util.List<AggregateTransactionCosignature> |
getCosignatures()
Returns list of transaction cosigners signatures.
|
java.util.List<Transaction> |
getInnerTransactions()
Returns list of innerTransactions included in the aggregate transaction.
|
java.lang.String |
getTransactionsHash() |
deadline, getDeadline, getGroup, getMaxFee, getNetworkType, getProvidedSize, getSignature, getSigner, getSize, getTransactionInfo, getType, getVersion, group, maxFee, signature, signer, size, transactionInfo, version
public static final int COSIGNATURE_SIZE
public static AggregateTransactionFactory create(TransactionType type, NetworkType networkType, Deadline deadline, java.lang.String transactionsHash, java.util.List<Transaction> innerTransactions, java.util.List<AggregateTransactionCosignature> cosignatures)
type
- Transaction type.networkType
- Network type.deadline
- the deadlinetransactionsHash
- Aggregate hash of an aggregate's transactionsinnerTransactions
- List of inner transactions.cosignatures
- List of transaction cosigners signatures.public static AggregateTransactionFactory create(TransactionType type, NetworkType networkType, Deadline deadline, java.util.List<Transaction> innerTransactions, java.util.List<AggregateTransactionCosignature> cosignatures)
type
- Transaction type.networkType
- Network type.deadline
- The deadeline.innerTransactions
- List of inner transactions.cosignatures
- List of transaction cosigners signatures.public static AggregateTransactionFactory createComplete(NetworkType networkType, Deadline deadline, java.util.List<Transaction> innerTransactions)
networkType
- The network type.deadline
- The deadlineinnerTransactions
- The list of inner innerTransactions.public static AggregateTransactionFactory createBonded(NetworkType networkType, Deadline deadline, java.util.List<Transaction> innerTransactions)
networkType
- The network type.deadline
- deadline.innerTransactions
- The list of inner innerTransactions.public AggregateTransactionFactory calculateMaxFeeFromMultiplier(long feeMultiplier)
Because the factory creates an aggregate transcation, an IllegalArgumentException
is
raised. users should not use this method.
calculateMaxFeeFromMultiplier
in class TransactionFactory<AggregateTransaction>
feeMultiplier
- the fee multiplier greater than 1public AggregateTransactionFactory calculateMaxFeeForAggregate(long feeMultiplier, int requiredCosignatures)
Use this method once all the current transcation consignatures has been added to the factory.
feeMultiplier
- The fee multiplierrequiredCosignatures
- Required number of cosignaturespublic java.util.List<Transaction> getInnerTransactions()
public java.util.List<AggregateTransactionCosignature> getCosignatures()
public AggregateTransactionFactory addCosignatures(AggregateTransactionCosignature... newCosignatures)
newCosignatures
- new cosignatures to addpublic java.lang.String getTransactionsHash()
public AggregateTransaction build()
build
in class TransactionFactory<AggregateTransaction>