Skip to main content

API Integration

Meson Protocol facilitates third-party application integration by providing a selection of APIs through its relayer service. These APIs offer functionalities related to Meson's cross-chain capabilities, including:

  • Querying supported chains and tokens in the Meson Protocol, and determining the price for cross-chain swaps
  • Encoding data for Meson's cross-chain swap
  • Submitting a cross-chain swap to Meson
  • Checking the status of a swap

Developers may utilize these functionalities as per their specific requirements, either in whole or in part.

To quickly interact with the Meson API, we offer an Interactive Playground. This provides step-by-step instructions for each API operation, which you can execute directly from the page.

Considerations for API Usage

Before integrating the API, we suggest considering whether it's necessary for your use case. Many cross-chain operations can be more conveniently accomplished using SDK Integration. While the API offers a lower-level approach to using the Meson Protocol, it can involve additional work. Typically, the Meson API is designed for users with the following needs:

  • Automation of cross-chain swaps without human intervention. For example, if you're developing a cross-chain arbitrage bot that needs to invoke the Meson contract to perform automatic cross-chain swaps based on market conditions.
  • Completion of the cross-chain process on a backend server. For instance, multisig or MPC wallets may want to initiate Meson cross-chain swaps directly from the server after collecting the necessary signature.
  • Initiation of Meson cross-chain swaps through a contract. In this case, you may need to use certain APIs, like the price-fetching and encode APIs, to help construct transactions.

Using the API can also enable some more advanced usage scenarios. We will update with related tutorials in the future.

Learning More About the API

For details on the specific API specifications, please refer to our API documentation.