"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MuxReader__factory = void 0;
const ethers_1 = require("ethers");
const _abi = [
    {
        inputs: [
            {
                internalType: "address",
                name: "pool_",
                type: "address",
            },
            {
                internalType: "address",
                name: "mlp_",
                type: "address",
            },
            {
                internalType: "address",
                name: "dex_",
                type: "address",
            },
            {
                internalType: "address",
                name: "orderBook_",
                type: "address",
            },
            {
                internalType: "address[]",
                name: "deductWhiteList_",
                type: "address[]",
            },
        ],
        stateMutability: "nonpayable",
        type: "constructor",
    },
    {
        inputs: [
            {
                internalType: "uint256",
                name: "",
                type: "uint256",
            },
        ],
        name: "deductWhiteList",
        outputs: [
            {
                internalType: "address",
                name: "",
                type: "address",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [],
        name: "dex",
        outputs: [
            {
                internalType: "contract ILiquidityManager",
                name: "",
                type: "address",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [],
        name: "getChainStorage",
        outputs: [
            {
                components: [
                    {
                        components: [
                            {
                                internalType: "uint32",
                                name: "shortFundingBaseRate8H",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "shortFundingLimitRate8H",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "fundingInterval",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "liquidityBaseFeeRate",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "liquidityDynamicFeeRate",
                                type: "uint32",
                            },
                            {
                                internalType: "uint96",
                                name: "mlpPriceLowerBound",
                                type: "uint96",
                            },
                            {
                                internalType: "uint96",
                                name: "mlpPriceUpperBound",
                                type: "uint96",
                            },
                            {
                                internalType: "uint32",
                                name: "lastFundingTime",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "sequence",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "strictStableDeviation",
                                type: "uint32",
                            },
                        ],
                        internalType: "struct Reader.PoolStorage",
                        name: "pool",
                        type: "tuple",
                    },
                    {
                        components: [
                            {
                                internalType: "bytes32",
                                name: "symbol",
                                type: "bytes32",
                            },
                            {
                                internalType: "address",
                                name: "tokenAddress",
                                type: "address",
                            },
                            {
                                internalType: "address",
                                name: "muxTokenAddress",
                                type: "address",
                            },
                            {
                                internalType: "uint8",
                                name: "id",
                                type: "uint8",
                            },
                            {
                                internalType: "uint8",
                                name: "decimals",
                                type: "uint8",
                            },
                            {
                                internalType: "uint56",
                                name: "flags",
                                type: "uint56",
                            },
                            {
                                internalType: "uint32",
                                name: "initialMarginRate",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "maintenanceMarginRate",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "positionFeeRate",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "liquidationFeeRate",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "minProfitRate",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "minProfitTime",
                                type: "uint32",
                            },
                            {
                                internalType: "uint96",
                                name: "maxLongPositionSize",
                                type: "uint96",
                            },
                            {
                                internalType: "uint96",
                                name: "maxShortPositionSize",
                                type: "uint96",
                            },
                            {
                                internalType: "uint32",
                                name: "spotWeight",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "longFundingBaseRate8H",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "longFundingLimitRate8H",
                                type: "uint32",
                            },
                            {
                                internalType: "uint8",
                                name: "referenceOracleType",
                                type: "uint8",
                            },
                            {
                                internalType: "address",
                                name: "referenceOracle",
                                type: "address",
                            },
                            {
                                internalType: "uint32",
                                name: "referenceDeviation",
                                type: "uint32",
                            },
                            {
                                internalType: "uint32",
                                name: "halfSpread",
                                type: "uint32",
                            },
                            {
                                internalType: "uint128",
                                name: "longCumulativeFundingRate",
                                type: "uint128",
                            },
                            {
                                internalType: "uint128",
                                name: "shortCumulativeFunding",
                                type: "uint128",
                            },
                            {
                                internalType: "uint96",
                                name: "spotLiquidity",
                                type: "uint96",
                            },
                            {
                                internalType: "uint96",
                                name: "credit",
                                type: "uint96",
                            },
                            {
                                internalType: "uint96",
                                name: "totalLongPosition",
                                type: "uint96",
                            },
                            {
                                internalType: "uint96",
                                name: "totalShortPosition",
                                type: "uint96",
                            },
                            {
                                internalType: "uint96",
                                name: "averageLongPrice",
                                type: "uint96",
                            },
                            {
                                internalType: "uint96",
                                name: "averageShortPrice",
                                type: "uint96",
                            },
                            {
                                internalType: "uint128",
                                name: "collectedFee",
                                type: "uint128",
                            },
                            {
                                internalType: "uint256",
                                name: "deduct",
                                type: "uint256",
                            },
                        ],
                        internalType: "struct Reader.AssetStorage[]",
                        name: "assets",
                        type: "tuple[]",
                    },
                    {
                        components: [
                            {
                                internalType: "uint8",
                                name: "dexId",
                                type: "uint8",
                            },
                            {
                                internalType: "uint8",
                                name: "dexType",
                                type: "uint8",
                            },
                            {
                                internalType: "uint8[]",
                                name: "assetIds",
                                type: "uint8[]",
                            },
                            {
                                internalType: "uint32[]",
                                name: "assetWeightInDEX",
                                type: "uint32[]",
                            },
                            {
                                internalType: "uint256[]",
                                name: "totalSpotInDEX",
                                type: "uint256[]",
                            },
                            {
                                internalType: "uint32",
                                name: "dexWeight",
                                type: "uint32",
                            },
                            {
                                internalType: "uint256",
                                name: "dexLPBalance",
                                type: "uint256",
                            },
                            {
                                internalType: "uint256[]",
                                name: "liquidityBalance",
                                type: "uint256[]",
                            },
                        ],
                        internalType: "struct Reader.DexStorage[]",
                        name: "dexes",
                        type: "tuple[]",
                    },
                    {
                        internalType: "uint32",
                        name: "liquidityLockPeriod",
                        type: "uint32",
                    },
                    {
                        internalType: "uint32",
                        name: "marketOrderTimeout",
                        type: "uint32",
                    },
                    {
                        internalType: "uint32",
                        name: "maxLimitOrderTimeout",
                        type: "uint32",
                    },
                    {
                        internalType: "uint256",
                        name: "lpDeduct",
                        type: "uint256",
                    },
                    {
                        internalType: "uint256",
                        name: "stableDeduct",
                        type: "uint256",
                    },
                    {
                        internalType: "bool",
                        name: "isPositionOrderPaused",
                        type: "bool",
                    },
                    {
                        internalType: "bool",
                        name: "isLiquidityOrderPaused",
                        type: "bool",
                    },
                ],
                internalType: "struct Reader.ChainStorage",
                name: "chain",
                type: "tuple",
            },
        ],
        stateMutability: "nonpayable",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "address[]",
                name: "tokens",
                type: "address[]",
            },
            {
                internalType: "address",
                name: "owner",
                type: "address",
            },
        ],
        name: "getErc20Balances",
        outputs: [
            {
                internalType: "uint256[]",
                name: "balances",
                type: "uint256[]",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "uint64[]",
                name: "orderIds",
                type: "uint64[]",
            },
        ],
        name: "getOrders",
        outputs: [
            {
                internalType: "bytes32[3][]",
                name: "orders",
                type: "bytes32[3][]",
            },
            {
                internalType: "bool[]",
                name: "isExist",
                type: "bool[]",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "uint64[]",
                name: "orderIds",
                type: "uint64[]",
            },
        ],
        name: "getPositionOrdersExtra",
        outputs: [
            {
                components: [
                    {
                        internalType: "uint96",
                        name: "tpPrice",
                        type: "uint96",
                    },
                    {
                        internalType: "uint96",
                        name: "slPrice",
                        type: "uint96",
                    },
                    {
                        internalType: "uint8",
                        name: "tpslProfitTokenId",
                        type: "uint8",
                    },
                    {
                        internalType: "uint32",
                        name: "tpslDeadline",
                        type: "uint32",
                    },
                ],
                internalType: "struct PositionOrderExtra[]",
                name: "extras",
                type: "tuple[]",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "bytes32[]",
                name: "subAccountIds",
                type: "bytes32[]",
            },
        ],
        name: "getSubAccounts",
        outputs: [
            {
                components: [
                    {
                        internalType: "uint96",
                        name: "collateral",
                        type: "uint96",
                    },
                    {
                        internalType: "uint96",
                        name: "size",
                        type: "uint96",
                    },
                    {
                        internalType: "uint32",
                        name: "lastIncreasedTime",
                        type: "uint32",
                    },
                    {
                        internalType: "uint96",
                        name: "entryPrice",
                        type: "uint96",
                    },
                    {
                        internalType: "uint128",
                        name: "entryFunding",
                        type: "uint128",
                    },
                ],
                internalType: "struct Reader.SubAccountState[]",
                name: "subAccounts",
                type: "tuple[]",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [
            {
                internalType: "bytes32[]",
                name: "subAccountIds",
                type: "bytes32[]",
            },
            {
                internalType: "uint64[]",
                name: "orderIds",
                type: "uint64[]",
            },
        ],
        name: "getSubAccountsAndOrders",
        outputs: [
            {
                components: [
                    {
                        internalType: "uint96",
                        name: "collateral",
                        type: "uint96",
                    },
                    {
                        internalType: "uint96",
                        name: "size",
                        type: "uint96",
                    },
                    {
                        internalType: "uint32",
                        name: "lastIncreasedTime",
                        type: "uint32",
                    },
                    {
                        internalType: "uint96",
                        name: "entryPrice",
                        type: "uint96",
                    },
                    {
                        internalType: "uint128",
                        name: "entryFunding",
                        type: "uint128",
                    },
                ],
                internalType: "struct Reader.SubAccountState[]",
                name: "subAccounts",
                type: "tuple[]",
            },
            {
                internalType: "bytes32[3][]",
                name: "orders",
                type: "bytes32[3][]",
            },
            {
                internalType: "bool[]",
                name: "isOrderExist",
                type: "bool[]",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [],
        name: "mlp",
        outputs: [
            {
                internalType: "contract IERC20",
                name: "",
                type: "address",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [],
        name: "orderBook",
        outputs: [
            {
                internalType: "contract IOrderBook",
                name: "",
                type: "address",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
    {
        inputs: [],
        name: "pool",
        outputs: [
            {
                internalType: "contract ILiquidityPool",
                name: "",
                type: "address",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
];
class MuxReader__factory {
    static createInterface() {
        return new ethers_1.utils.Interface(_abi);
    }
    static connect(address, signerOrProvider) {
        return new ethers_1.Contract(address, _abi, signerOrProvider);
    }
}
exports.MuxReader__factory = MuxReader__factory;
MuxReader__factory.abi = _abi;
//# sourceMappingURL=MuxReader__factory.js.map