internal

package
v0.0.0-...-4d28ea6 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BybitWSOrderBookL2_25  = "orderBookL2_25"        // also publish Ticker
	BybitWSOrderBookL2_200 = "orderBookL2_25.100ms." // Not supported yet
	BybitWSKLine           = "kline"
	BybitWSTrade           = "trade"
	BybitWSInsurance       = "insurance"
	BybitWSInstrument      = "instrument"

	BybitWSPosition  = "position"
	BybitWSExecution = "execution"
	BybitWSOrder     = "order"

	BybitWSDisconnected = "disconnected"
)
View Source
const (
	UNDEFINED = iota
	ERROR
	TICKER
	TRADES
	ORDERBOOK
	ORDERS
	FILLS
	POSITIONS
)

Variables

View Source
var (
	TESTNET  = category("testnet")
	MAINNET1 = category("mainnet1")
	MAINNET2 = category("mainnet2")

	PUBLIC  = group("public")
	PRIVATE = group("private")

	PERPETUAL = base("perpetual")
	USDT      = base("usdt")
)
View Source
var (
	PERPETUAL_TESTNET     = Endpoint{"wss://stream-testnet.bybit.com/realtime", TESTNET, PUBLIC, PERPETUAL}
	PERPETUAL_MAINNET1    = Endpoint{"wss://stream.bybit.com/realtime", MAINNET1, PUBLIC, PERPETUAL}
	PERPETUAL_MAINNET2    = Endpoint{"wss://stream.bytick.com/realtime", MAINNET2, PUBLIC, PERPETUAL}
	USDT_TESTNET_PUBLIC   = Endpoint{"wss://stream-testnet.bybit.com/realtime_public", TESTNET, PUBLIC, USDT}
	USDT_TESTNET_PRIVATE  = Endpoint{"wss://stream-testnet.bybit.com/realtime_private", TESTNET, PRIVATE, USDT}
	USDT_MAINNET1_PUBLIC  = Endpoint{"wss://stream.bybit.com/realtime_public", MAINNET1, PUBLIC, USDT}
	USDT_MAINNET2_PUBLIC  = Endpoint{"wss://stream.bytick.com/realtime_public", MAINNET2, PUBLIC, USDT}
	USDT_MAINNET1_PRIVATE = Endpoint{"wss://stream.bybit.com/realtime_private", MAINNET1, PRIVATE, USDT}
	USDT_MAINNET2_PRIVATE = Endpoint{"wss://stream.bytick.com/realtime_private", MAINNET2, PRIVATE, USDT}
)

Functions

func Connect

func Connect(ctx context.Context, ch chan Responce, channels, symbols []string, cfg *Confirguration) error

func ConnectForPrivate

func ConnectForPrivate(ctx context.Context, ch chan Responce, channels []string, cfg *Confirguration) error

Types

type Confirguration

type Confirguration struct {
	// contains filtered or unexported fields
}

func Config

func Config(ops ...Option) *Confirguration

type Endpoint

type Endpoint struct {
	// contains filtered or unexported fields
}

type Option

type Option func(*Confirguration)

func EndPointOPtion

func EndPointOPtion(e Endpoint) Option

func Key

func Key(key string) Option

func SecretKey

func SecretKey(secret string) Option

type Responce

type Responce struct {
	Type      int
	Symbol    string
	Ticker    market.Ticker
	Trades    []market.Trade
	Orderbook market.OrderBook
	Orders    []market.Order
	Fills     []fill.Execution
	Positions []fill.Position
	Result    error
}

Jump to

Keyboard shortcuts

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