Create a swap intent
Creates a new intent with the swap data. A resolver makes an intent offchain and executes it onchain later.
HTTP request
POST /v1/intents/
Request
Header parameters
Requires authentication.
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
quote_id | String | Required | You must resecive quote before swap intent creation. |
from | Object | Required | Base token information for swap intent creation. |
from.address | String | Required | Part of the from object. Sender address. |
from.refund_address | String | Required | Part of the from object. Address for potential refund. |
from.public_key | String | Optional | Part of the from object. Required only if source chain is Bitcoin or Solana. |
to | Object | Required | Quote token information for swap intent creation. |
to.address | String | Required | Part of the to object. Receiver address. |
Sample request
application/json
{
"quote_id": "e63243b6-c489-42c6-a8a2-739c23bc36a1",
"from": {
"address": "0xbe7A42Af09C2.....C064f5Bd98a88c8EE",
"refund_address": "0xbe7A42Af09C25.....064f5Bd98a88c8EE"
},
"to": {
"address": "B69793d1.....ChkQEr5DZo"
}
}
Response
Successful response
| Name | Type | Required | Description |
|---|---|---|---|
id | String | Required | Swap intent UUID. |
expires_at | Timestamp (milliseconds) | Optional | Swap intent expiration time. |
secret_hash | String | Optional | Value based on public_key in request. |
approval_type | String | Required | Approval mechanism, depends on network. Possible values: permit2, cosign or htlc. |
approve_to | String | Required / Nullable | Approval address. |
params_to_sign | Object | Required | Object with data to sign by user's wallet. |
quote | Object | Required | Applied quote for the current swap intent. |
Sample response (EVM and Tron)
application/json
{
"id": "bf53a856-46aa-4865-8d66-a649a9d5b169",
"expires_at": 1780078455,
"secret_hash": "0x3f2bb70a115e0a.....187d9351c565682b8",
"approve_to": null,
"approval_type": "permit2",
"params_to_sign": {
"nonce": 81,
"additional_data": {
"types": {
"DepositWitness": [
{
"name": "resolverDepositAddress",
"type": "address"
},
{
"name": "secretHash",
"type": "bytes32"
},
{
"name": "deadline",
"type": "uint256"
}
],
"TokenPermissions": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint256"
}
],
"PermitWitnessTransferFrom": [
{
"name": "permitted",
"type": "TokenPermissions"
},
{
"name": "spender",
"type": "address"
},
{
"name": "nonce",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "witness",
"type": "DepositWitness"
}
]
},
"domain": {
"name": "Permit2",
"chainId": 1,
"version": "1",
"verifyingContract": "0x000000000022D.....DEE9F6B43aC78BA3"
},
"witness": {
"deadline": "0x6a19d777",
"secretHash": "0x3f2bb70a115e0a.....187d9351c565682b8",
"resolverDepositAddress": "0x745f221ca.....a6649a0c5fc5"
},
"witness_hash": "0xa6b608c2503bb6e6d9.....2a054786dbaf41beed9",
"witness_type_string": "DepositWitness witness)DepositWitness(address resolverDepositAddress,bytes32 secretHash,uint256 deadline)TokenPermissions(address token,uint256 amount)"
},
"escrow_contract_address": "0x8DcbE1aCf3.....e318F8e8836",
"permit2_contract_address": "0x0000000000.....6B43aC78BA3",
"resolver_deposit_address": "0x745F221caec.....A6649a0c5Fc5"
},
"quote": {
"id": "f5a68149-e20c-4774-9494-16d3cee0f84d",
"from": {
"network_id": 3,
"token_id": 278,
"contract_address": "0xdac17f958d2.....97c13d831ec7",
"amount": "1000000",
"decimals": 6
},
"to": {
"network_id": 177,
"token_id": 678,
"contract_address": null,
"amount": "7277684",
"decimals": 9,
"min_amount": "7241295"
},
"slippage_bps": "50",
"expires_at": 1780071289460000,
"fees": {
"changelly": {
"network_id": 3,
"contract_address": "0xc02aaa39b2.....d9083c756cc2",
"token_id": 4669,
"decimals": 18,
"amount": "4909698369185",
"bps": "100"
},
"affiliate": {
"network_id": 3,
"contract_address": "0xc02aaa39b2.....d9083c756cc2",
"token_id": 4669,
"decimals": 18,
"amount": "2454849184592",
"bps": "50"
}
}
}
}
Error response
Check the error response schema.