Urani's Intent Specs
This documentation explains how intents work for a limit order in a Urani Swap v1 (alpha) swap.
Creating an Intent
To create an intent for a limit order, a user can send the encapsulated JavaScript object to the /orders
endpoint using a POST
request.
{
"intentId": 123456,
"srcToken": "9wFF5VM1vWxK7EaSg9dLSkY8jZAGs8R4DQ9K9X5Jd2ac",
"srcAddress": "0ddb0a23e291b4aeb4c031d91ebf7fdea086eff5",
"srcAmount": 8714,
"dstToken": "2oNdfRRaxxYE8wRz5xZdqhfv6MFqjVcMkeVusQPh24dP",
"dstAddress": "0dd10a23e291b4aeb4c031d91ebf7fdea086eff5",
"minReceived": 1704,
"expiration": 1718034091
}
Here is a breakdown of each parameter and its purpose:
intentId: A unique identifier for the intent. In the provided code, it is generated randomly for demonstration purposes.
srcToken: The source token's address (mint address) on the Solana blockchain.
srcAddress: The wallet address from which the source tokens will be sent.
srcAmount: The amount of source tokens to be swapped.
dstToken: The destination token's address (mint address) on the Solana blockchain.
dstAddress: The wallet address to which the destination tokens will be sent.
minReceived: The minimum amount of destination tokens expected from the swap.
expiration: The expiration timestamp of the intent.
Last updated