CronosID Operations

The AI Agent SDK offers powerful CronosID-related features, allowing developers to map CronosIDs and associated blockchain addresses.

These features enhance user-friendliness and accessibility by enabling seamless name-to-address and address-to-name resolutions on Cronos Chains.

6.1 Resolve CronosId name

Resolve a given CronosId name to its associated blockchain address using the Crypto.com developer platform.

Example Query

Query: "Resolve CronosId name <example-cronos-id>"

Example Response

The CronosId name <example-cronos-id> has been successfully resolved to the blockchain address: <example-address>.

Query Arguments

name (str): The CronosId name to resolve (e.g., "xyz.cro").

Query Returns

str: A formatted string containing the resolved blockchain address.

Example Code

from crypto_com_agent_client import Agent

agent = Agent.init(
    llm_config={
        "provider": "OpenAI",
        "model": "gpt-4",
        "provider-api-key": "sk-proj-example-key",
    },
    blockchain_config={
         "chainId": "chain-id",
         "explorer-api-key": "your-api-key",
         "private-key": "your-private-key",
         "sso-wallet-url": "your-sso-wallet-url",
    },
)
response = agent.interact("Resolve CronosId name <example-cronos-id>")
print(response)

6.2 Lookup CronosId address

Lookup a given blockchain address to find the associated CronosId name from the Crypto.com developer platform.

Example Query

Query: "Lookup CronosId for <example-address>"

Example Response

The CronosId for the address `<example-address>` is **<example-cronos-id>**

Query Arguments

address (str): The blockchain address to lookup.

Query Returns

str: A formatted string containing the CronosId name.

Example Code

from crypto_com_agent_client import Agent

agent = Agent.init(
    llm_config={
        "provider": "OpenAI",
        "model": "gpt-4",
        "provider-api-key": "sk-proj-example-key",
    },
    blockchain_config={
         "chainId": "chain-id",
         "explorer-api-key": "your-api-key",
         "private-key": "your-private-key",
         "sso-wallet-url": "your-sso-wallet-url",
    },
)
response = agent.interact("Lookup CronosId for <example-address>")
print(response)

Last updated

Was this helpful?