Skip to main content
Hand a quote to the function for its source chain. The user signs once, and delivery on the destination chain happens without further action from them.
ERC20 allowance. Approve the Mayan Forwarder contract before swapping an ERC20 input. The address is available as addresses.MAYAN_FORWARDER_CONTRACT.Alternatively, pass an EIP-2612 permit if the input token supports it:

Referrer addresses

referrerAddresses is an object keyed by network type, because the address that receives the fee depends on which chain it settles on.
Pass null until you set one up. See fees & earning.

Custom refund address

On Swift quotes only, swiftRefundAddress sends a refund to a different source-chain address than the wallet that signed.
  • Request the quote with gasless: false. Gasless Swift orders require the refund address to match the signer, and the SDK throws otherwise.
  • Other quote types ignore it and refund to the swapper wallet. Filter on quote.type === "SWIFT" if this matters to your flow.
  • The address must be a valid wallet on the source chain. Zero addresses are rejected.
See refunds.

Gasless swaps

When the selected quote has gasless: true, swapFromEvm returns an order hash string rather than a transaction. Query it on the Explorer API exactly as you would a transaction hash.
See gasless execution.

Depositing into HyperCore

Fetch a quote with toChain: "hypercore", then call the normal swap function for the source chain. No extra user signature is required. Pass the user’s HyperCore address, an EVM-style 0x address, as destinationAddress. Spot versus perps is encoded automatically from the toToken in the quote.
Sui to HyperCore is temporarily disabled. createSwapFromSuiMoveCalls throws on a HyperCore destination.
See HyperCore deposit & withdraw.

React Native

The SDK works in React Native. For Solana, pass a callback that wraps transact from the Solana Mobile SDK as signSolanaTransaction. For EVM, get a provider from WalletConnect and pass its signer to swapFromEvm. A scaffold project is available.
Bundlers that cannot require() an ES module, including some Metro and React Native setups, are affected by the v15 ESM requirement. Import the SDK as ESM.

Next steps

Track Transactions

Follow the swap to a terminal status.

Manual Transaction Building

Get the payload or instructions and send the transaction yourself.