# CronosID Module

CronosID module manages the conversion between CronosIDs and standard addresses.

{% hint style="info" %}
Note: CronosId is not supported on Cronos ZK EVM Mainnet.
{% endhint %}

To learn more about how to use the AI Agent SDK to interact with the wallet module, please visit [AI Agent SDK CronosId Operations](/crypto.com-ai-agent-sdk/core-concepts-overview/blockchain-functions/cronosid-operations.md).

#### 6.1 Is CronosId

Checks if a given string is a valid CronosId, which is a string ending with '.cro' and not empty. Example: 'alice.cro' is a valid CronosId, but 'alice' is not.

{% tabs %}
{% tab title="TypeScript" %}
Function Name

```typescript
isCronosId
```

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

* Arguments

  ```typescript
  {string} name: The string to check for CronosId validity.
  ```
* Example Code

  ```typescript
  import { CronosId } from '@crypto.com/developer-platform-client';

  const result = CronosId.isCronosId('example-cronos-id');
  console.log(result);
  ```

{% endtab %}

{% tab title="Response" %}

* Returns

  ```typescript
  {boolean}: True if the string is a valid CronosId, false otherwise.
  ```
* Example Return

  ```typescript
  example-boolean
  ```

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

#### 6.2 Resolve CronosId

Resolves a CronosId to a wallet address.

{% tabs %}
{% tab title="Python" %}
Function Name

```python
resolve_name
```

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

* Arguments

  ```python
  name (str): The CronosId name to resolve (CronosIds with the `.cro` suffix are supported, e.g. `xyz.cro`)
  ```
* Example Code

  ```python
  from crypto_com_developer_platform_client import CronosId

  address = CronosId.resolve_name('example-cronos-id')
  print(address)
  ```

{% endtab %}

{% tab title="Response" %}

* Returns

  ```python
  Response containing the resolved blockchain address.
  ```
* Errors

  ```python
  ValueError: If the CronosId class is not initialized with a Client instance.
  ```
* Example Return

  ```python
  {'status': 'Success', 'data': 'example-address'}
  ```

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

{% tab title="TypeScript" %}
Function Name

```typescript
forwardResolve
```

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

* Arguments

  ```typescript
  {string} cronosId: The CronosId to resolve.
  ```
* Example Code

  ```typescript
  import { CronosId } from '@crypto.com/developer-platform-client';

  try {
    const address = wait CronosId.forwardResolve('alice.cro');
    console.log(address);
  }
    catch(err) {
    console.log(err);
  }
  ```

{% endtab %}

{% tab title="Response" %}

* Returns

  ```typescript
  {Promise<string>}: A promise that resolves to the resolved address.
  ```
* Errors

  ```typescript
  {Error}: Throws an error if the CronosId is not valid or if the resolution fails.
  ```
* Example Return

  ```typescript
  {
    status: 'Success',
    data: 'example-address'
  }
  ```

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

#### 6.3 Reverse Resolve Address

Resolves a wallet address to a CronosId if it has one.

{% tabs %}
{% tab title="Python" %}
Function Name

```python
lookup_address
```

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

* Arguments

  ```python
  address (str): The blockchain address to lookup
  ```
* Example Code

  ```python
  from crypto_com_developer_platform_client import CronosId

  cronosId = CronosId.lookup_address('example-address')
  print(cronosId)
  ```

{% endtab %}

{% tab title="Response" %}

* Returns

  ```python
  Response containing the CronosId name.
  ```
* Errors

  ```python
  ValueError: If the CronosId class is not initialized with a Client instance.
  ```
* Example Return

  ```python
  {'status': 'Success', 'data': 'example-cronos-id'}
  ```

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

{% tab title="TypeScript" %}
Function Name

```typescript
reverseResolve
```

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

* Arguments

  ```typescript
  {string} address: The wallet address to resolve.
  ```
* Example Code

  ```typescript
  import { CronosId } from '@crypto.com/developer-platform-client';

  try {
    const cronosId = await CronosId.reverseResolve('example-address');
    console.log(cronosId);
  }
    catch(err) {
    console.log(err);
  }
  ```

{% endtab %}

{% tab title="Response" %}

* Returns

  ```typescript
  {Promise<string>}: A promise that resolves to the resolved CronosId.
  ```
* Errors

  ```typescript
  {Error}: Throws an error if the address is not valid or if the resolution fails.
  ```
* Example Return

  ```typescript
  {
    status: 'Success',
    data: 'example-cronos-id'
  }
  ```

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


---

# Agent Instructions: 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:

```
GET https://ai-agent-sdk-docs.crypto.com/crypto.com-developer-platform/on-chain-developer-platform-client-sdk/cronosid-module.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
