Transaction Queries
3.1 Get transaction by hash
hash (str): The hash of the transaction to retrieve."Get transaction of transaction hash <example-hash>"
str: A formatted string containing the transaction details.The transaction details for the hash <example-hash> are as follows: Status: <example-status> Block Number: <example-block-number> From Address: <example-from> To Address: <example-to> Value: <example-value> Gas Price: <example-gas-price> Nonce: <example-nonce> Transaction Index: <example-transaction-index> Gas Used: <example-gas-used>
from crypto_com_agent_client import Agent
agent = Agent.init(
llm_config={
"provider": "OpenAI",
"model": "gpt-4",
"provider-api-key": "sk-proj-example-key",
"temperature": "float-controlling-output-randomness",
"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 transaction of transaction hash <example-hash>")
print(response)3.2 Get transaction status
Last updated
Was this helpful?