httplib

package module
v0.0.0-...-aaf5491 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

README

exante-golang-http-api

Golang library for XNT Ltd. HTTP API service provides access to actual endpoints (https://api-live.exante.eu/api-docs/)

Building and installation

To install golang-http-api library, use go get:

$ go get github.com/EverID/exante-golang-http-api
Staying up to date

To update to the latest version, use

$ go get -u github.com/EverID/exante-golang-http-api
Developing golang-http-api

If you wish to work on golang-http-api itself, you will first need Go installed and configured on your machine (version 1.14+ is preferred, but the minimum required version is 1.8).

Next, using Git, clone the repository via git clone command

git clone https://github.com/EverID/exante-golang-http-api.git

Basic usage

First of all you need to get ApplicationID, ClientID and SharedKey from sandbox or production enviroment. And choose one of the authorization methods. It could be BasicAuth or JWT token.

Then instantiate API with NewAPI constructor

h := NewAPI(baseAPIURL,
		"2.0",
		"56ef81eb-c534-499d-936c-a6cefb72d772",
		"8541316993680-124b-8b4c-4d642fcd4493",
		"xpeNrMLpgG3JEoWaj84",
		30, "", "",
	)

Then methods can be called. Try with GetExchanges for example:

data, err := h.GetExchanges()
	if err != nil {
		fmt.Print(err)
	} else {
		fmt.Print(data)
	}

Or order initialization:

	o := OrderSentTypeV1{
		Side:           "buy",
		Duration:       "fill_or_kill",
		Quantity:       "10",
		OrderType:      "market",
		OcoGroup:       "5",
		Account:        "5",
		Instrument:     "Test",
		IfDoneParentID: "1",
	}

	err = h.PlaceOrderV1(&o)
	if err != nil {
		fmt.Print(err)
	} else {
		fmt.Print("OK")
	}

Try to get account summary:

	accSum, err := h.GetAccountSummary("DEW8032.001", "USD",
		GetAccountSummaryPayload{
			DatetimePayload: DatetimePayload{
				Datetime: "2020-10-10",
			},
		})
	if err != nil {
		fmt.Print(err)
	} else {
		fmt.Printf("%+v\n", accSum)
	}

See more code in examples.go file

All public HTTP API methods declared in api.go file

License

Released under the GNU GPL License

Documentation

Index

Constants

View Source
const (
	// JWTDefaultTTL default lieftime of jwt token
	JWTDefaultTTL int = 30

	// APIv1 api version
	APIv1 string = "1.0"

	// APIv2 api version
	APIv2 string = "2.0"

	// APIv3 api version
	APIv3 string = "3.0"

	// BasicAuth type
	BasicAuth string = "BasicAuth"
	// JWTAuth type
	JWTAuth string = "JWTAuth"

	// MDAPICategory md api url prefix
	MDAPICategory string = "md"

	// TRADEAPICategory traders api url prefix
	TRADEAPICategory string = "trade"

	// CurrentAPIVersion default api version
	CurrentAPIVersion string = APIv2
)

Variables

View Source
var APIVersions = [3]string{APIv1, APIv2, APIv3}

APIVersions list of available api verisons

View Source
var Scopes = []string{
	"crossrates", "change", "crossrates", "summary",
	"symbols", "feed", "ohlc", "orders", "transactions",
	"accounts",
}

Scopes is JWT Auth scopes

Functions

func NewQuoteV3Arr

func NewQuoteV3Arr() *[]QuoteV3

NewQuoteV3 constructor

Types

type Ask

type Ask struct {
	Value string `json:"value"`
	Size  string `json:"size"`
}

type Auth

type Auth struct {
	JWT   JWTAuthMethod
	Basic BasicAuthMethod
}

Auth ...

type BasicAuthMethod

type BasicAuthMethod struct{ Username, Password string }

BasicAuthMethod ...

type Bid

type Bid struct {
	Value string `json:"value"`
	Size  string `json:"size"`
}

type CancelOrderPayload

type CancelOrderPayload struct {
	Action string `json:"action"`
}

CancelOrderPayload method optional payload

type ChangeV1

type ChangeV1 struct {
	BasePrice   string `json:"basePrice"`
	DailyChange string `json:"dailyChange"`
	SymbolID    string `json:"symbolId"`
}

ChangeV1 model

type ChangeV2

type ChangeV2 ChangeV1

ChangeV2 model

type ChangeV3

type ChangeV3 struct {
	LastSessionClosePrice string `json:"lastSessionClosePrice"`
	DailyChange           string `json:"dailyChange"`
	SymbolID              string `json:"symbolId"`
}

ChangeV3 model

type ChangesV1

type ChangesV1 []ChangeV1

ChangesV1 model

func NewChangesV1

func NewChangesV1() *ChangesV1

NewChangesV1 constructor

type ChangesV2

type ChangesV2 []ChangeV2

ChangesV2 model

func NewChangesV2

func NewChangesV2() *ChangesV2

NewChangesV2 constructor

type ChangesV3

type ChangesV3 []ChangeV3

ChangesV3 model

func NewChangesV3

func NewChangesV3() *ChangesV3

NewChangesV3 constructor

type Currency

type Currency string

Currency ..

type CurrencyPos

type CurrencyPos struct {
	Code           string `json:"code"`
	Value          string `json:"value"`
	ConvertedValue string `json:"convertedValue"`
}

CurrencyPos model

type DatetimePayload

type DatetimePayload struct {
	Datetime string `json:"datetime"`
}

DatetimePayload datetime optional field for requests

type DatetimeRangePayload

type DatetimeRangePayload struct{ From, To int }

DatetimeRangePayload optional query params for requsts

type Exchange

type Exchange struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Country string `json:"country"`
}

Exchange model

type Exchanges

type Exchanges []Exchange

Exchanges model

func NewExchanges

func NewExchanges() *Exchanges

NewExchanges constructor

type GetAccountSummaryPayload

type GetAccountSummaryPayload struct {
	DatetimePayload
	Currency string
}

GetAccountSummaryPayload input params for GetAccountSummary method

type GetActiveOrderPayload

type GetActiveOrderPayload struct {
	Account, SymbolID string
	Limit             ResponseLimit
}

GetActiveOrderPayload optional input params for GetActiveOrder method

type GetOHLCOptionalPayload

type GetOHLCOptionalPayload struct {
	ResponseLimit
	StartStopOptionalPayload
}

GetOHLCOptionalPayload optional params for ohcl methods

type GetOrdersPayload

type GetOrdersPayload struct {
	Account string
	Limit   ResponseLimit
	DatetimeRangePayload
}

GetOrdersPayload input params for GetOrders method

type GetTicksByQuotesPayload

type GetTicksByQuotesPayload GetOHLCOptionalPayload

GetTicksByQuotesPayload method optional payload

type GetTicksByTradesPayload

type GetTicksByTradesPayload GetTicksByQuotesPayload

GetTicksByTradesPayload method optional payload

type GetTransactionsOptionalPayload

type GetTransactionsOptionalPayload struct {
	OrderPos                             int
	Account, UUID, Asset, OrderID, Order string
	OffsetLimit                          OffsetLimitPayload
	DatetimeRangePayload
}

GetTransactionsOptionalPayload optional params for GetTransactions endpoint function

type Group

type Group struct {
	Group    string   `json:"group"`
	Name     string   `json:"name"`
	Exchange string   `json:"exchange"`
	Types    []string `json:"types"`
}

Group model

type Groups

type Groups []Group

Groups model

func NewGroups

func NewGroups() *Groups

NewGroups constructor

type HTTPApi

type HTTPApi struct {
	Auth Auth
	// contains filtered or unexported fields
}

HTTPApi struct provide communication with xnt services

func NewAPI

func NewAPI(
	baseAPIURL, version,
	ApplicationID, ClientID, SharedKey string,
	JwtTTL int,
	BasicAuthUsername, BasicAuthPassword string) HTTPApi

NewAPI constructor for lib

func (HTTPApi) CancelOrder

func (h HTTPApi) CancelOrder(orderID string, c CancelOrderPayload) error

CancelOrder cancel trading order

func (HTTPApi) GetAccountSummary

func (h HTTPApi) GetAccountSummary(account, currency string,
	p GetAccountSummaryPayload) (interface{}, error)

GetAccountSummary return the summary for the specified account

func (HTTPApi) GetActiveOrdersV1

func (h HTTPApi) GetActiveOrdersV1() (*OrdersV1, error)

GetActiveOrdersV1 return the list of active trading orders

func (HTTPApi) GetActiveOrdersV2

func (h HTTPApi) GetActiveOrdersV2() (*OrdersV2, error)

GetActiveOrdersV2 return the list of active trading orders

func (HTTPApi) GetActiveOrdersV3

func (h HTTPApi) GetActiveOrdersV3() (*OrdersV3, error)

GetActiveOrdersV3 return the list of active trading orders

func (HTTPApi) GetChangesV1

func (h HTTPApi) GetChangesV1(symbolIDs ...string) (*ChangesV1, error)

GetChangesV1 return the list of daily changes for all or requested instruments

func (HTTPApi) GetChangesV2

func (h HTTPApi) GetChangesV2(symbolIDs ...string) (*ChangesV2, error)

GetChangesV2 return the list of daily changes for all or requested instruments

func (HTTPApi) GetChangesV3

func (h HTTPApi) GetChangesV3(symbolIDs ...string) (*ChangesV3, error)

GetChangesV3 return the list of daily changes for all or requested instruments

func (HTTPApi) GetCurrencies

func (h HTTPApi) GetCurrencies() (*Сurrencys, error)

GetCurrencies return the list of available currencies

func (HTTPApi) GetExchanges

func (h HTTPApi) GetExchanges() (*Exchanges, error)

GetExchanges return list of exchanges

func (HTTPApi) GetExecOrdersStream

func (h HTTPApi) GetExecOrdersStream() (chan []byte, chan bool)

GetExecOrdersStream return the life quote stream for the specified financial instruments

func (HTTPApi) GetGroups

func (h HTTPApi) GetGroups() (*Groups, error)

GetGroups return list of available instrument groups

func (HTTPApi) GetLastQuote

func (h HTTPApi) GetLastQuote(symbol string) (*Quote, error)

GetLastQuote return the last quote for the specified financial instrument

func (HTTPApi) GetLastQuoteV3

func (h HTTPApi) GetLastQuoteV3(symbol string) ([]QuoteV3, error)

GetLastQuoteV3 return the last quote for the specified financial instrument

func (HTTPApi) GetNearestV1

func (h HTTPApi) GetNearestV1(group string) (*SymbolsV1, error)

GetNearestV1 return financial instrument which has the nearest expiration in the group

func (HTTPApi) GetNearestV2

func (h HTTPApi) GetNearestV2(group string) (*SymbolsV2, error)

GetNearestV2 return financial instrument which has the nearest expiration in the group

func (HTTPApi) GetNearestV3

func (h HTTPApi) GetNearestV3(group string) (*SymbolsV3, error)

GetNearestV3 return financial instrument which has the nearest expiration in the group

func (HTTPApi) GetOHLCQuotes

func (h HTTPApi) GetOHLCQuotes(symbol string, duration int,
	g GetOHLCOptionalPayload) (*OHLCQuotes, error)

GetOHLCQuotes return the list of OHLC candles for the specified financial instrument and duration

func (HTTPApi) GetOHLCTrades

func (h HTTPApi) GetOHLCTrades(symbol string, duration int,
	g GetOHLCOptionalPayload) (*OHLCTrades, error)

GetOHLCTrades return the list of OHLC candles for the specified financial instrument and duration

func (HTTPApi) GetOrderV1

func (h HTTPApi) GetOrderV1(orderID string) (*OrderV1, error)

GetOrderV1 return the order with specified identifier

func (HTTPApi) GetOrderV2

func (h HTTPApi) GetOrderV2(orderID string) (*OrderV2, error)

GetOrderV2 return the order with specified identifier

func (HTTPApi) GetOrderV3

func (h HTTPApi) GetOrderV3(orderID string) (*OrderV3, error)

GetOrderV3 return the order with specified identifier

func (HTTPApi) GetOrdersStream

func (h HTTPApi) GetOrdersStream() (chan []byte, chan bool)

GetOrdersStream return the life quote stream for the specified financial instruments

func (HTTPApi) GetOrdersV1

func (h HTTPApi) GetOrdersV1(g GetOrdersPayload) (*OrdersV1, error)

GetOrdersV1 return the list of historical orders

func (HTTPApi) GetOrdersV2

func (h HTTPApi) GetOrdersV2(g GetOrdersPayload) (*OrdersV2, error)

GetOrdersV2 return the list of historical orders

func (HTTPApi) GetOrdersV3

func (h HTTPApi) GetOrdersV3(g GetOrdersPayload) (*OrdersV3, error)

GetOrdersV3 return the list of historical orders

func (HTTPApi) GetQuoteStream

func (h HTTPApi) GetQuoteStream() (chan []byte, chan bool)

GetQuoteStream return the life quote stream for the specified financial instruments

func (HTTPApi) GetSymbolSpec

func (h HTTPApi) GetSymbolSpec(symbol string) (*SymbolSpecification, error)

GetSymbolSpec return additional parameters for requested instrument

func (HTTPApi) GetSymbolV1

func (h HTTPApi) GetSymbolV1(symbolID string) (*SymbolV1, error)

GetSymbolV1 return instrument available for authorized user

func (HTTPApi) GetSymbolV2

func (h HTTPApi) GetSymbolV2(symbolID string) (*SymbolV2, error)

GetSymbolV2 return instrument available for authorized user

func (HTTPApi) GetSymbolV3

func (h HTTPApi) GetSymbolV3(symbolID string) (*SymbolV3, error)

GetSymbolV3 return instrument available for authorized user

func (HTTPApi) GetSymbolsByExchV1

func (h HTTPApi) GetSymbolsByExchV1(exchange string) (*SymbolsV1, error)

GetSymbolsByExchV1 return the requested exchange financial instruments

func (HTTPApi) GetSymbolsByExchV2

func (h HTTPApi) GetSymbolsByExchV2(exchange string) (*SymbolsV2, error)

GetSymbolsByExchV2 return the requested exchange financial instruments

func (HTTPApi) GetSymbolsByExchV3

func (h HTTPApi) GetSymbolsByExchV3(exchange string) (*SymbolsV3, error)

GetSymbolsByExchV3 return the requested exchange financial instruments

func (HTTPApi) GetSymbolsByGroupV1

func (h HTTPApi) GetSymbolsByGroupV1(group string) (*SymbolsV1, error)

GetSymbolsByGroupV1 return financial instruments which belong to specified group

func (HTTPApi) GetSymbolsByGroupV2

func (h HTTPApi) GetSymbolsByGroupV2(group string) (*SymbolsV2, error)

GetSymbolsByGroupV2 return financial instruments which belong to specified group

func (HTTPApi) GetSymbolsByGroupV3

func (h HTTPApi) GetSymbolsByGroupV3(group string) (*SymbolsV3, error)

GetSymbolsByGroupV3 return financial instruments which belong to specified group

func (HTTPApi) GetSymbolsByTypeV1

func (h HTTPApi) GetSymbolsByTypeV1(symbolType string) (*SymbolsV1, error)

GetSymbolsByTypeV1 return financial instruments of the requested type symbolType: instument type like STOCK, FUTURE, BOND, CURRENCY etc

func (HTTPApi) GetSymbolsByTypeV2

func (h HTTPApi) GetSymbolsByTypeV2(symbolType string) (*SymbolsV2, error)

GetSymbolsByTypeV2 return financial instruments of the requested type symbolType: instument types like STOCK, FUTURE, BOND, CURRENCY etc

func (HTTPApi) GetSymbolsByTypeV3

func (h HTTPApi) GetSymbolsByTypeV3(symbolType string) (*SymbolsV3, error)

GetSymbolsByTypeV3 return financial instruments of the requested type symbolType: instument types like STOCK, FUTURE, BOND, CURRENCY etc

func (HTTPApi) GetSymbolsV1

func (h HTTPApi) GetSymbolsV1() (*SymbolsV1, error)

GetSymbolsV1 return list of instruments available for authorized user

func (HTTPApi) GetSymbolsV2

func (h HTTPApi) GetSymbolsV2() (*SymbolsV1, error)

GetSymbolsV2 return list of instruments available for authorized user

func (HTTPApi) GetSymbolsV3

func (h HTTPApi) GetSymbolsV3() (*SymbolsV3, error)

GetSymbolsV3 return list of instruments available for authorized user

func (HTTPApi) GetSymbolschedule

func (h HTTPApi) GetSymbolschedule(
	symbolID string, useTypes bool) (*Schedule, error)

GetSymbolschedule return financial schedule for requested instrument

func (HTTPApi) GetTicksByQuotes

func (h HTTPApi) GetTicksByQuotes(
	symbol string, g GetTicksByQuotesPayload) (interface{}, error)

GetTicksByQuotes return the list of ticks for the specified financial instrument aggregated by quotes data type

func (HTTPApi) GetTicksByTrades

func (h HTTPApi) GetTicksByTrades(
	symbol string, g GetTicksByTradesPayload) (interface{}, error)

GetTicksByTrades return the list of ticks for the specified financial instrument aggregated by trades data type

func (HTTPApi) GetTradeStream

func (h HTTPApi) GetTradeStream(symbol string) (chan []byte, chan bool)

GetTradeStream return the trades stream for the specified financial instruments

func (HTTPApi) GetTransactionsV1

func (h HTTPApi) GetTransactionsV1(symbol string, opType []string,
	p GetTransactionsOptionalPayload) (*TransactionsV1, error)

GetTransactionsV1 return the list of transactions with the specified filter

func (HTTPApi) GetTransactionsV2

func (h HTTPApi) GetTransactionsV2(symbol string, opType []string,
	p GetTransactionsOptionalPayload) (*TransactionsV2, error)

GetTransactionsV2 return the list of transactions with the specified filter

func (HTTPApi) GetTransactionsV3

func (h HTTPApi) GetTransactionsV3(symbol string, opType []string,
	p GetTransactionsOptionalPayload) (*TransactionsV3, error)

GetTransactionsV3 return the list of transactions with the specified filter

func (HTTPApi) GetTypes

func (h HTTPApi) GetTypes() (*Types, error)

GetTypes return list of known instrument types

func (HTTPApi) GetUserAccounts

func (h HTTPApi) GetUserAccounts() (*UserAccounts, error)

GetUserAccounts return the list of user accounts and their statuses

func (HTTPApi) PlaceOrderV1

func (h HTTPApi) PlaceOrderV1(o *OrderSentTypeV1) error

PlaceOrderV1 place new trading OrderV1

func (HTTPApi) PlaceOrderV2

func (h HTTPApi) PlaceOrderV2(o *OrderSentTypeV2) error

PlaceOrderV2 place new trading OrderV2

func (HTTPApi) PlaceOrderV3

func (h HTTPApi) PlaceOrderV3(o *OrderSentTypeV3) ([]OrderV3Response, error)

PlaceOrderV3 place new trading OrderV3

func (HTTPApi) ReplaceOrder

func (h HTTPApi) ReplaceOrder(orderID string, r ReplaceOrderPayload) error

ReplaceOrder replace trading order

type IAuth

type IAuth interface {
	// contains filtered or unexported methods
}

IAuth ...

type JWTAuthMethod

type JWTAuthMethod struct {
	ApplicationID, ClientID, SharedKey string
	JwtTTL                             int
}

JWTAuthMethod ...

type OHLCQuote

type OHLCQuote struct {
	Open      int `json:"open_"`
	Low       int `json:"low"`
	High      int `json:"high"`
	Close     int `json:"close"`
	Timestamp int `json:"timestamp"`
}

OHLCQuote model

type OHLCQuotes

type OHLCQuotes []OHLCQuote

OHLCQuotes models

func NewOHLCQuotes

func NewOHLCQuotes() *OHLCQuotes

NewOHLCQuotes constructor

type OHLCTrade

type OHLCTrade struct {
	Open      int    `json:"open_"`
	Low       int    `json:"low"`
	High      int    `json:"high"`
	Close     int    `json:"close"`
	Timestamp int    `json:"timestamp"`
	Volume    string `json:"volume"`
}

OHLCTrade model

type OHLCTrades

type OHLCTrades []OHLCTrade

OHLCTrades model

func NewOHLCTrades

func NewOHLCTrades() *OHLCTrades

NewOHLCTrades constructor

type OffsetLimitPayload

type OffsetLimitPayload struct{ Offset, Limit int }

OffsetLimitPayload offset and limit optional params

type OrderFill

type OrderFill struct {
	Quantity string `json:"quantity"`
	Price    string `json:"price"`
	Time     string `json:"timestamp"`
	Position int    `json:"position"`
}

OrderFill model

type OrderParameters

type OrderParameters struct {
	Side           string `json:"side"`
	Duration       string `json:"duration"`
	Quantity       string `json:"quantity"`
	Instrument     string `json:"instrument"`
	OrderType      string `json:"orderType"`
	OcoGroup       string `json:"ocoGroup"`
	IfDoneParentID string `json:"ifDoneParentId"`
	LimitPrice     string `json:"limitPrice"`
	StopPrice      string `json:"stopPrice"`
	PriceDistance  string `json:"priceDistance"`
	PartQuantity   string `json:"partQuantity"`
	PlaceInterval  string `json:"placeInterval"`
}

OrderParameters model

type OrderSentTypeV1

type OrderSentTypeV1 struct {
	Account        string `json:"account"`
	Instrument     string `json:"instrument"`
	Side           string `json:"side"`
	Quantity       string `json:"quantity"`
	Duration       string `json:"duration"`
	ClientTag      string `json:"clientTag"`
	OcoGroup       string `json:"ocoGroup"`
	IfDoneParentID string `json:"ifDoneParentId"`
	OrderType      string `json:"orderType"`
}

OrderSentTypeV1 model

type OrderSentTypeV2

type OrderSentTypeV2 struct {
	AccountID      string `json:"accountId"`
	Instrument     string `json:"instrument"`
	Side           string `json:"side"`
	Quantity       string `json:"quantity"`
	Duration       string `json:"duration"`
	ClientTag      string `json:"clientTag"`
	OcoGroup       string `json:"ocoGroup"`
	IfDoneParentID string `json:"ifDoneParentId"`
	OrderType      string `json:"orderType"`
	TakeProfit     string `json:"takeProfit"`
	StopLoss       string `json:"stopLoss"`
}

OrderSentTypeV2 model

type OrderSentTypeV3

type OrderSentTypeV3 struct {
	AccountID      string `json:"accountId"`
	Instrument     string `json:"instrument"`
	Side           string `json:"side"`
	Quantity       string `json:"quantity"`
	Duration       string `json:"duration"`
	ClientTag      string `json:"clientTag,omitempty"`
	OcoGroup       string `json:"ocoGroup,omitempty"`
	IfDoneParentID string `json:"ifDoneParentId,omitempty"`
	OrderType      string `json:"orderType"`
	TakeProfit     string `json:"takeProfit,omitempty"`
	StopLoss       string `json:"stopLoss,omitempty"`
	SymbolID       string `json:"symbolId"`
	LimitPrice     string `json:"limitPrice"`
}

OrderSentTypeV3 model

type OrderState

type OrderState struct {
	Fills []OrderFill `json:"fills"`

	Status     string `json:"status"`
	LastUpdate string `json:"lastUpdate"`
}

OrderState model

type OrderV1

type OrderV1 struct {
	OrderState      OrderState      `json:"orderState"`
	OrderParameters OrderParameters `json:"orderParameters"`

	PlaceTime             string `json:"placeTime"`
	OrderID               string `json:"orderId"`
	ClientTag             string `json:"clientTag"`
	CurrentModificationID string `json:"currentModificationId"`
	ExanteAccount         string `json:"exanteAccount"`
	Username              string `json:"username"`
}

OrderV1 model

func NewOrderV1

func NewOrderV1() *OrderV1

NewOrderV1 constructor

type OrderV2

type OrderV2 struct {
	OrderState      OrderState      `json:"orderState"`
	OrderParameters OrderParameters `json:"orderParameters"`

	OrderID               string `json:"orderId"`
	PlaceTime             string `json:"placeTime"`
	AccountID             string `json:"accountId"`
	ClientTag             string `json:"clientTag"`
	CurrentModificationID string `json:"currentModificationId"`
	ExanteAccount         string `json:"exanteAccount"`
	Username              string `json:"username"`
	ID                    string `json:"id"`
}

OrderV2 model

func NewOrderV2

func NewOrderV2() *OrderV2

NewOrderV2 constructor

type OrderV3

type OrderV3 struct {
	OrderState      OrderState      `json:"orderState"`
	OrderParameters OrderParameters `json:"orderParameters"`

	OrderID               string `json:"orderId"`
	PlaceTime             string `json:"placeTime"`
	AccountID             string `json:"accountId"`
	ClientTag             string `json:"clientTag"`
	CurrentModificationID string `json:"currentModificationId"`
	ExanteAccount         string `json:"exanteAccount"`
	Username              string `json:"username"`
}

OrderV3 model

func NewOrderV3

func NewOrderV3() *OrderV3

NewOrderV3 constructor

type OrderV3Response

type OrderV3Response struct {
	OrderID string `json:"orderId"`
}

OrdersV3 response

type OrdersV1

type OrdersV1 []OrderV1

OrdersV1 model

func NewOrdersV1

func NewOrdersV1() *OrdersV1

NewOrdersV1 constructor

type OrdersV2

type OrdersV2 []OrderV2

OrdersV2 model

func NewOrdersV2

func NewOrdersV2() *OrdersV2

NewOrdersV2 constructor

type OrdersV3

type OrdersV3 []OrderV3

OrdersV3 model

func NewOrdersV3

func NewOrdersV3() *OrdersV3

NewOrdersV3 constructor

type Period

type Period struct {
	Start string `json:"start"`
	Stop  string `json:"stop"`
}

Period - part of schedule

type Position

type Position struct {
	ID             string `json:"id"`
	SymbolType     string `json:"symbolType"`
	Currency       string `json:"currency"`
	Price          string `json:"price"`
	AveragePrice   string `json:"averagePrice"`
	Quantity       string `json:"quantity"`
	Value          string `json:"value"`
	ConvertedValue string `json:"convertedValue"`
	PNL            string `json:"pnl"`
	ConvertedPNL   string `json:"convertedPnl"`
}

Position model

type QueryStringParams

type QueryStringParams map[string]string

QueryStringParams like ?foo=bar/

type Quote

type Quote struct {
	Timestamp int    `json:"timestamp"`
	SymbolID  int    `json:"symbolId"`
	Bid       string `json:"bid"`
	Ask       string `json:"ask"`
}

Quote model

func NewQuote

func NewQuote() *Quote

NewQuote constructor

type QuoteV3

type QuoteV3 struct {
	Timestamp int64  `json:"timestamp"`
	SymbolID  string `json:"symbolId"`
	Bid       []Bid  `json:"bid"`
	Ask       []Ask  `json:"ask"`
}

QuoteV3 model

type ReplaceOrderPayload

type ReplaceOrderPayload struct {
	CancelOrderPayload
	Quantity      int    `json:"quantity"`
	LimitPrice    string `json:"limitPrice"`
	StopPrice     string `json:"stopPrice"`
	PriceDistance string `json:"priceDistance"`
}

ReplaceOrderPayload method optional payload

type ResponseLimit

type ResponseLimit struct{ Limit int }

ResponseLimit max size of response

type Schedule

type Schedule struct {
	Period []Period

	Name       string `json:"name"`
	OrderTypes string `json:"orderTypes"`
}

Schedule model

func NewSchedule

func NewSchedule() *Schedule

NewSchedule constructor

type StartStopOptionalPayload

type StartStopOptionalPayload struct{ Start, Stop int }

StartStopOptionalPayload optional params

type Summary

type Summary struct {
	Currencies []CurrencyPos `json:"currencies"`
	Positions  []Position    `json:"positions"`

	Account            string `json:"account"`
	SessionDate        string `json:"sessionDate"`
	FreeMoney          string `json:"freeMoney"`
	Timestamp          int    `json:"timestamp"`
	NetAssetValue      string `json:"netAssetValue"`
	MarginUtilization  string `json:"marginUtilization"`
	MoneyUsedForMargin string `json:"moneyUsedForMargin"`
	Currency           string `json:"currency"`
}

Summary model

func NewSummary

func NewSummary() *Summary

NewSummary constructor

type SymbolOptionData

type SymbolOptionData struct {
	OptionIDGroup string  `json:"optionGroupId"`
	Right         string  `json:"right"`
	StrikePrice   float64 `json:"strikePrice"`
}

SymbolOptionData optionals params for symbol

type SymbolOptionDataV2

type SymbolOptionDataV2 struct {
	OptionIDGroup string `json:"optionGroupId"`
	Right         string `json:"right"`
	StrikePrice   string `json:"strikePrice"`
}

SymbolOptionDataV2 ...

type SymbolOptionDataV3

type SymbolOptionDataV3 struct {
	OptionIDGroup string `json:"optionGroupId"`
	OptionRight   string `json:"optionRight"`
	StrikePrice   string `json:"strikePrice"`
}

SymbolOptionDataV3 optionals params for symbol (api v3)

type SymbolSpecification

type SymbolSpecification struct {
	Leverage           string `json:"leverage"`
	ContractMultiplier string `json:"contractMultiplier"`
	PriceUnit          string `json:"priceUnit"`
	Units              string `json:"unitd"`
	LotSize            string `json:"lotSize"`
}

SymbolSpecification model

func NewSymbolSpecification

func NewSymbolSpecification() *SymbolSpecification

NewSymbolSpecification constructor

type SymbolV1

type SymbolV1 struct {
	SymbolOptionData `json:"optionData"`
	Name             string  `json:"name"`
	Description      string  `json:"description"`
	Country          string  `json:"country"`
	Exchange         string  `json:"exchange"`
	ID               string  `json:"id"`
	Currency         string  `json:"currency"`
	Mpi              float64 `json:"mpi"`
	Type             string  `json:"type"`
	Ticker           string  `json:"ticker"`
	Expiration       float64 `json:"expiration"`
	Group            string  `json:"group"`
}

SymbolV1 model

func NewSymbolV1

func NewSymbolV1() *SymbolV1

NewSymbolV1 constructor

type SymbolV2

type SymbolV2 struct {
	SymbolOptionDataV2 `json:"optionData"`
	Name               string  `json:"name"`
	Description        string  `json:"description"`
	Country            string  `json:"country"`
	Exchange           string  `json:"exchange"`
	ID                 string  `json:"id"`
	Currency           string  `json:"currency"`
	Mpi                string  `json:"mpi"`
	Type               string  `json:"type"`
	Ticker             string  `json:"ticker"`
	Expiration         float64 `json:"expiration"`
	Group              string  `json:"group"`
}

SymbolV2 model

func NewSymbolV2

func NewSymbolV2() *SymbolV2

NewSymbolV2 constructor

type SymbolV3

type SymbolV3 struct {
	SymbolOptionDataV3 `json:"optionData"`
	Name               string  `json:"name"`
	Description        string  `json:"description"`
	Country            string  `json:"country"`
	Exchange           string  `json:"exchange"`
	MinPriceIncrement  string  `json:"minPriceIncrement"`
	Currency           string  `json:"currency"`
	SymbolType         string  `json:"symbolType"`
	Ticker             string  `json:"ticker"`
	Expiration         float64 `json:"expiration"`
	Group              string  `json:"group"`
	UnderlyingID       string  `json:"underlyingSymbolId`
}

SymbolV3 model

func NewSymbolV3

func NewSymbolV3() *SymbolV3

NewSymbolV3 constructor

type SymbolsV1

type SymbolsV1 []SymbolV1

SymbolsV1 model

func NewSymbolsV1

func NewSymbolsV1() *SymbolsV1

NewSymbolsV1 constructor

type SymbolsV2

type SymbolsV2 []SymbolV2

SymbolsV2 model

func NewSymbolsV2

func NewSymbolsV2() *SymbolsV2

NewSymbolsV2 constructor

type SymbolsV3

type SymbolsV3 []SymbolV3

SymbolsV3 model

func NewSymbolsV3

func NewSymbolsV3() *SymbolsV3

NewSymbolsV3 constructor

type TransactionV1

type TransactionV1 struct {
	OperationType string  `json:"operationType"`
	ID            string  `json:"id"`
	Asset         string  `json:"asset"`
	When          int     `json:"when"`
	Sum           float64 `json:"sum"`
	SymbolID      string  `json:"symbolId"`
	AccountID     string  `json:"accountId"`
	OrderID       string  `json:"orderId"`
	OrderPos      int     `json:"orderPos"`
	UUID          string  `json:"uuid"`
}

TransactionV1 model

type TransactionV2

type TransactionV2 TransactionV1

TransactionV2 model

type TransactionV3

type TransactionV3 struct {
	OperationType string  `json:"operationType"`
	ID            string  `json:"id"`
	Asset         string  `json:"asset"`
	SymbolID      string  `json:"symbolId"`
	AccountID     string  `json:"accountId"`
	Timestamp     int     `json:"timestamp"`
	Sum           float64 `json:"sum"`
	OrderID       string  `json:"orderId"`
	OrderPos      int     `json:"orderPos"`
	UUID          string  `json:"uuid"`
}

TransactionV3 model

type TransactionsV1

type TransactionsV1 []TransactionV1

TransactionsV1 model

func NewTransactionsV1

func NewTransactionsV1() *TransactionsV1

NewTransactionsV1 constructor

type TransactionsV2

type TransactionsV2 []TransactionV2

TransactionsV2 model

func NewTransactionsV2

func NewTransactionsV2() *TransactionsV2

NewTransactionsV2 constructor

type TransactionsV3

type TransactionsV3 []TransactionV3

TransactionsV3 model

func NewTransactionsV3

func NewTransactionsV3() *TransactionsV3

NewTransactionsV3 constructor

type Type

type Type struct {
	ID string `json:"id"`
}

Type concrete knows type

type Types

type Types []Type

Types known type

func NewTypes

func NewTypes() *Types

NewTypes constructor

type UserAccount

type UserAccount struct {
	Status    string `json:"status"`
	AccountID string `json:"accountId"`
}

UserAccount model

type UserAccounts

type UserAccounts []UserAccount

UserAccounts model

func NewUserAccounts

func NewUserAccounts() *UserAccounts

NewUserAccounts constructor

type Сurrencys

type Сurrencys struct {
	Currencies []Currency `json:"currencies"`
}

Сurrencys model

func NewСurrencys

func NewСurrencys() *Сurrencys

NewСurrencys constructor

Jump to

Keyboard shortcuts

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