package txtypes

import "fmt"

var (
	ErrAccountIndexTooLow              = fmt.Errorf("AccountIndex should not be less than %d", MinAccountIndex)
	ErrAccountIndexTooHigh             = fmt.Errorf("AccountIndex should not be larger than %d", MaxAccountIndex)
	ErrNonceTooLow                     = fmt.Errorf("AccountNonce should not be less than %d", MinNonce)
	ErrInvalidCancelAllTimeInForce     = fmt.Errorf("CancelAllTimeInForce is invalid")
	ErrOrderReduceOnlyInvalid          = fmt.Errorf("ReduceOnly is invalid")
	ErrOrderTriggerPriceInvalid        = fmt.Errorf("TriggerPrice is invalid")
	ErrOrderExpiryInvalid              = fmt.Errorf("OrderExpiry is invalid")
	ErrExpiredAtInvalid                = fmt.Errorf("ExpiredAt is invalid")
	ErrCancelAllTimeIsNotInRange       = fmt.Errorf("CancelAllTime should be larger than 0 and not larger than %d", MaxOrderExpiry)
	ErrCancelAllTimeisNotNill          = fmt.Errorf("CancelAllTime should be nil")
	ErrPubKeyInvalid                   = fmt.Errorf("PubKey is invalid")
	ErrToAccountIndexTooLow            = fmt.Errorf("ToAccountIndex should not be less than %d", MinAccountIndex)
	ErrToAccountIndexTooHigh           = fmt.Errorf("ToAccountIndex should not be larger than %d", MaxAccountIndex)
	ErrFromAccountIndexTooLow          = fmt.Errorf("FromAccountIndex should not be less than %d", MinAccountIndex)
	ErrFromAccountIndexTooHigh         = fmt.Errorf("FromAccountIndex should not be larger than %d", MaxAccountIndex)
	ErrApiKeyIndexTooLow               = fmt.Errorf("ApiKeyIndex should not be less than %d", MinApiKeyIndex)
	ErrApiKeyIndexTooHigh              = fmt.Errorf("ApiKeyIndex should not be larger than %d", MaxApiKeyIndex)
	ErrPublicPoolIndexTooLow           = fmt.Errorf("PublicPoolIndex should not be less than %d", MinAccountIndex)
	ErrPublicPoolIndexTooHigh          = fmt.Errorf("PublicPoolIndex should not be larger than %d", MaxAccountIndex)
	ErrInvalidPoolOperatorFee          = fmt.Errorf("PoolOperatorFee should be larger than 0 and not larger than %d", FeeTick)
	ErrInvalidPoolStatus               = fmt.Errorf("PoolStatus should be either 0 or 1")
	ErrPoolInitialTotalSharesTooLow    = fmt.Errorf("PoolInitialTotalShares should be larger than %d", MinInitialTotalShares)
	ErrPoolInitialTotalSharesTooHigh   = fmt.Errorf("PoolInitialTotalShares should not be larger than %d", MaxInitialTotalShares)
	ErrPoolMinOperatorShareRateTooLow  = fmt.Errorf("PoolMinOperatorShareRate should be larger than 0")
	ErrPoolMinOperatorShareRateTooHigh = fmt.Errorf("PoolMinOperatorShareRate should not be larger than %d", ShareTick)
	ErrPoolMintShareAmountTooLow       = fmt.Errorf("PoolMintShareAmount should be larger than %d", MinPoolSharesToMintOrBurn)
	ErrPoolMintShareAmountTooHigh      = fmt.Errorf("PoolMintShareAmount should not be larger than %d", MaxPoolSharesToMintOrBurn)
	ErrPoolBurnShareAmountTooLow       = fmt.Errorf("PoolBurnShareAmount should be larger than %d", MinPoolSharesToMintOrBurn)
	ErrPoolBurnShareAmountTooHigh      = fmt.Errorf("PoolBurnShareAmount should not be larger than %d", MaxPoolSharesToMintOrBurn)
	ErrWithdrawalAmountTooLow          = fmt.Errorf("WithdrawalAmount should be larger than %d", MinWithdrawalAmount)
	ErrWithdrawalAmountTooHigh         = fmt.Errorf("WithdrawalAmount should not be larger than %d", MaxWithdrawalAmount)
	ErrTransferAmountTooLow            = fmt.Errorf("TransferAmount should be larger than %d", MinTransferAmount)
	ErrTransferAmountTooHigh           = fmt.Errorf("TransferAmount should not be larger than %d", MaxTransferAmount)
	ErrMarketIndexTooLow               = fmt.Errorf("MarketIndex should not be less than %d", MinMarketIndex)
	ErrMarketIndexTooHigh              = fmt.Errorf("MarketIndex should not be larger than %d", MaxMarketIndex)
	ErrMarketIndexMismatch             = fmt.Errorf("MarketIndex should match the market index of the order")
	ErrInitialMarginFractionTooLow     = fmt.Errorf("InitialMarginFraction should not be less than %d", 0)
	ErrInitialMarginFractionTooHigh    = fmt.Errorf("InitialMarginFraction should not be larger than %d", MarginFractionTick)
	ErrClientOrderIndexTooLow          = fmt.Errorf("ClientOrderIndex should not be less than %d", MinClientOrderIndex)
	ErrClientOrderIndexTooHigh         = fmt.Errorf("ClientOrderIndex should not be larger than %d", MaxClientOrderIndex)
	ErrClientOrderIndexNotNil          = fmt.Errorf("ClientOrderIndex should be nil")
	ErrOrderIndexTooLow                = fmt.Errorf("OrderIndex should not be less than %d", MinOrderIndex)
	ErrOrderIndexTooHigh               = fmt.Errorf("OrderIndex should not be larger than %d", MaxOrderIndex)
	ErrBaseAmountTooLow                = fmt.Errorf("BaseAmount should not be less than %d", MinOrderBaseAmount)
	ErrBaseAmountTooHigh               = fmt.Errorf("BaseAmount should not be larger than %d", MaxOrderBaseAmount)
	ErrBaseAmountsNotEqual             = fmt.Errorf("BaseAmounts should be equal")
	ErrBaseAmountNotNil                = fmt.Errorf("BaseAmount should be nil")
	ErrPriceTooLow                     = fmt.Errorf("OrderPrice should not be less than %d", MinOrderPrice)
	ErrPriceTooHigh                    = fmt.Errorf("OrderPrice should not be larger than %d", MaxOrderPrice)
	ErrIsAskInvalid                    = fmt.Errorf("IsAsk should be 0 or 1")
	ErrOrderTypeInvalid                = fmt.Errorf("OrderType is not valid")
	ErrOrderTimeInForceInvalid         = fmt.Errorf("OrderTimeInForce is not valid")
	ErrGroupingTypeInvalid             = fmt.Errorf("GroupingType is not valid")
	ErrOrderGroupSizeInvalid           = fmt.Errorf("OrderGroupSize is not valid")
	ErrInvalidSignature                = fmt.Errorf("TxSignature is invalid")
	ErrInvalidMarginMode               = fmt.Errorf("MarginMode is not valid")
	ErrCancelModeInvalid               = fmt.Errorf("CancelMode is not valid")
	ErrInvalidUpdateMarginDirection    = fmt.Errorf("Margin movement direction is not valid")
	ErrTransferFeeNegative             = fmt.Errorf("Transfer fee is negative")
	ErrTransferFeeTooHigh              = fmt.Errorf("Transfer fee is higher than %d", MaxTransferAmount)
)
