Submit swap from smart contract
POST /api/v1/swap/from-contract/:encoded
Following the encode swap API, this API will submit a cross-chain swap from a smart contract. See usage instructions.
Path Parameters
- encoded hex_string_32_bytes requiredExamples:
The encode of a Meson cross-chain swap, returned by the encode swap API.
- Mainnet
- Testnet
Example:
0x010000989680d8000000000018740e1f000000138800640554a003c60202ca21
Example:
0x010000989680d80000000000cb13cba8000000000000644325ec02ca2236a721
- application/json
Request Body required
- hash hex_string required
The transaction hash that triggered Meson's smart contract.
Responses
- 200
- 400
Successful operation
If your request data is valid and the cross-chain swap is submitted to Meson protocol for processing,
you will receive a swapId
in response. Please use the next API or go to
https://explorer.meson.fi/swap/[swapId] or
https://testnet-explorer.meson.fi/swap/[swapId] to check the swap status.
- application/json
- Schema
- Example (from schema)
- For Mainnet
- For Testnet
{
"result": {
"swapId": "string"
}
}
{
"result": {
"swapId": "0x03ae219df61c9a564f9a68a9b8b48539060e869ff8ef9dc457d21e0a924f48be"
}
}
{
"result": {
"swapId": "0xf1a9f12fe479e80f3e8003a347303ff39652766b34f5aa454cf5aedd8f3c2021"
}
}
Error
- application/json
- Schema
- Example (from schema)
Schema
error object
code int32message stringdata object
code string
{
"error": {
"code": -1,
"message": "[error_message]",
"data": {
"code": "[error_code]"
}
}
}
Loading...