Emitted Txn
(Added by the [Hooks amendment][].)
An EmittedTxn
object describes a transaction that has been emitted by a hook. The object contains all the fields of the original transaction, along with additional details about the emission.
Example JSON
Fields
An EmittedTxn
object has the following fields:
Field | JSON Type | [Internal Type][] | Required? | Description |
---|---|---|---|---|
| Object | Object | Yes | Contains details about the emission. This includes the generation of the emission, the burden of the emission, the callback address, the hash of the hook that emitted the transaction, the nonce of the emission, and the ID of the parent transaction. |
| String | UInt16 | Yes | The type of the transaction that was emitted. |
| String | Account | Yes | The account that emitted the transaction. |
| String | Amount | Yes | The fee paid for the transaction. |
| Number | UInt32 | Yes | The sequence number of the transaction. |
| String | Blob | Yes | The public key that signs the transaction. |
The EmittedTxn
object also contains all the fields of the original transaction.
EmitDetails Fields
An EmitDetails
object has the following fields:
Field | JSON Type | [Internal Type][] | Required? | Description |
---|---|---|---|---|
| Number | UInt32 | Yes | This field keeps track of a chain of emitted transactions that in turn cause other transactions to be emitted. |
| String | UInt64 | Yes | This field is a heuristic for detecting forkbombs. Fees are based on burden and will increase exponentially when a chain reaction is started to prevent the network becoming overun by self-reinforcing emitted transactions. |
| String | Hash256 | Yes | The Hook Execution that emitted the transaction is connected to the Originating Transaction. Therefore this field is always required for the efficient tracing of behaviour. |
| String | Hash256 | Yes | Emitted Transactions would be identical with the same fields and therefore have identical transaction hashes if a nonce were not used. However every node on the network needs to agree on the nonce, so a special Hook API to produce a deterministic nonce is made available. |
| String | AccountID | No | This field is used by xahld when it needs to intitate a callback, such that it knows which Hook and account to initate the callback on. Callbacks happen when an emitted transaction is accepted into a ledger. |
| String | Hash256 | Yes | The SHA512H of the Hook at the time it was executed. |
Last updated