Soheil.fi
Soheil RouterDocs
API reference

Conventions

How every endpoint writes chains, addresses, amounts and times, and what v1 promises not to change.

Values

ValueWritten as
ChainsfromChainId, toChainId, chainId: the EVM chain ID, a number
Addresses0x…, lower case in answers; any case accepted in requests
The coin0x0000000000000000000000000000000000000000 (0xeeee…eeee is accepted too)
Amountsdecimal strings in the token's smallest unit, never numbers (they overflow JavaScript)
The transaction's valuehex (0x…), as wallets take it
Ids and hashes0x + 64 hex
Timesunix seconds
Names ending in Bpsbasis points (1 bps = 0.01%); names ending in Fee are amounts
Unknownnull, never a placeholder

What stays the same

  • Within v1, fields and endpoints are never renamed or removed. New fields and new endpoints may appear: ignore what you do not know.
  • Values like type, status, substatus and error codes may gain new members (bridges will add some). Treat an unknown one by its meaning: an unknown status as PENDING, an unknown error code by its HTTP status.
  • Shapes already carry both networks (fromChainId, toChainId, sending, receiving), so bridges come without a v2.

One quote, one transaction

Each quote has its own id, and its transaction is meant to be sent once. The contract does not refuse an id it has seen: sending the same transaction twice makes two trades, if the user's balance and approval allow it. Approving exactly fromAmount (never more) keeps a resent transaction from going through.