// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

/// @dev Type for individual asset along with it's details
/// @param token token address
/// @param assetType type of asset represented by the address
/// @param tokenId tokenId in case of ERC721 and ERC1155 tokens. Set to 0 in case of ERC20 token
/// @param amount amount of token for ERC20 and ERC1155 tokens. Set to 1 in case of ERC721 token
struct AssetData {
    address token;
    AssetType assetType;
    uint256 tokenId;
    uint256 amount;
}

/// @dev Common Assets type, packing bundle of NFTs and FTs.
/// @param assets Array of individual tokens along with their details
struct Assets {
    AssetData[] assets;
}

/// @dev Broker and platform fee info
/// @param token Fee token address
/// @param broker Broker address
/// @param platform Platform address
/// @param brokerAmount Broker fee
/// @param platformAmount Platform fee
struct Fees {
    address token;
    address broker;
    address platform;
    uint256 brokerAmount;
    uint256 platformAmount;
}

/// @dev Common Trade data type used by broker while setting up trade
/// @param makerAssets Assets offered by the maker
/// @param takerAssets Assets offered by the taker
/// @param makerFees Fees offered by the maker
/// @param takerFees Fees offered by the taker
/// @param maker Maker's address
/// @param taker Taker's address
/// @param duration Trade duration
/// @param makerNonce Nonce of maker
/// @param takerNonce Nonce of taker
struct TradeInfo {
    Assets makerAssets;
    Assets takerAssets;
    Fees makerFees;
    Fees takerFees;
    address maker;
    address taker;
    uint256 duration;
    uint256 makerNonce;
    uint256 takerNonce;
}

enum AssetType {
    INVALID,
    ERC_20,
    ERC_721,
    ERC_1155,
    KITTIES,
    PUNK
}
[{"inputs":[{"internalType":"enum BrokersSignatureUtils.BrokerSignatureUtilsErrorCodes","name":"code","type":"uint8"}],"name":"BrokerSignatureUtilsError","type":"error"},{"inputs":[{"internalType":"enum IBrokers.BrokersErrorCodes","name":"code","type":"uint8"}],"name":"BrokersError","type":"error"},{"anonymous":false,"inputs":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"enum AssetType","name":"assetType","type":"uint8"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct AssetData[]","name":"assets","type":"tuple[]"}],"indexed":false,"internalType":"struct Assets","name":"assets","type":"tuple"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"AssetsTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"broker","type":"address"}],"name":"BrokerRegistered","type":"event"},{"anonymous":false,"inputs":[{"components":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"enum AssetType","name":"assetType","type":"uint8"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct AssetData[]","name":"assets","type":"tuple[]"}],"internalType":"struct Assets","name":"makerAssets","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"enum AssetType","name":"assetType","type":"uint8"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct AssetData[]","name":"assets","type":"tuple[]"}],"internalType":"struct Assets","name":"takerAssets","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"broker","type":"address"},{"internalType":"address","name":"platform","type":"address"},{"internalType":"uint256","name":"brokerAmount","type":"uint256"},{"internalType":"uint256","name":"platformAmount","type":"uint256"}],"internalType":"struct Fees","name":"makerFees","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"broker","type":"address"},{"internalType":"address","name":"platform","type":"address"},{"internalType":"uint256","name":"brokerAmount","type":"uint256"},{"internalType":"uint256","name":"platformAmount","type":"uint256"}],"internalType":"struct Fees","name":"takerFees","type":"tuple"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"makerNonce","type":"uint256"},{"internalType":"uint256","name":"takerNonce","type":"uint256"}],"indexed":false,"internalType":"struct TradeInfo","name":"tradeInfo","type":"tuple"},{"indexed":true,"internalType":"address","name":"broker","type":"address"}],"name":"BrokerSwapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"broker","type":"address"},{"internalType":"address","name":"platform","type":"address"},{"internalType":"uint256","name":"brokerAmount","type":"uint256"},{"internalType":"uint256","name":"platformAmount","type":"uint256"}],"indexed":false,"internalType":"struct Fees","name":"fees","type":"tuple"}],"name":"FeeTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"NonceSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"__nonce","type":"uint256"}],"name":"getNonce","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"enum AssetType","name":"assetType","type":"uint8"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct AssetData[]","name":"assets","type":"tuple[]"}],"internalType":"struct Assets","name":"makerAssets","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"enum AssetType","name":"assetType","type":"uint8"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct AssetData[]","name":"assets","type":"tuple[]"}],"internalType":"struct Assets","name":"takerAssets","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"broker","type":"address"},{"internalType":"address","name":"platform","type":"address"},{"internalType":"uint256","name":"brokerAmount","type":"uint256"},{"internalType":"uint256","name":"platformAmount","type":"uint256"}],"internalType":"struct Fees","name":"makerFees","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"broker","type":"address"},{"internalType":"address","name":"platform","type":"address"},{"internalType":"uint256","name":"brokerAmount","type":"uint256"},{"internalType":"uint256","name":"platformAmount","type":"uint256"}],"internalType":"struct Fees","name":"takerFees","type":"tuple"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"makerNonce","type":"uint256"},{"internalType":"uint256","name":"takerNonce","type":"uint256"}],"internalType":"struct TradeInfo","name":"tradeInfo","type":"tuple"},{"internalType":"bytes","name":"makerSignature","type":"bytes"},{"internalType":"bool","name":"makerContra","type":"bool"},{"internalType":"bytes","name":"takerSignature","type":"bytes"},{"internalType":"bool","name":"takerContra","type":"bool"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]