Class NemTransactionFactory
- TransactionFactory
Factory for creating NEM transactions, wrapping the generated
TransactionFactorywith aRuleBasedTransactionFactorycarrying NEM specific rules.
-
Constructor Summary
ConstructorsConstructorDescriptionNemTransactionFactory(Network network) Creates a factory for the specified network.Creates a factory for the specified network with per-type rule overrides. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringattachSignature(Transaction transaction, CryptoTypes.Signature signature) Attaches a signature to a transaction.Creates a transaction from a transaction descriptor.Creates a transaction from a transaction descriptor.static Transactiondeserialize(byte[] payload) Deserializes a transaction from a binary payload.static Transactiondeserialize(ByteBuffer buffer) Deserializes a transaction from a byte buffer.Gets rule names with registered hints.static StringlookupTransactionName(TransactionType transactionType, int transactionVersion) Looks up the friendly name for the specified transaction.static StringtoJson(Transaction transaction) Generates a JSON representation of transaction that can be sent to a node.static NonVerifiableTransactiontoNonVerifiableTransaction(Object transaction) Converts a transaction to a non-verifiable transaction; already non-verifiable inputs are returned as-is (idempotent).
-
Constructor Details
-
NemTransactionFactory
Creates a factory for the specified network.- Parameters:
network- NEM network.
-
NemTransactionFactory
public NemTransactionFactory(Network network, Map<String, Function<Object, Object>> typeRuleOverrides) Creates a factory for the specified network with per-type rule overrides.- Parameters:
network- NEM network.typeRuleOverrides- Per-rule parser overrides keyed by rule name. May benull.
-
-
Method Details
-
getRuleNames
- TransactionFactory.getRuleNames
Gets rule names with registered hints.
- Returns:
Rule names with registered hints.
-
lookupTransactionName
- TransactionFactory.lookupTransactionName
Looks up the friendly name for the specified transaction.
- Parameters:
transactionType- Transaction type.transactionVersion- Transaction version.- Returns:
Transaction friendly name (e.g.
"transfer_transaction_v1").
-
create
- TransactionFactory.create
Creates a transaction from a transaction descriptor.
- Parameters:
transactionDescriptor- Transaction descriptor.- Returns:
Newly created transaction.
-
create
- TransactionFactory.create
Creates a transaction from a transaction descriptor.
- Parameters:
transactionDescriptor- Transaction descriptor.autosort- Whentrue, descriptor arrays requiring ordering will be automatically sorted.- Returns:
Newly created transaction.
-
deserialize
- TransactionFactory.deserialize
Deserializes a transaction from a binary payload.
- Parameters:
payload- Binary payload.- Returns:
Deserialized transaction.
-
deserialize
- TransactionFactory.deserialize
Deserializes a transaction from a byte buffer.
- Parameters:
buffer- Binary payload buffer.- Returns:
Deserialized transaction.
-
toNonVerifiableTransaction
- TransactionFactory.toNonVerifiableTransaction
Converts a transaction to a non-verifiable transaction; already non-verifiable inputs are returned as-is (idempotent).
- Parameters:
transaction- Transaction object.- Returns:
Non-verifiable transaction object.
-
attachSignature
- TransactionFactory.attachSignature
Attaches a signature to a transaction.
- Parameters:
transaction- Transaction object.signature- Signature to attach.- Returns:
JSON transaction payload.
-
toJson
- TransactionFactory.toJson
Generates a JSON representation of transaction that can be sent to a node.
- Parameters:
transaction- Transaction object.- Returns:
JSON transaction payload.
-