curl --request POST \
--url https://api.ternswap.xyz/v1/quotes \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"fromChain": "base",
"fromAsset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"fromAmount": "100000000",
"toChain": "starknet",
"toAsset": "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
"sender": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"recipient": "0x04a7c1e8f2d5b6a39e0c7d18b2f4e6a5c3d9b8a7f6e5d4c3b2a1908f7e6d5c4b",
"executionCondition": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925"
}
'{
"id": "q_01JB8Z5W3F6V9Q2X4K7M1N0P8R",
"status": "awaiting_deposit",
"route": "escrow",
"from": {
"chain": "base",
"asset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"amount": "100000000"
},
"to": {
"chain": "starknet",
"asset": "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
"amount": "99880000",
"minAmount": "99880000"
},
"fees": {
"totalUsd": "0.13",
"items": [
{
"kind": "network",
"usd": "0.06"
},
{
"kind": "solver",
"usd": "0.07"
}
]
},
"etaSecs": 40,
"execute": {
"depositAddress": "0x3c1f0e0a9b7d6c5e4f3a2b1c0d9e8f7a6b5c4d3e",
"steps": [
{
"kind": "approve",
"tx": {
"chainId": 8453,
"from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"to": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"data": "0x095ea7b3…",
"value": "0"
}
},
{
"kind": "deposit",
"tx": {
"chainId": 8453,
"from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"to": "0x53cac833e629e7453197a2808da550dd9c535d6d",
"data": "0x…",
"value": "0"
}
}
]
},
"createdAt": 1793084030,
"expiresAt": 1793085830
}Create a quote
A firm quote, ready to fund. Across chains a solver commits to it, and it settles through two escrows: the body
needs sender (the refund address), recipient and executionCondition, the SHA-256 of a 32-byte fulfillment the
client generates and keeps. On one chain it is a swap in one transaction through a DEX aggregator: it needs
sender and recipient. A private swap (privacy: "shielded") names none of them.
execute.steps lists what to send, in order: each step’s kind (approve, deposit, swap) and its EVM tx
(send them one after another), its Starknet call (all in one invoke), or a Solana swap’s solana transaction. A
private swap has strk20 actions to prove and submit instead. An escrow quote also has a
depositAddress, to which the exact from.amount can be sent from any wallet instead.
curl --request POST \
--url https://api.ternswap.xyz/v1/quotes \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"fromChain": "base",
"fromAsset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"fromAmount": "100000000",
"toChain": "starknet",
"toAsset": "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
"sender": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"recipient": "0x04a7c1e8f2d5b6a39e0c7d18b2f4e6a5c3d9b8a7f6e5d4c3b2a1908f7e6d5c4b",
"executionCondition": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925"
}
'{
"id": "q_01JB8Z5W3F6V9Q2X4K7M1N0P8R",
"status": "awaiting_deposit",
"route": "escrow",
"from": {
"chain": "base",
"asset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"amount": "100000000"
},
"to": {
"chain": "starknet",
"asset": "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
"amount": "99880000",
"minAmount": "99880000"
},
"fees": {
"totalUsd": "0.13",
"items": [
{
"kind": "network",
"usd": "0.06"
},
{
"kind": "solver",
"usd": "0.07"
}
]
},
"etaSecs": 40,
"execute": {
"depositAddress": "0x3c1f0e0a9b7d6c5e4f3a2b1c0d9e8f7a6b5c4d3e",
"steps": [
{
"kind": "approve",
"tx": {
"chainId": 8453,
"from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"to": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"data": "0x095ea7b3…",
"value": "0"
}
},
{
"kind": "deposit",
"tx": {
"chainId": 8453,
"from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"to": "0x53cac833e629e7453197a2808da550dd9c535d6d",
"data": "0x…",
"value": "0"
}
}
]
},
"createdAt": 1793084030,
"expiresAt": 1793085830
}Authorizations
Headers
Body
The body of POST /v1/quotes: a firm quote, ready to fund.
Across chains, a quote settles through escrows and needs sender, recipient and executionCondition. On one
chain it is a swap: it needs sender and recipient and takes no executionCondition. A private swap
(privacy: "shielded") names none of the three.
Response
The firm quote
A firm quote: a solver's commitment (or a swap's route), and its progress. Every quote route and webhook returns this one object.