Skip to main content
Most integrations should use the SDK, which builds the transaction for you on every supported chain. Go directly to the API when you are working in a language the SDK does not cover, running quotes on a backend that never touches a wallet, or building the transaction yourself for another reason. This page covers the API surface and what you are responsible for once you skip the SDK.

What you implement yourself

Four things the SDK would otherwise handle:
  • Building the transaction for each source chain, including Solana instructions and Sui Move calls
  • ERC20 allowance against the Forwarder contract, or an EIP-2612 permit
  • Encoding the referrer addresses and verifying they match the quote
  • Reading route-specific fields off the quote and branching on type

Get a quote

The full parameter list is on the Quote API page. The ones that matter most:

Read the quote

The response is { quotes: [...], minimumSdkVersion: [...] }. For each quote:
Do not assume every quote in the array is the same route type. Check type on the specific quote you selected before building anything.

Approve the input token

For an ERC20 input on EVM, approve the Mayan Forwarder contract for at least effectiveAmountIn64 before sending the swap. The address is in forwarderAddress on the quote request, and documented on Forwarder Contract. Tokens supporting EIP-2612 can use a permit signature instead, which saves the user a transaction. Native inputs need no approval.

Send the transaction

The contract and calldata depend on type. Read the route page for the one you are using:
getSwapFromEvmTxPayload returns the payload without sending it, and its _forwarder object gives you the method name and parameters for a contract-level call. See manual transaction building.

Track it

Poll the Explorer API with the source transaction hash and read clientStatus.
INPROGRESS, COMPLETED, or REFUNDED. See Track Transactions for handling each state.

Supported chains and tokens

  • GET https://sia.mayan.finance/v10/init returns every supported chain, with originActive and destinationActive telling you which direction each supports.
  • GET https://price-api.mayan.finance/v3/tokens?chain=solana returns the whitelisted token list. Drop chain for all chains. Any token with a contract address is routable, whitelisted or not, given liquidity.
The API does not return a documented error-code enum. The SDK handles quote and execution failures for you, so if you can use it, use it.