The Intents API allows you to interact with the Ethereum blockchain by specifying a command in a user-friendly format. This API enables you to extract necessary information from the user's intent and generates transaction data accordingly. The API takes a request with recipient and command details and returns a response with relevant transaction information.
The base URL for all API requests is:
[<https://intents-api.onrender.com/>](<https://intents-api.onrender.com/>)
POST <https://intents-api.onrender.com/intents
>
The request should be sent as a JSON object in the following format:
{
"recipient": "0x03f142529a7B70305C07a50fAA44f6EBDADB4624",
"command": "I want to send 0.0001 WETH to shlok28.eth",
"chainId": "137"
}
recipient
: The Ethereum address of the intended recipient.command
: A user-friendly command expressing the intent of the transaction.The API response will be a JSON object containing the extracted transaction information:
{
"info": {
"obj": {
"toAddress": "shlok28.eth",
"protocol": "Ethereum",
"tokens": "ETH",
"function": "transfer",
"values": "10",
"category": "native"
},
"txObject": {
"to": "0x03f142529a7B70305C07a50fAA44f6EBDADB4624",
"value": "0x8ac7230489e80000",
"data": "0x"
}
}
}
toAddress
: The Ethereum address of the recipient extracted from the command.protocol
: The blockchain protocol, in this case, "Ethereum".tokens
: The type of tokens to be transferred, in this case, "ETH" (Ether).