---
title: xpop_slot
description: Serialize and output the xpop transaction blob and metadata
---
import { Tabs, TabItem } from '@astrojs/starlight/components';

### Behaviour

* Locate the xpop blob on the `Import` transaction
* Emplace the located tx and meta objects into the slots specified

### Definition

<Tabs>
<TabItem label="C">
```c
int64_t xpop_slot (
    uint32_t slot_no_tx,
    uint32_t slot_no_meta
);
```


</TabItem>

<TabItem label="JavaScript">
```javascript
function xpop_slot(slotno_tx: number, slotno_meta: number): ErrorCode | number
```
</TabItem>
</Tabs>



### Example

<Tabs>
<TabItem label="C">
```c
int64_t bytes_written = 
    xpop_slot(1, 2); // assumes a txn is slotted into slot=1 meta is slotted into slot=2
```
</TabItem>

<TabItem label="JavaScript">
```javascript
const bytes_written = xpop_slot(1, 2)
```
</TabItem>
</Tabs>



### Parameters

<Tabs>
<TabItem label="C">
| Name           | Type      | Description                                    |
| -------------- | --------- | ---------------------------------------------- |
| slot_no_tx   | uint32_t | The slot number to emplace the tx blob into.   |
| slot_no_meta | uin32_t  | The slot number to emplace the meta blob into. |
</TabItem>

<TabItem label="JavaScript">
| Name         | Type   | Description                         |
| ------------ | ------ | ----------------------------------- |
| slotno_tx   | number | The transaction slot number to pop. |
| slotno_meta | number | The metadata slot number to pop.    |
</TabItem>
</Tabs>



### Return Code

<Tabs>
<TabItem label="C">
| Type     | Description                                                                                                                                                                                                                                                |
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| int64_t | <p><code>PREREQUISITE_NOT_MET</code><br /><br />- The originating tx type was not <code>Import</code>.<br /><br /><code>NO_FREE_SLOTS</code><br /><br />- The API would require a new slot to be allocated but the Hook is already at the maximum number of slots.</p> |
</TabItem>

<TabItem label="JavaScript">
| Type                | Description                                               |
| ------------------- | --------------------------------------------------------- |
| number or ErrorCode | Returns an error code or the result of the pop operation. |
</TabItem>
</Tabs>

