okxweb3

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomClientHelloID

func RandomClientHelloID() utls.ClientHelloID

Types

type Client

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

func NewClient

func NewClient(proxy config.Sock5Proxy) *Client

func (*Client) FetchTokenCandles

func (c *Client) FetchTokenCandles(ctx context.Context, token string, to time.Time, interval string, limit int) ([]charts.Ohlc, error)

type KlineManager

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

func NewKlineManager

func NewKlineManager(client *Client, subscriber *OkxSubscriber, candles int) *KlineManager

func (*KlineManager) GetOhlcsChan

func (m *KlineManager) GetOhlcsChan() <-chan charts.TokenOhlcs

func (*KlineManager) Start

func (m *KlineManager) Start()

func (*KlineManager) Stop

func (m *KlineManager) Stop()

func (*KlineManager) Subscribe

func (m *KlineManager) Subscribe(assets []string) error

func (*KlineManager) Unsubscribe

func (m *KlineManager) Unsubscribe(assets []string) error

type Message

type Message struct {
	Event string          `json:"event"`
	Arg   map[string]any  `json:"arg"`
	Data  json.RawMessage `json:"data"`
}

func (Message) GetChannel

func (msg Message) GetChannel() string

func (Message) GetTokenAddress

func (msg Message) GetTokenAddress() string

type OkxSubscriber

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

func NewOkxSubscriber

func NewOkxSubscriber(resolution string, proxy config.Sock5Proxy) *OkxSubscriber

func (*OkxSubscriber) GetTickerChan

func (subscriber *OkxSubscriber) GetTickerChan() <-chan Ticker

func (*OkxSubscriber) Start

func (subscriber *OkxSubscriber) Start()

func (*OkxSubscriber) Stop

func (subscriber *OkxSubscriber) Stop()

func (*OkxSubscriber) Subscribe

func (subscriber *OkxSubscriber) Subscribe(assets []string) error

func (*OkxSubscriber) Unsubscribe

func (subscriber *OkxSubscriber) Unsubscribe(assets []string) error

func (*OkxSubscriber) WaitUntilConnected

func (subscriber *OkxSubscriber) WaitUntilConnected()

type Ticker

type Ticker struct {
	Token string
	First bool
	Ohlc  charts.Ohlc
}

Jump to

Keyboard shortcuts

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