exchange

package
v1.62.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: AGPL-3.0 Imports: 11 Imported by: 6

Documentation

Index

Constants

View Source
const (
	ExchangeOptionsKeyAPIKey        = "API_KEY"
	ExchangeOptionsKeyAPISecret     = "API_SECRET"
	ExchangeOptionsKeyAPIPassphrase = "API_PASSPHRASE"
)

Variables

This section is empty.

Functions

func GetSessionAttributes added in v1.37.0

func GetSessionAttributes(exchange types.Exchange) (isMargin, isFutures, isIsolated bool, isolatedSymbol string)

func IsMaxExchange added in v1.58.0

func IsMaxExchange(exchange interface{}) bool

func NewPublic

func NewPublic(exchangeName types.ExchangeName) (types.Exchange, error)

func NewWithEnvVarPrefix

func NewWithEnvVarPrefix(n types.ExchangeName, varPrefix string) (types.ExchangeMinimal, error)

NewWithEnvVarPrefix allocate and initialize the exchange instance with the given environment variable prefix When the varPrefix is a empty string, the default exchange name will be used as the prefix

func RegisterExchange added in v1.62.0

func RegisterExchange(name types.ExchangeName, factory ExchangeFactory)

Types

type ExchangeConstructor added in v1.62.0

type ExchangeConstructor func(ExchangeOptions) (types.Exchange, error)

ExchangeConstructor is a function type to create an exchange instance with the given options

type ExchangeEnvLoader added in v1.62.0

type ExchangeEnvLoader func(varPrefix string) (ExchangeOptions, error)

ExchangeEnvLoader is a function type to load exchange options from environment variables According to pkg/bbgo/environment.go, we must to get the environment variable with %s-api-key so that we can add this custom exchange.

type ExchangeFactory added in v1.62.0

type ExchangeFactory struct {
	EnvLoader   ExchangeEnvLoader
	Constructor ExchangeConstructor
}

type ExchangeOptions added in v1.62.0

type ExchangeOptions map[string]string

ExchangeOptions is a map of exchange options used to initialize an exchange

func DefaultEnvVarLoader added in v1.62.0

func DefaultEnvVarLoader(varPrefix string) (ExchangeOptions, error)

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
max
Code generated by go:generate; DO NOT EDIT.
Code generated by go:generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.

Jump to

Keyboard shortcuts

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