// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.8.0;

interface CloberMarketSwapCallbackReceiver {
    /**
     * @notice Contracts placing orders on the OrderBook must implement this method.
     * In this method, the contract has to send the required token, or the transaction will revert.
     * If there is a claim bounty to be refunded, it will be transferred via msg.value.
     * @param inputToken The address of the token the user has to send.
     * @param outputToken The address of the token the user has received.
     * @param inputAmount The amount of tokens the user has to send.
     * @param outputAmount The amount of tokens the user has received.
     * @param data The user's custom callback data.
     */
    function cloberMarketSwapCallback(
        address inputToken,
        address outputToken,
        uint256 inputAmount,
        uint256 outputAmount,
        bytes calldata data
    ) external payable;
}
[{"inputs":[{"internalType":"address","name":"factory","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"errorCode","type":"uint256"}],"name":"CloberError","type":"error"},{"inputs":[{"internalType":"uint64","name":"deadline","type":"uint64"},{"components":[{"internalType":"address","name":"market","type":"address"},{"components":[{"internalType":"bool","name":"isBid","type":"bool"},{"internalType":"uint16","name":"priceIndex","type":"uint16"},{"internalType":"uint256","name":"orderIndex","type":"uint256"}],"internalType":"struct OrderKey[]","name":"orderKeys","type":"tuple[]"}],"internalType":"struct CloberRouter.ClaimOrderParams[]","name":"paramsList","type":"tuple[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"inputAmount","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"cloberMarketSwapCallback","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"market","type":"address"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"uint32","name":"claimBounty","type":"uint32"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint16","name":"priceIndex","type":"uint16"},{"internalType":"uint64","name":"rawAmount","type":"uint64"},{"internalType":"bool","name":"postOnly","type":"bool"},{"internalType":"bool","name":"useNative","type":"bool"},{"internalType":"uint256","name":"baseAmount","type":"uint256"}],"internalType":"struct CloberRouter.LimitOrderParams","name":"params","type":"tuple"}],"name":"limitAsk","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"market","type":"address"},{"components":[{"internalType":"bool","name":"isBid","type":"bool"},{"internalType":"uint16","name":"priceIndex","type":"uint16"},{"internalType":"uint256","name":"orderIndex","type":"uint256"}],"internalType":"struct OrderKey[]","name":"orderKeys","type":"tuple[]"}],"internalType":"struct CloberRouter.ClaimOrderParams[]","name":"claimParamsList","type":"tuple[]"},{"components":[{"internalType":"address","name":"market","type":"address"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"uint32","name":"claimBounty","type":"uint32"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint16","name":"priceIndex","type":"uint16"},{"internalType":"uint64","name":"rawAmount","type":"uint64"},{"internalType":"bool","name":"postOnly","type":"bool"},{"internalType":"bool","name":"useNative","type":"bool"},{"internalType":"uint256","name":"baseAmount","type":"uint256"}],"internalType":"struct CloberRouter.LimitOrderParams","name":"limitOrderParams","type":"tuple"}],"name":"limitAskAfterClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"market","type":"address"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"uint32","name":"claimBounty","type":"uint32"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint16","name":"priceIndex","type":"uint16"},{"internalType":"uint64","name":"rawAmount","type":"uint64"},{"internalType":"bool","name":"postOnly","type":"bool"},{"internalType":"bool","name":"useNative","type":"bool"},{"internalType":"uint256","name":"baseAmount","type":"uint256"}],"internalType":"struct CloberRouter.LimitOrderParams","name":"params","type":"tuple"}],"name":"limitBid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"market","type":"address"},{"components":[{"internalType":"bool","name":"isBid","type":"bool"},{"internalType":"uint16","name":"priceIndex","type":"uint16"},{"internalType":"uint256","name":"orderIndex","type":"uint256"}],"internalType":"struct OrderKey[]","name":"orderKeys","type":"tuple[]"}],"internalType":"struct CloberRouter.ClaimOrderParams[]","name":"claimParamsList","type":"tuple[]"},{"components":[{"internalType":"address","name":"market","type":"address"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"uint32","name":"claimBounty","type":"uint32"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint16","name":"priceIndex","type":"uint16"},{"internalType":"uint64","name":"rawAmount","type":"uint64"},{"internalType":"bool","name":"postOnly","type":"bool"},{"internalType":"bool","name":"useNative","type":"bool"},{"internalType":"uint256","name":"baseAmount","type":"uint256"}],"internalType":"struct CloberRouter.LimitOrderParams","name":"limitOrderParams","type":"tuple"}],"name":"limitBidAfterClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"market","type":"address"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint16","name":"limitPriceIndex","type":"uint16"},{"internalType":"uint64","name":"rawAmount","type":"uint64"},{"internalType":"bool","name":"expendInput","type":"bool"},{"internalType":"bool","name":"useNative","type":"bool"},{"internalType":"uint256","name":"baseAmount","type":"uint256"}],"internalType":"struct CloberRouter.MarketOrderParams","name":"params","type":"tuple"}],"name":"marketAsk","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"market","type":"address"},{"components":[{"internalType":"bool","name":"isBid","type":"bool"},{"internalType":"uint16","name":"priceIndex","type":"uint16"},{"internalType":"uint256","name":"orderIndex","type":"uint256"}],"internalType":"struct OrderKey[]","name":"orderKeys","type":"tuple[]"}],"internalType":"struct CloberRouter.ClaimOrderParams[]","name":"claimParamsList","type":"tuple[]"},{"components":[{"internalType":"address","name":"market","type":"address"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint16","name":"limitPriceIndex","type":"uint16"},{"internalType":"uint64","name":"rawAmount","type":"uint64"},{"internalType":"bool","name":"expendInput","type":"bool"},{"internalType":"bool","name":"useNative","type":"bool"},{"internalType":"uint256","name":"baseAmount","type":"uint256"}],"internalType":"struct CloberRouter.MarketOrderParams","name":"marketOrderParams","type":"tuple"}],"name":"marketAskAfterClaim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"market","type":"address"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint16","name":"limitPriceIndex","type":"uint16"},{"internalType":"uint64","name":"rawAmount","type":"uint64"},{"internalType":"bool","name":"expendInput","type":"bool"},{"internalType":"bool","name":"useNative","type":"bool"},{"internalType":"uint256","name":"baseAmount","type":"uint256"}],"internalType":"struct CloberRouter.MarketOrderParams","name":"params","type":"tuple"}],"name":"marketBid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"market","type":"address"},{"components":[{"internalType":"bool","name":"isBid","type":"bool"},{"internalType":"uint16","name":"priceIndex","type":"uint16"},{"internalType":"uint256","name":"orderIndex","type":"uint256"}],"internalType":"struct OrderKey[]","name":"orderKeys","type":"tuple[]"}],"internalType":"struct CloberRouter.ClaimOrderParams[]","name":"claimParamsList","type":"tuple[]"},{"components":[{"internalType":"address","name":"market","type":"address"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint16","name":"limitPriceIndex","type":"uint16"},{"internalType":"uint64","name":"rawAmount","type":"uint64"},{"internalType":"bool","name":"expendInput","type":"bool"},{"internalType":"bool","name":"useNative","type":"bool"},{"internalType":"uint256","name":"baseAmount","type":"uint256"}],"internalType":"struct CloberRouter.MarketOrderParams","name":"marketOrderParams","type":"tuple"}],"name":"marketBidAfterClaim","outputs":[],"stateMutability":"payable","type":"function"}]