types

package
v0.0.0-...-b6e08ef Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 4 Imported by: 8

Documentation

Index

Constants

View Source
const (
	ApiHostMainnet = "https://api.dydx.exchange"
	ApiHostRopsten = "https://api.stage.dydx.exchange"
	WsHostMainnet  = "wss://api.dydx.exchange/v3/ws"
	WsHostRopsten  = "wss://api.stage.dydx.exchange/v3/ws"
)
View Source
const (
	SignatureTypeNoPrepend   = 0
	SignatureTypeDecimal     = 1
	SignatureTypeHexadecimal = 2
)
View Source
const (
	Domain                       = "dYdX"
	Version                      = "1.0"
	Eip712DomainStringNoContract = "EIP712Domain(string name,string version,uint256 chainId)"
)
View Source
const (
	OffChainOnboardingAction    = "dYdX Onboarding"
	OffChainKeyDerivationAction = "dYdX STARK Key"
)
View Source
const (
	NetworkIdMainnet = 1
	NetworkIdRopsten = 3
)
View Source
const (
	OPEN        = "OPEN"
	CLOSED      = "CLOSED"
	LIQUIDATED  = "LIQUIDATED"
	LIQUIDATION = "LIQUIDATION"
	UNTRIGGERED = "UNTRIGGERED"
)
View Source
const (
	MARKET       = "MARKET"
	LIMIT        = "LIMIT"
	STOP         = "STOP"
	STOPLIMIT    = "STOP_LIMIT"
	TRAILINGSTOP = "TRAILING_STOP"
	TAKEPROFIT   = "TAKE_PROFIT"
)
View Source
const (
	BUY  = "BUY"
	SELL = "SELL"
)
View Source
const (
	LONG  = "LONG"
	SHORT = "SHORT"
)
View Source
const (
	TimeInForceGtt = "GTT"
	TimeInForceFok = "FOK"
	TimeInForceIoc = "IOC"
)
View Source
const (
	OrderStatusPending     = "PENDING"
	OrderStatusOpen        = "OPEN"
	OrderStatusFilled      = "FILLED"
	OrderStatusCanceled    = "CANCELED"
	OrderStatusUntriggered = "UNTRIGGERED"
)
View Source
const (
	Resolution1D     = "1DAY"
	Resolution4HOURS = "4HOURS"
	Resolution1HOUR  = "1HOUR"
	Resolution30MINS = "30MINS"
	Resolution15MINS = "15MINS"
	Resolution5MINS  = "5MINS"
	Resolution1MIN   = "1MIN"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKeyCredentials

type ApiKeyCredentials struct {
	Key        string
	Secret     string
	Passphrase string
}

type Options

type Options struct {
	NetworkId              int
	Host                   string
	DefaultEthereumAddress string

	StarkPublicKey            string
	StarkPrivateKey           string
	StarkPublicKeyYCoordinate string
	ApiKeyCredentials         *ApiKeyCredentials

	Web3       *jsonrpc.Client
	HttpClient *http.Client
	Logger     *log.Logger
}

type RateLimit

type RateLimit struct {
	Remaining  string
	Reset      string
	RetryAfter string
	Limit      string
}

func (*RateLimit) ToNumber

func (p *RateLimit) ToNumber() (remaining, reset, retryAfter, limit int64)

Jump to

Keyboard shortcuts

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