Functions and Example Queries of AI agent services
Introduction
This page provides detailed information on various on-chain functions and example queries available through the Crypto.com AI Agent SDK. Each function is accompanied by a sample query and explanation of the response format, offering developers guidance on how to interact with Cronos Chains using the AI agent services.
1. Transfer native token
Sends a transaction from one address to another.
Example Query
query: "Send 1 ZKCRO to 0xRecipientAddress"Function Name: SendTransaction
Function Argument:
{ "to": "0xRecipientAddress", "amount": 1, "symbol": "ZKCRO" }
{
"status": "Success",
"action": "SendTransaction",
"message": "Signature url created successfully. Please sign the transaction on this link",
"data": {
"magicLink": "https://{provider}/sign-transaction/{transactionId}?token={token}"
}
}2. Obtain on-chain balance
Fetches the balance of multiple wallet addresses.
Example Query
Function Name: GetBalance
Function Argument:
3. Get Latest Block
Fetches the latest block information.
Example Query
Function Name: GetLatestBlock
Function Argument:
4. Get Transactions by Address
Fetches transactions for a specific address.
Example Query
Function Name: GetTransactionsByAddress
Function Argument:
5. Get Contract ABI
Fetches the ABI (Application Binary Interface) of a contract.
Example Query
Function Name: GetContractABI
Function Argument:
6. Get Transaction by Hash
Fetches the details of a transaction using its hash.
Example Query
Function Name: GetTransactionByHash
Function Argument:
7. Get Block by Number
Fetches the details of a block using its block number.
Example Query
Function Name: GetBlocksByNumber
Function Argument:
8. Get Transaction Status
Fetches the status of a transaction using its hash.
Example Query
Function Name: GetTransactionStatus
Function Argument:
9. Wrapping zkCRO
Wraps zkCRO tokens into wrapped tokens.
Example Query
Function Name: WrapToken
Function Argument:
Note: This function returns a magic link. Read more about Magic Link.
10. Swap Token
Swaps one token into another (e.g., zkCRO to VUSD).
Example Query
Function Name: SwapToken
Function Argument:
Note: This function returns a magic link. Read more about Magic Link.
Last updated
Was this helpful?