TransactionFactory⚓︎
- TransactionFactory
- Factory for creating NEM transactions.
Constructors⚓︎
new TransactionFactory()⚓︎
Creates a factory for the specified network.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
network |
Network |
NEM network. |
typeRuleOverrides? |
Map<string, Function> |
Type rule overrides. |
Returns⚓︎
TransactionFactory
Accessors⚓︎
ruleNames⚓︎
Get Signature⚓︎
- TransactionFactory.ruleNames
- Gets rule names with registered hints.
Returns⚓︎
string[]
Rule names with registered hints.
static⚓︎
Get Signature⚓︎
- TransactionFactory.static
- Gets class type.
Returns⚓︎
typeof default
Class type.
Methods⚓︎
create()⚓︎
- TransactionFactory.create
- Creates a transaction from a transaction descriptor.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
transactionDescriptor |
object |
Transaction descriptor. |
autosort? |
boolean |
When set (default), descriptor arrays requiring ordering will be automatically sorted. When unset, descriptor arrays will be presumed to be already sorted. |
Returns⚓︎
Newly created transaction.
attachSignature()⚓︎
- TransactionFactory.attachSignature
- Attaches a signature to a transaction.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
transaction |
Transaction |
Transaction object. |
signature |
Signature |
Signature to attach. |
Returns⚓︎
string
JSON transaction payload.
deserialize()⚓︎
- TransactionFactory.deserialize
- Deserializes a transaction from a binary payload.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
payload |
Uint8Array |
Binary payload. |
Returns⚓︎
Deserialized transaction.
lookupTransactionName()⚓︎
- TransactionFactory.lookupTransactionName
- Looks up the friendly name for the specified transaction.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
transactionType |
TransactionType |
Transaction type. |
transactionVersion |
number |
Transaction version. |
Returns⚓︎
string
Transaction friendly name.
toJson()⚓︎
- TransactionFactory.toJson
- Generates a JSON representation of transaction that can be sent to a node.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
transaction |
Transaction |
Transaction object. |
Returns⚓︎
string
JSON transaction payload.
toNonVerifiableTransaction()⚓︎
- TransactionFactory.toNonVerifiableTransaction
- Converts a transaction to a non-verifiable transaction.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
transaction |
| Transaction | NonVerifiableTransaction |
Transaction object. |
Returns⚓︎
Non-verifiable transaction object.