---
title: etxn_details
description: Produce an sfEmitDetails suitable for a soon-to-be emitted transaction
---
import { Tabs, TabItem, LinkButton } from '@astrojs/starlight/components';

### Concepts

<LinkButton href="/docs/hooks/concepts/emitted-transactions">Emitted Transactions</LinkButton>

### Behaviour

<Tabs>
<TabItem label="C">
* Generate and write a 105 byte sfEmitDetails object into the `write_ptr` if cbak is not defined
* Generate and write a 127 byte sfEmitDetails object into the `write_ptr` if cbak is defined.
</TabItem>

<TabItem label="JavaScript">
* This function provides detailed information about the transaction.
* Returns an ErrorCode if there is an error, or an array of transaction details on success.
</TabItem>
</Tabs>



### Definition

<Tabs>
<TabItem label="C">
```c
int64_t etxn_details (
    uint32_t write_ptr,
    uint32_t write_len
);
```


</TabItem>

<TabItem label="JavaScript">
```javascript
function etxn_details(): ErrorCode | ByteArray
```
</TabItem>
</Tabs>



### Example

<Tabs>
<TabItem label="C">
```c
uint8_t emitdet[105];
int64_t result =
    etxn_details(emitdet, 105);
if (result != 105)
    rollback("Etxndetails failed.", 19, 1);
```


</TabItem>

<TabItem label="JavaScript">
```javascript
const emitdet = etxn_details()
if (typeof emitdet === 'string || emitdet.length != 105)
    rollback("Etxndetails failed.", 1)
```
</TabItem>
</Tabs>



### Parameters

<Tabs>
<TabItem label="C">
| Name       | Type      | Description                                              |
| ---------- | --------- | -------------------------------------------------------- |
| write_ptr | uint32_t | Pointer to the buffer receiving the sfEmitDetails record |
| write_len | uint32_t | Length of the buffer                                     |


</TabItem>

<TabItem label="JavaScript">
No parameters for JavaScript
</TabItem>
</Tabs>



### Return Code

<Tabs>
<TabItem label="C">
| Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| -------- |   |
| int64_t | <p>The number of bytes written.<br /><br />If negative, an error:<br /><code>OUT_OF_BOUNDS</code><br />- pointers/lengths specified outside of hook memory.<br /><br /><code>TOO_SMALL</code><br />- Buffer isn't large enough to receive record<br /><br /><code>PREREQUISITE_NOT_MET</code><br />- The hook failed to call <code>etxn_reserve(n)</code> first<br /><br /><code>FEE_TOO_LARGE</code><br />- The burden would be too high for the network to allow.<br /><br /><code>INTERNAL_ERROR</code><br />- A generic error in which rippled had trouble generating the required field.</p> |


</TabItem>

<TabItem label="JavaScript">


| Type                   | Description                                                                       |
| ---------------------- | --------------------------------------------------------------------------------- |
| ErrorCode | ByteArray | An ErrorCode if there is an error, or an array of transaction details on success. |
</TabItem>
</Tabs>

