okxweb3

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainIdToChainIndex

func ChainIdToChainIndex(chainId int64) (string, bool)

func RandomClientHelloID

func RandomClientHelloID() utls.ClientHelloID

Types

type Client

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

func NewClient

func NewClient(chainId int64, proxy config.Sock5Proxy) (*Client, error)

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(chainId int64, resolution string, proxy config.Sock5Proxy) (*OkxSubscriber, error)

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