Package org.symbol.sdk.symbol
Class SymbolTransactionFactory
java.lang.Object
org.symbol.sdk.symbol.SymbolTransactionFactory
- SymbolTransactionFactory
- Factory for creating Symbol transactions. Wraps the catbuffer-generated
TransactionFactory.createByName(String)with aRuleBasedTransactionFactorypreconfigured with Symbol specific parsing rules.
-
Constructor Summary
ConstructorsConstructorDescriptionSymbolTransactionFactory(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.createEmbedded(Map<String, Object> transactionDescriptor) Creates an embedded transaction from a transaction descriptor.createEmbedded(Map<String, Object> transactionDescriptor, boolean autosort) Creates an embedded 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.static EmbeddedTransactiondeserializeEmbedded(byte[] payload) Deserializes an embedded transaction from a binary payload.static EmbeddedTransactiondeserializeEmbedded(ByteBuffer buffer) Deserializes an embedded 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.
-
Constructor Details
-
SymbolTransactionFactory
Creates a factory for the specified network.- Parameters:
network- Symbol network.
-
SymbolTransactionFactory
public SymbolTransactionFactory(Network network, Map<String, Function<Object, Object>> typeRuleOverrides) Creates a factory for the specified network with per-type rule overrides.- Parameters:
network- Symbol network.typeRuleOverrides- Per-rule parser overrides keyed by rule name. May benull.
-
-
Method Details
-
getRuleNames
- SymbolTransactionFactory.getRuleNames
- Gets rule names with registered hints.
- Returns:
- Rule names with registered hints.
-
lookupTransactionName
- SymbolTransactionFactory.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
- SymbolTransactionFactory.create
- Creates a transaction from a transaction descriptor.
- Parameters:
transactionDescriptor- Transaction descriptor.- Returns:
- Newly created transaction.
-
create
- SymbolTransactionFactory.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.
-
createEmbedded
- SymbolTransactionFactory.createEmbedded
- Creates an embedded transaction from a transaction descriptor.
- Parameters:
transactionDescriptor- Transaction descriptor.- Returns:
- Newly created embedded transaction.
-
createEmbedded
public EmbeddedTransaction createEmbedded(Map<String, Object> transactionDescriptor, boolean autosort) - SymbolTransactionFactory.createEmbedded
- Creates an embedded transaction from a transaction descriptor.
- Parameters:
transactionDescriptor- Transaction descriptor.autosort- Whentrue, descriptor arrays requiring ordering will be automatically sorted.- Returns:
- Newly created embedded transaction.
-
deserialize
- SymbolTransactionFactory.deserialize
- Deserializes a transaction from a binary payload.
- Parameters:
payload- Binary payload.- Returns:
- Deserialized transaction.
-
deserialize
- SymbolTransactionFactory.deserialize
- Deserializes a transaction from a byte buffer.
- Parameters:
buffer- Binary payload buffer.- Returns:
- Deserialized transaction.
-
deserializeEmbedded
- SymbolTransactionFactory.deserializeEmbedded
- Deserializes an embedded transaction from a binary payload.
- Parameters:
payload- Binary payload.- Returns:
- Deserialized embedded transaction.
-
deserializeEmbedded
- SymbolTransactionFactory.deserializeEmbedded
- Deserializes an embedded transaction from a byte buffer.
- Parameters:
buffer- Binary payload buffer.- Returns:
- Deserialized embedded transaction.
-
attachSignature
- SymbolTransactionFactory.attachSignature
- Attaches a signature to a transaction.
- Parameters:
transaction- Transaction object.signature- Signature to attach.- Returns:
- JSON transaction payload.
-
toJson
- SymbolTransactionFactory.toJson
- Generates a JSON representation of transaction that can be sent to a node.
- Parameters:
transaction- Transaction object.- Returns:
- JSON transaction payload.
-