> For the complete documentation index, see [llms.txt](https://docs.clusters.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clusters.xyz/getting-started/javascript/registration.md).

# Registration

### getNameAvailability(names)

Check the availability of multiple cluster names

```javascript
const names = ["foobar", "namethatdoesntexist"];
const cluster = await clusters.getNameAvailability(names);
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
[
  {
    "name": "foobar",
    "isAvailable": false
  },
  {
    "name": "namethatdoesntexist",
    "isAvailable": true
  }
]
```

{% endtab %}
{% endtabs %}

***

### getRegistrationTransaction(names, sender, network)

Get the transaction data for registering a cluster so that a user can sign it

<table><thead><tr><th width="200">Name</th><th>Description</th></tr></thead><tbody><tr><td><code>network</code></td><td><pre><code>"1"
"10"
"56"
"137"
"8453"
"81457"
"17000"
"42161"
"43114"
"11155111"
"solana"
</code></pre></td></tr><tr><td><code>sender</code></td><td>The sender's address</td></tr><tr><td><code>names</code></td><td><code>{ name: string; amountWei?: string }[]</code><br>bidAmountWei <em>(optional)</em> is always in ETH and defaults to 0.01 ETH</td></tr><tr><td><code>referralClusterId</code><br><em>(optional)</em></td><td>The cluster id that is referring this registration</td></tr></tbody></table>

{% tabs %}
{% tab title="Ethereum" %}
**Example**

```javascript
const names = [
    { "name": "namethatdoesntexist1" },
    { "name": "namethatdoesntexist2" }
]
const sender = "0x0000000000000000000000000000000000000001";
const cluster = await clusters.getRegistrationTransactionEvm(names, sender, "1");
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "type": "evm",
  "gasToken": {
    "symbol": "ETH",
    "decimals": 18
  },
  "transactionData": {
    "to": "0x00000000000e1a99dddd5610111884278bdbda1d",
    "data": "0x40bee835000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000000000026e616d6574686174646f65736e746578697374310000000000000000000000006e616d6574686174646f65736e74657869737432000000000000000000000000",
    "value": "20000000000000000"
  },
  "registrationFee": "20000000000000000",
  "bridgeFee": "0",
  "names": [
    {
      "name": "namethatdoesntexist1",
      "amountWei": "10000000000000000",
      "amount": "10000000000000000"
    },
    {
      "name": "namethatdoesntexist2",
      "amountWei": "10000000000000000",
      "amount": "10000000000000000"
    }
  ]
}
```

{% endtab %}

{% tab title="500" %}
**Names unavailable**

```json
{
  "status": 500,
  "message": "1 or more names are unavailable"
}
```

**Bridge Failure**

```json
{
  "status": 500,
  "message": "lz quote failed. most likely caused by wallets having insufficient balances"
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="Solana" %}
**Example**

```javascript
const names = [
    { "name": "namethatdoesntexist1" },
    { "name": "namethatdoesntexist2" }
]
const sender = "1nc1nerator11111111111111111111111111111111";
const cluster = await clusters.getRegistrationTransactionSolana(names, sender);
```

**Response**

{% hint style="warning" %}
Notice when using solana, `transactionData` is an array of transactions instead of a single object on other networks. This is because only one name is supported per transaction at the moment when using solana.
{% endhint %}

{% tabs %}
{% tab title="200" %}

```json
{
  "type": "solana",
  "gasToken": {
    "symbol": "SOL"
  },
  "transactionData": [
    "gAEAAgQAM5ByjTQRYHm9yRG//wDb1E0uzcz3nKbhADjhAAAAAC/u4TnLEmhvVrNvLTdpdpVdJLegH99q7vYkM2iDi+hFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFSlNamSkhBk0k6HFg2jh8fDW13bySu4HkH6hAQQVEjZdvwyMMJHbJTNyHX/nuAnbanfNbTqWDof5avLEj3/dwAgICAAEMAgAAAFR9jwgAAAAAAwEAqgF7InR5cGUiOiJiaWQiLCJuYW1lIjoibmFtZXRoYXRkb2VzbnRleGlzdDEiLCJ3ZWkiOjEwMDAwMDAwMDAwMDAwMDAwLCJ0aW1lc3RhbXAiOjE3NDMwMDgwOTcsInNpZ25hdHVyZSI6ImViM2NhNjBkMDE5OWQwNWVkMzVkNGJjNGFhNTI1Yzk4MmVlYzI1M2I4MjIyMzE0MjBhNzNlZGQ1NzAzOWVmYmMifQA=",
    "gAEAAgQAM5ByjTQRYHm9yRG//wDb1E0uzcz3nKbhADjhAAAAAC/u4TnLEmhvVrNvLTdpdpVdJLegH99q7vYkM2iDi+hFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFSlNamSkhBk0k6HFg2jh8fDW13bySu4HkH6hAQQVEjZdvwyMMJHbJTNyHX/nuAnbanfNbTqWDof5avLEj3/dwAgICAAEMAgAAAFR9jwgAAAAAAwEAqgF7InR5cGUiOiJiaWQiLCJuYW1lIjoibmFtZXRoYXRkb2VzbnRleGlzdDIiLCJ3ZWkiOjEwMDAwMDAwMDAwMDAwMDAwLCJ0aW1lc3RhbXAiOjE3NDMwMDgwOTcsInNpZ25hdHVyZSI6ImViM2NhNjBkMDE5OWQwNWVkMzVkNGJjNGFhNTI1Yzk4MmVlYzI1M2I4MjIyMzE0MjBhNzNlZGQ1NzAzOWVmYmMifQA="
  ],
  "registrationFee": "287242920",
  "bridgeFee": "0",
  "names": [
    {
      "name": "namethatdoesntexist1",
      "amountWei": "10000000000000000",
      "amount": "143621460"
    },
    {
      "name": "namethatdoesntexist2",
      "amountWei": "10000000000000000",
      "amount": "143621460"
    }
  ]
}
```

{% endtab %}

{% tab title="500" %}
**Names unavailable**

```json
{
  "status": 500,
  "error": "names_unavailable",
  "message": "1 or more names are unavailable"
}
```

**Bridge Failure**

```json
{
  "status": 500,
  "error": "lz_quote_fail",
  "message": "lz quote failed. most likely caused by wallets having insufficient balances"
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

***

### getTransactionStatus(tx)

Get the status of a specific transaction hash.

{% hint style="info" %}
For now, if you registered more than one name in a transaction, it'll only give you the status of the first name.
{% endhint %}

**Example**

```javascript
const cluster = await clusters.getTransactionStatus("0xffea3b29c64016772b7d3194b3c3899a62191e654990b6e3393b410667102284");
```

**Response**

```typescript
type status = 'not_found' | 'pending' | 'invalid' | 'finalized'
```

{% tabs %}
{% tab title="200" %}

```json
{
  "tx": "0xffea3b29c64016772b7d3194b3c3899a62191e654990b6e3393b410667102284",
  "status": "finalized"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clusters.xyz/getting-started/javascript/registration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
