convert

Quote a conversion and return the transactions that execute it

Takes an intent (chain, input token, output token, base-unit amount) and returns the approve + mint calls to sign, built from the addresses and ABIs this service holds. Routing policy — the slippage floor, the deadline window, which contract is called — therefore changes with a backend deploy rather than a client release, which is what makes the mobile app viable. The client signs through its own wallet; this service never holds a key, never broadcasts, and never appears in the calldata. mint mints to msg.sender and approve names only the spender, so no recipient address is present in these bytes for this service to substitute — which is what lets the client re-derive every call and refuse to sign on a mismatch. A 201 means the request was not statically refused, not that the mint will succeed.

post/convert/quote

Request body

chainIdnumber required

Chain the conversion executes on. Must be this deployment’s hub chain.

fromTokenstring required

Input token address. Must be an accepted input stablecoin.

toTokenstring required

Output token address. Must be dreUSD.

amountstring required

Input amount in the token’s smallest units, as a decimal integer string. Base units rather than a human decimal so no float ever touches a money value.

Example request

{
  "chainId": 8453,
  "fromToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "toToken": "0xB4E008A61b5A7A7D0e1aebd639F704d24821Bb2F",
  "amount": "100000000"
}

Response

Calls to sign

strategystring required

Which conversion this is. A client that does not recognise the value must refuse to sign rather than ignore it.

chainIdnumber required

Chain the calls execute on.

expiresAtstring required

When the embedded deadline expires, ISO 8601. After this the transaction reverts on-chain.

Example response

{
  "strategy": "mint"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.