sharedtestvalues

package
v0.8.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WebsocketResponseDefaultTimeout used in websocket testing
	// Defines wait time for receiving websocket response before cancelling
	WebsocketResponseDefaultTimeout = (3 * time.Second)
	// WebsocketResponseExtendedTimeout used in websocket testing
	// Defines wait time for receiving websocket response before cancelling
	WebsocketResponseExtendedTimeout = (15 * time.Second)
	// WebsocketChannelOverrideCapacity used in websocket testing
	// Defines channel capacity as defaults size can block tests
	WebsocketChannelOverrideCapacity = 75

	MockTesting = "Mock testing framework in use for %s exchange on REST endpoints only"
	LiveTesting = "Mock testing bypassed; live testing of REST endpoints in use for %s exchange"
)

This package is only to be referenced in test files

Variables

This section is empty.

Functions

func GetWebsocketInterfaceChannelOverride

func GetWebsocketInterfaceChannelOverride() chan interface{}

GetWebsocketInterfaceChannelOverride returns a new interface based channel with the capacity set to WebsocketChannelOverrideCapacity

func GetWebsocketStructChannelOverride

func GetWebsocketStructChannelOverride() chan struct{}

GetWebsocketStructChannelOverride returns a new struct based channel with the capacity set to WebsocketChannelOverrideCapacity

func NewTestWebsocket

func NewTestWebsocket() *stream.Websocket

NewTestWebsocket returns a test websocket object

Types

type CustomEx

type CustomEx struct {
	exchange.Base
}

func (*CustomEx) AuthenticateWebsocket

func (c *CustomEx) AuthenticateWebsocket(ctx context.Context) error

func (*CustomEx) CancelAllOrders

func (c *CustomEx) CancelAllOrders(ctx context.Context, orders *order.Cancel) (order.CancelAllResponse, error)

func (*CustomEx) CancelBatchOrders

func (c *CustomEx) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error)

func (*CustomEx) CancelOrder

func (c *CustomEx) CancelOrder(ctx context.Context, o *order.Cancel) error

func (*CustomEx) CheckOrderExecutionLimits

func (c *CustomEx) CheckOrderExecutionLimits(a asset.Item, cp currency.Pair, price, amount float64, orderType order.Type) error

func (*CustomEx) DisableRateLimiter

func (c *CustomEx) DisableRateLimiter() error

func (*CustomEx) EnableRateLimiter

func (c *CustomEx) EnableRateLimiter() error

func (*CustomEx) FetchAccountInfo

func (c *CustomEx) FetchAccountInfo(ctx context.Context, a asset.Item) (account.Holdings, error)

func (*CustomEx) FetchOrderbook

func (c *CustomEx) FetchOrderbook(ctx context.Context, p currency.Pair, a asset.Item) (*orderbook.Base, error)

func (*CustomEx) FetchTicker

func (c *CustomEx) FetchTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)

func (*CustomEx) FetchTradablePairs

func (c *CustomEx) FetchTradablePairs(ctx context.Context, a asset.Item) ([]string, error)

func (*CustomEx) FlushWebsocketChannels

func (c *CustomEx) FlushWebsocketChannels() error

func (*CustomEx) FormatWithdrawPermissions

func (c *CustomEx) FormatWithdrawPermissions() string

func (*CustomEx) GetActiveOrders

func (c *CustomEx) GetActiveOrders(ctx context.Context, getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error)

func (*CustomEx) GetAssetTypes

func (c *CustomEx) GetAssetTypes(enabled bool) asset.Items

func (*CustomEx) GetAuthenticatedAPISupport

func (c *CustomEx) GetAuthenticatedAPISupport(endpoint uint8) bool

func (*CustomEx) GetAvailablePairs

func (c *CustomEx) GetAvailablePairs(a asset.Item) (currency.Pairs, error)

func (*CustomEx) GetBase

func (c *CustomEx) GetBase() *exchange.Base

func (*CustomEx) GetDefaultConfig

func (c *CustomEx) GetDefaultConfig() (*config.Exchange, error)

func (*CustomEx) GetDepositAddress

func (c *CustomEx) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, accountID, chain string) (*deposit.Address, error)

func (*CustomEx) GetEnabledPairs

func (c *CustomEx) GetEnabledPairs(a asset.Item) (currency.Pairs, error)

func (*CustomEx) GetFeeByType

func (c *CustomEx) GetFeeByType(ctx context.Context, f *exchange.FeeBuilder) (float64, error)

func (*CustomEx) GetFundingHistory

func (c *CustomEx) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error)

func (*CustomEx) GetHTTPClientUserAgent

func (c *CustomEx) GetHTTPClientUserAgent() string

func (*CustomEx) GetHistoricCandles

func (c *CustomEx) GetHistoricCandles(ctx context.Context, p currency.Pair, a asset.Item, timeStart, timeEnd time.Time, interval kline.Interval) (kline.Item, error)

func (*CustomEx) GetHistoricCandlesExtended

func (c *CustomEx) GetHistoricCandlesExtended(ctx context.Context, p currency.Pair, a asset.Item, timeStart, timeEnd time.Time, interval kline.Interval) (kline.Item, error)

func (*CustomEx) GetHistoricTrades

func (c *CustomEx) GetHistoricTrades(ctx context.Context, p currency.Pair, a asset.Item, startTime, endTime time.Time) ([]trade.Data, error)

func (*CustomEx) GetLastPairsUpdateTime

func (c *CustomEx) GetLastPairsUpdateTime() int64

func (*CustomEx) GetName

func (c *CustomEx) GetName() string

func (*CustomEx) GetOrderExecutionLimits

func (c *CustomEx) GetOrderExecutionLimits(a asset.Item, cp currency.Pair) (*order.Limits, error)

func (*CustomEx) GetOrderHistory

func (c *CustomEx) GetOrderHistory(ctx context.Context, getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error)

func (*CustomEx) GetOrderInfo

func (c *CustomEx) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error)

func (*CustomEx) GetRecentTrades

func (c *CustomEx) GetRecentTrades(ctx context.Context, p currency.Pair, a asset.Item) ([]trade.Data, error)

func (*CustomEx) GetSubscriptions

func (c *CustomEx) GetSubscriptions() ([]stream.ChannelSubscription, error)

func (*CustomEx) GetWebsocket

func (c *CustomEx) GetWebsocket() (*stream.Websocket, error)

func (*CustomEx) GetWithdrawPermissions

func (c *CustomEx) GetWithdrawPermissions() uint32

func (*CustomEx) GetWithdrawalsHistory

func (c *CustomEx) GetWithdrawalsHistory(ctx context.Context, code currency.Code) ([]exchange.WithdrawalHistory, error)

func (*CustomEx) IsAssetWebsocketSupported

func (c *CustomEx) IsAssetWebsocketSupported(aType asset.Item) bool

func (*CustomEx) IsEnabled

func (c *CustomEx) IsEnabled() bool

func (*CustomEx) IsWebsocketEnabled

func (c *CustomEx) IsWebsocketEnabled() bool

func (*CustomEx) ModifyOrder

func (c *CustomEx) ModifyOrder(ctx context.Context, action *order.Modify) (order.Modify, error)

func (*CustomEx) SetClientProxyAddress

func (c *CustomEx) SetClientProxyAddress(addr string) error

func (*CustomEx) SetDefaults

func (c *CustomEx) SetDefaults()

func (*CustomEx) SetEnabled

func (c *CustomEx) SetEnabled(bool)

func (*CustomEx) SetHTTPClientUserAgent

func (c *CustomEx) SetHTTPClientUserAgent(ua string)

func (*CustomEx) SetPairs

func (c *CustomEx) SetPairs(pairs currency.Pairs, a asset.Item, enabled bool) error

func (*CustomEx) Setup

func (c *CustomEx) Setup(exch *config.Exchange) error

func (*CustomEx) Start

func (c *CustomEx) Start(wg *sync.WaitGroup) error

func (*CustomEx) SubmitOrder

func (c *CustomEx) SubmitOrder(ctx context.Context, s *order.Submit) (order.SubmitResponse, error)

func (*CustomEx) SubscribeToWebsocketChannels

func (c *CustomEx) SubscribeToWebsocketChannels(channels []stream.ChannelSubscription) error

func (*CustomEx) SupportsAsset

func (c *CustomEx) SupportsAsset(assetType asset.Item) bool

func (*CustomEx) SupportsAutoPairUpdates

func (c *CustomEx) SupportsAutoPairUpdates() bool

func (*CustomEx) SupportsREST

func (c *CustomEx) SupportsREST() bool

func (*CustomEx) SupportsRESTTickerBatchUpdates

func (c *CustomEx) SupportsRESTTickerBatchUpdates() bool

func (*CustomEx) SupportsWebsocket

func (c *CustomEx) SupportsWebsocket() bool

func (*CustomEx) SupportsWithdrawPermissions

func (c *CustomEx) SupportsWithdrawPermissions(permissions uint32) bool

func (*CustomEx) UnsubscribeToWebsocketChannels

func (c *CustomEx) UnsubscribeToWebsocketChannels(channels []stream.ChannelSubscription) error

func (*CustomEx) UpdateAccountInfo

func (c *CustomEx) UpdateAccountInfo(ctx context.Context, a asset.Item) (account.Holdings, error)

func (*CustomEx) UpdateOrderExecutionLimits

func (c *CustomEx) UpdateOrderExecutionLimits(ctx context.Context, a asset.Item) error

func (*CustomEx) UpdateOrderbook

func (c *CustomEx) UpdateOrderbook(ctx context.Context, p currency.Pair, a asset.Item) (*orderbook.Base, error)

func (*CustomEx) UpdateTicker

func (c *CustomEx) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)

func (*CustomEx) UpdateTickers

func (c *CustomEx) UpdateTickers(ctx context.Context, a asset.Item) error

func (*CustomEx) UpdateTradablePairs

func (c *CustomEx) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error

func (*CustomEx) ValidateCredentials

func (c *CustomEx) ValidateCredentials(ctx context.Context, a asset.Item) error

func (*CustomEx) WithdrawCryptocurrencyFunds

func (c *CustomEx) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)

func (*CustomEx) WithdrawFiatFunds

func (c *CustomEx) WithdrawFiatFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)

func (*CustomEx) WithdrawFiatFundsToInternationalBank

func (c *CustomEx) WithdrawFiatFundsToInternationalBank(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL