> For the complete documentation index, see [llms.txt](https://docs.xcash.foundation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xcash.foundation/api/namespace.md).

# Namespace

Note zachys (atomic units) are 10^6 in X-Cash

## Stats <a href="#stats" id="stats"></a>

This method gets the stats

**URL**: <https://api.xcash.foundation/v1/xcash/namespace/unauthorized/stats/>

**Method**: GET

**Inputs**: *None*.

**Results**:

* *totalNamesRegisteredOrRenewed* - unsigned int; The total registered or renewed names the delegates have processed.
* *totalVolume* - unsigned long long; The total xcash paid to delegates using the namespace protocol in zachys (atomic units).

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/namespace/unauthorized/stats/ -H 'Accept: application/json'
{
  "totalNamesRegisteredOrRenewed": 100,
  "totalVolume": 10000000
}
```

## Registered Delegates <a href="#registered-delegates" id="registered-delegates"></a>

This method gets all of the registered delegates

**URL**: <https://api.xcash.foundation/v1/xcash/namespace/unauthorized/delegates/registered>

**Method**: GET

**Inputs**: *None*.

**Results**:

Array of objects with the following structure:

* *delegateName* - string; The delegate name.
* *amount* - unsigned long long; The amount to register or renew a name, using this delegate in zachys (atomic units).

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/namespace/unauthorized/delegates/registered/ -H 'Accept: application/json'
[
  {
    "delegateName": "us1_xcash_foundation",
    "amount": 100000000
  },
  {
    "delegateName": "europe1_xcash_foundation",
    "amount": 100000000
  }
]
```

## Delegates <a href="#delegates" id="delegates"></a>

This method gets the delegates data

**URL**: <https://api.xcash.foundation/v1/xcash/namespace/unauthorized/delegates/{delegateName}>

**Method**: GET

**Resources**:

* *delegateName* - **Required** - The delegates name.

**Results**:

* *delegateName* - string; The delegate name.
* *publicAddress* - string; The public address.
* *amount* - unsigned long long; The amount that a delegate charges to register or renew a name in zachys (atomic units).
* *totalNamesRegisteredOrRenewed* - unsigned int; The total registered or renewed names that the delegate has processed.
* *totalVolume* - unsigned long long; The total xcash paid to delegates using the namespace protocol in zachys (atomic units).

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/namespace/unauthorized/delegates/us1_xcash_foundation/ -H 'Accept: application/json'
{
  "delegateName": "us1_xcash_foundation",
  "publicAddress": "XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf",
  "amount": 100000000,
  "totalNamesRegisteredOrRenewed": 100,
  "totalVolume": 10000000
}
```

## Names <a href="#names" id="names"></a>

This method gets the names data for a specific name

**URL**: <https://api.xcash.foundation/v1/xcash/namespace/unauthorized/names/{name}>

**Method**: GET

**Resources**:

* *name* - **Required** - The namespace.

**Results**:

* *address* - string; The address.
* *saddress* - string; The saddress.
* *paddress* - string; The paddress.
* *expires* - unsigned int; The time the domain expires.
* *delegateName* - string; The delegate that registered the namespace.
* *delegateAmount* - unsigned long long; The total xcash paid to delegates to register or renew the namespace in zachys (atomic units).

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/namespace/unauthorized/names/xcash/ -H 'Accept: application/json'
{
  "address": "XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf",
  "saddress": "XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf",
  "paddress": "XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf",
  "expires": 1654228489,
  "delegateName": "us1_xcash_foundation",
  "delegateAmount": 100000000
}
```

## Name Status <a href="#name-status" id="name-status"></a>

This method checks if a name can be purchased,either by it has not been registered yet, or it has expired

**URL**: <https://api.xcash.foundation/v1/xcash/namespace/unauthorized/names/status/{name}>

**Method**: GET

**Resources**:

* *name* - **Required** - The namespace.

**Results**:

* *status* - bool; True if one can register the name, otherwise false.

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/namespace/unauthorized/names/status/xcash/ -H 'Accept: application/json'
{
  "status": false
}
```

## Address Status <a href="#address-status" id="address-status"></a>

This method gets the address status

**URL**: <https://api.xcash.foundation/v1/xcash/namespace/unauthorized/addresses/status/{address}>

**Method**: GET

**Resources**:

* *address* - **Required** - The address.

**Results**:

* *status* - string; "not registered|address|saddress|paddress"

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/namespace/unauthorized/addresses/status/XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf/ -H 'Accept: application/json'
{
  "status": "address"
}
```

## Name To Address <a href="#name-to-address" id="name-to-address"></a>

This method converts a name to an address

**URL**: <https://api.xcash.foundation/v1/xcash/namespace/unauthorized/names/convert/{name}>

**Method**: GET

**Resources**:

* *name* - **Required** - The namespace

**Results**:

* *address* - string; The address.
* *saddress* - string; The saddress.
* *paddress* - string; The paddress.

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/namespace/unauthorized/names/convert/xcash/ -H 'Accept: application/json'
{
  "address": "XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf",
  "saddress": "XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf",
  "paddress": "XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf"
}
```

## Address To Name <a href="#address-to-name" id="address-to-name"></a>

This method converts an address to a name and extension

**URL**: <https://api.xcash.foundation/v1/xcash/namespace/unauthorized/addresses/convert/{address}>

**Method**: GET

**Resources**:

* *address* - **Required** - The address.

**Results**:

* *name* - string; The name.
* *extension* - string; The extension.

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/namespace/unauthorized/addresses/convert/XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf/ -H 'Accept: application/json'
{
  "name": "xcash",
  "extension": ".pxcash"
}
```
