SDK

We have open-sourced the SDK for the swap functionality in Mimo V3.

You can check it out here:

curl 'https://swap-api.mimo.exchange/api/trade' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Content-Type: application/json' \
  --data-raw '{"chainId":4689,"protocols":"v2,v3,mixed","token0":{"address":"IOTX","decimals":18},"token1":{"address":"0x97e6c48867fdc391a8dfe9d169ecd005d1d90283","decimals":18},"recipient":"0x7890256910829ECc1CDD50AB50B1E92EC90A28da","amount":"10000000000000000000","slippage":{"numerator":50,"denominator":10000},"tradeType":"EXACT_INPUT"}'

repo: https://github.com/mimoprotocol/mimo-api the input and output params please refer uniswap sdk

Parameter
Type
Description
Required
Example

chainId

Integer

The ID of the blockchain network (e.g., Binance Smart Chain, IoTeX).

Yes

4689

protocols

String

Comma-separated list of supported protocols. Valid options are v2, v3, and mixed.

Yes

"v2,v3,mixed"

token0

Object

Details of the first token in the trade.

Yes

{"address":"IOTX","decimals":18}

address

String

Address of the first token.

Yes

"IOTX"

decimals

Integer

Number of decimal places for the token.

Yes

18

token1

Object

Details of the second token in the trade.

Yes

{"address":"0x97e6c48867fdc391a8dfe9d169ecd005d1d90283","decimals":18}

address

String

Address of the second token.

Yes

"0x97e6c48867fdc391a8dfe9d169ecd005d1d90283"

decimals

Integer

Number of decimal places for the token.

Yes

18

recipient

String

The wallet address that will receive the output token.

Yes

"0x7890256910829ECc1CDD50AB50B1E92EC90A28da"

amount

String

The amount of the input token ( token0 ) to exchange. Represented as a string to handle large numbers.

Yes

"10000000000000000000"

slippage

Object

Allowed slippage tolerance. Expressed as a fraction.

Yes

{"numerator":50,"denominator":10000}

numerator

Integer

The numerator of the slippage fraction.

Yes

50

denominator

Integer

The denominator of the slippage fraction.

Yes

10000

tradeType

String

The type of trade. Typically "EXACT_INPUT".

Yes

"EXACT_INPUT"

Sdk

sdk repo: https://github.com/mimoprotocol/mimoswap-sdk

Last updated

Was this helpful?