---
title: otxn_slot
description: Load the originating transaction into a slot
---
import { Tabs, TabItem } from '@astrojs/starlight/components';

### Behaviour

* Emplace the originating transaction into the slot specified or into a new slot if no slot is specified

### Definition

<Tabs>
<TabItem label="C">
```c
int64_t otxn_slot (
    uint32_t slot_no
);
```
</TabItem>

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



### Example

<Tabs>
<TabItem label="C">
```c
int64_t otxn_slot_no = 
		otxn_slot(0);
```
</TabItem>

<TabItem label="JavaScript">
```javascript
const otxn_slot_no = otxn_slot(0)
```
</TabItem>
</Tabs>



### Parameters

<Tabs>
<TabItem label="C">
| Name     | Type      | Description                                                                   |
| -------- | --------- | ----------------------------------------------------------------------------- |
| slot_no | uint32_t | The slot number to emplace into, or 0 if you wish to pick the next available. |
</TabItem>

<TabItem label="JavaScript">
| Name   | Type   | Description                 |
| ------ | ------ | --------------------------- |
| slotno | number | The slot number to look up. |
</TabItem>
</Tabs>



### Return Code

<Tabs>
<TabItem label="C">
| Type     | Description                                                                                                                                                                                                                                                                                        |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| int64_t | <p>The slot the otxn was placed in<br /><br /><code>INVALID_ARGUMENT</code><br />- specified slot number exceeds the largest possible slot number<br /><br /><code>NO_FREE_SLOTS</code><br />- the request could not granted because no free slot was avaialble to place the originating transaction into.</p> |
</TabItem>

<TabItem label="JavaScript">
| Type                   | Description                                                                                                                            |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| ErrorCode \| ByteArray | <p></p><p>Returns the value associated with the specified slot number as an array of numbers, or an ErrorCode if the lookup fails.</p> |
</TabItem>
</Tabs>

