CronosID Module
CronosID module manages the conversion between CronosIDs and standard addresses.
To learn more about how to use the AI Agent SDK to interact with the wallet module, please visit AI Agent SDK CronosId Operations.
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.
Function Name
isCronosIdArguments
{string} name: The string to check for CronosId validity.Example Code
import { CronosId } from '@crypto.com/developer-platform-client'; const result = CronosId.isCronosId('example-cronos-id'); console.log(result);
Returns
{boolean}: True if the string is a valid CronosId, false otherwise.Example Return
example-boolean
6.2 Resolve CronosId
Resolves a CronosId to a wallet address.
Function Name
resolve_nameArguments
name (str): The CronosId name to resolve (CronosIds with the `.cro` suffix are supported, e.g. `xyz.cro`)Example Code
from crypto_com_developer_platform_client import CronosId address = CronosId.resolve_name('example-cronos-id') print(address)
Returns
Response containing the resolved blockchain address.Errors
ValueError: If the CronosId class is not initialized with a Client instance.Example Return
{'status': 'Success', 'data': 'example-address'}
Function Name
forwardResolveArguments
{string} cronosId: The CronosId to resolve.Example Code
import { CronosId } from '@crypto.com/developer-platform-client'; try { const address = wait CronosId.forwardResolve('alice.cro'); console.log(address); } catch(err) { console.log(err); }
Returns
{Promise<string>}: A promise that resolves to the resolved address.Errors
{Error}: Throws an error if the CronosId is not valid or if the resolution fails.Example Return
{ status: 'Success', data: 'example-address' }
6.3 Reverse Resolve Address
Resolves a wallet address to a CronosId if it has one.
Function Name
lookup_addressArguments
address (str): The blockchain address to lookupExample Code
from crypto_com_developer_platform_client import CronosId cronosId = CronosId.lookup_address('example-address') print(cronosId)
Returns
Response containing the CronosId name.Errors
ValueError: If the CronosId class is not initialized with a Client instance.Example Return
{'status': 'Success', 'data': 'example-cronos-id'}
Function Name
reverseResolveArguments
{string} address: The wallet address to resolve.Example Code
import { CronosId } from '@crypto.com/developer-platform-client'; try { const cronosId = await CronosId.reverseResolve('example-address'); console.log(cronosId); } catch(err) { console.log(err); }
Returns
{Promise<string>}: A promise that resolves to the resolved CronosId.Errors
{Error}: Throws an error if the address is not valid or if the resolution fails.Example Return
{ status: 'Success', data: 'example-cronos-id' }
Last updated
Was this helpful?