Token Interaction
2.1 Get native balance
address (str): The blockchain address to query."Get native balance of <example-address>"
str: A formatted string containing the native token balance for the address.The native balance for address <example-address> is <example-amount> CRO (CRO being the native token).
from crypto_com_agent_client import Agent
agent = Agent.init(
llm_config={
"provider": "OpenAI",
"model": "gpt-4o-mini",
"temperature": 1,
"provider-api-key": "sk-proj-example-key",
"transfer-limit": -1, # -1 means no limit (unlimited), 0 disables transfers completely, any positive number (e.g. 5) allows exactly that transfer amount
},
blockchain_config={
"api-key": "your-crypto.com-developer-platform-api-key",
"private-key": "your-private-key",
"sso-wallet-url": "your-sso-wallet-url",
"timeout": "timeout-in-seconds-for-API-calls-default-20s")
},
)
response = agent.interact("Get native balance of <example-address>")
print(response)2.2 Get ERC20 Token Balance
2.3 Transfer native token
2.4 Transfer ERC20 token
2.5 Wrap token
2.6 Swap token
Last updated
Was this helpful?