exchange

package
v1.63.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	OptionKeyAPIKey        = "API_KEY"
	OptionKeyAPISecret     = "API_SECRET"
	OptionKeyAPIPassphrase = "API_PASSPHRASE"
	OptionKeyAPIPrivateKey = "API_PRIVATE_KEy"
)

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 New

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 Register added in v1.63.0

func Register(name types.ExchangeName, factory Factory)

Types

type Constructor added in v1.63.0

type Constructor func(Options) (types.Exchange, error)

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

type EnvLoader added in v1.63.0

type EnvLoader func(varPrefix string) (Options, 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 Factory added in v1.63.0

type Factory struct {
	EnvLoader   EnvLoader
	Constructor Constructor
}

type Options added in v1.63.0

type Options map[string]string

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

func DefaultEnvVarLoader added in v1.62.0

func DefaultEnvVarLoader(varPrefix string) (Options, 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