datatypes

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClearMap_RebuildThresholdN = 10000
)
View Source
const DefaultRequestContextManagerIterationTimeout = 50 * time.Millisecond
View Source
const MinRequestContextManagerIterationTimeout = 10 * time.Millisecond

Variables

View Source
var (
	ProtoErrorCodeToString = map[ProtoErrorCode]string{
		1:  "UNKNOWN_ERROR",
		2:  "UNSUPPORTED_MESSAGE",
		3:  "INVALID_REQUEST",
		5:  "TIMEOUT_ERROR",
		6:  "ENTITY_NOT_FOUND",
		7:  "CANT_ROUTE_REQUEST",
		8:  "FRAME_TOO_LONG",
		9:  "MARKET_CLOSED",
		10: "CONCURRENT_MODIFICATION",
		11: "BLOCKED_PAYLOAD_TYPE",
	}
	ProtoErrorCodeByString = map[string]ProtoErrorCode{
		"UNKNOWN_ERROR":           1,
		"UNSUPPORTED_MESSAGE":     2,
		"INVALID_REQUEST":         3,
		"TIMEOUT_ERROR":           5,
		"ENTITY_NOT_FOUND":        6,
		"CANT_ROUTE_REQUEST":      7,
		"FRAME_TOO_LONG":          8,
		"MARKET_CLOSED":           9,
		"CONCURRENT_MODIFICATION": 10,
		"BLOCKED_PAYLOAD_TYPE":    11,
	}
)
View Source
var (
	ProtoOADayOfWeekToString = map[ProtoOADayOfWeek]string{
		0: "NONE",
		1: "MONDAY",
		2: "TUESDAY",
		3: "WEDNESDAY",
		4: "THURSDAY",
		5: "FRIDAY",
		6: "SATURDAY",
		7: "SUNDAY",
	}
	ProtoOADayOfWeekByString = map[string]ProtoOADayOfWeek{
		"NONE":      0,
		"MONDAY":    1,
		"TUESDAY":   2,
		"WEDNESDAY": 3,
		"THURSDAY":  4,
		"FRIDAY":    5,
		"SATURDAY":  6,
		"SUNDAY":    7,
	}
)
View Source
var (
	ProtoOACommissionTypeToString = map[ProtoOACommissionType]string{
		1: "USD_PER_MILLION_USD",
		2: "USD_PER_LOT",
		3: "PERCENTAGE_OFByString",
		4: "QUOTE_CCY_PER_LOT",
	}
	ProtoOACommissionTypeByString = map[string]ProtoOACommissionType{
		"USD_PER_MILLION_USD":   1,
		"USD_PER_LOT":           2,
		"PERCENTAGE_OFByString": 3,
		"QUOTE_CCY_PER_LOT":     4,
	}
)
View Source
var (
	ProtoOASymbolDistanceTypeToString = map[ProtoOASymbolDistanceType]string{
		1: "SYMBOL_DISTANCE_IN_POINTS",
		2: "SYMBOL_DISTANCE_IN_PERCENTAGE",
	}
	ProtoOASymbolDistanceTypeByString = map[string]ProtoOASymbolDistanceType{
		"SYMBOL_DISTANCE_IN_POINTS":     1,
		"SYMBOL_DISTANCE_IN_PERCENTAGE": 2,
	}
)
View Source
var (
	ProtoOAMinCommissionTypeToString = map[ProtoOAMinCommissionType]string{
		1: "CURRENCY",
		2: "QUOTE_CURRENCY",
	}
	ProtoOAMinCommissionTypeByString = map[string]ProtoOAMinCommissionType{
		"CURRENCY":       1,
		"QUOTE_CURRENCY": 2,
	}
)
View Source
var (
	ProtoOATradingModeToString = map[ProtoOATradingMode]string{
		0: "ENABLED",
		1: "DISABLED_WITHOUT_PENDINGS_EXECUTION",
		2: "DISABLED_WITH_PENDINGS_EXECUTION",
		3: "CLOSE_ONLY_MODE",
	}
	ProtoOATradingModeByString = map[string]ProtoOATradingMode{
		"ENABLED":                             0,
		"DISABLED_WITHOUT_PENDINGS_EXECUTION": 1,
		"DISABLED_WITH_PENDINGS_EXECUTION":    2,
		"CLOSE_ONLY_MODE":                     3,
	}
)
View Source
var (
	ProtoOASwapCalculationTypeToString = map[ProtoOASwapCalculationType]string{
		0: "PIPS",
		1: "PERCENTAGE",
		2: "POINTS",
	}
	ProtoOASwapCalculationTypeByString = map[string]ProtoOASwapCalculationType{
		"PIPS":       0,
		"PERCENTAGE": 1,
		"POINTS":     2,
	}
)
View Source
var (
	ProtoOAAccessRightsToString = map[ProtoOAAccessRights]string{
		0: "FULL_ACCESS",
		1: "CLOSE_ONLY",
		2: "NO_TRADING",
		3: "NO_LOGIN",
	}
	ProtoOAAccessRightsByString = map[string]ProtoOAAccessRights{
		"FULL_ACCESS": 0,
		"CLOSE_ONLY":  1,
		"NO_TRADING":  2,
		"NO_LOGIN":    3,
	}
)
View Source
var (
	ProtoOATotalMarginCalculationTypeToString = map[ProtoOATotalMarginCalculationType]string{
		0: "MAX",
		1: "SUM",
		2: "NET",
	}
	ProtoOATotalMarginCalculationTypeByString = map[string]ProtoOATotalMarginCalculationType{
		"MAX": 0,
		"SUM": 1,
		"NET": 2,
	}
)
View Source
var (
	ProtoOAAccountTypeToString = map[ProtoOAAccountType]string{
		0: "HEDGED",
		1: "NETTED",
		2: "SPREAD_BETTING",
	}
	ProtoOAAccountTypeByString = map[string]ProtoOAAccountType{
		"HEDGED":         0,
		"NETTED":         1,
		"SPREAD_BETTING": 2,
	}
)
View Source
var (
	ProtoOAPositionStatusToString = map[ProtoOAPositionStatus]string{
		1: "POSITION_STATUS_OPEN",
		2: "POSITION_STATUS_CLOSED",
		3: "POSITION_STATUS_CREATED",
		4: "POSITION_STATUS_ERROR",
	}
	ProtoOAPositionStatusByString = map[string]ProtoOAPositionStatus{
		"POSITION_STATUS_OPEN":    1,
		"POSITION_STATUS_CLOSED":  2,
		"POSITION_STATUS_CREATED": 3,
		"POSITION_STATUS_ERROR":   4,
	}
)
View Source
var (
	ProtoOATradeSideToString = map[ProtoOATradeSide]string{
		1: "BUY",
		2: "SELL",
	}
	ProtoOATradeSideByString = map[string]ProtoOATradeSide{
		"BUY":  1,
		"SELL": 2,
	}
)
View Source
var (
	ProtoOAOrderTypeToString = map[ProtoOAOrderType]string{
		1: "MARKET",
		2: "LIMIT",
		3: "STOP",
		4: "STOP_LOSS_TAKE_PROFIT",
		5: "MARKET_RANGE",
		6: "STOP_LIMIT",
	}
	ProtoOAOrderTypeByString = map[string]ProtoOAOrderType{
		"MARKET":                1,
		"LIMIT":                 2,
		"STOP":                  3,
		"STOP_LOSS_TAKE_PROFIT": 4,
		"MARKET_RANGE":          5,
		"STOP_LIMIT":            6,
	}
)
View Source
var (
	ProtoOATimeInForceToString = map[ProtoOATimeInForce]string{
		1: "GOOD_TILL_DATE",
		2: "GOOD_TILL_CANCEL",
		3: "IMMEDIATE_OR_CANCEL",
		4: "FILL_OR_KILL",
		5: "MARKET_ON_OPEN",
	}
	ProtoOATimeInForceByString = map[string]ProtoOATimeInForce{
		"GOOD_TILL_DATE":      1,
		"GOOD_TILL_CANCEL":    2,
		"IMMEDIATE_OR_CANCEL": 3,
		"FILL_OR_KILL":        4,
		"MARKET_ON_OPEN":      5,
	}
)
View Source
var (
	ProtoOAOrderStatusToString = map[ProtoOAOrderStatus]string{
		1: "ORDER_STATUS_ACCEPTED",
		2: "ORDER_STATUS_FILLED",
		3: "ORDER_STATUS_REJECTED",
		4: "ORDER_STATUS_EXPIRED",
		5: "ORDER_STATUS_CANCELLED",
	}
	ProtoOAOrderStatusByString = map[string]ProtoOAOrderStatus{
		"ORDER_STATUS_ACCEPTED":  1,
		"ORDER_STATUS_FILLED":    2,
		"ORDER_STATUS_REJECTED":  3,
		"ORDER_STATUS_EXPIRED":   4,
		"ORDER_STATUS_CANCELLED": 5,
	}
)
View Source
var (
	ProtoOAOrderTriggerMethodToString = map[ProtoOAOrderTriggerMethod]string{
		1: "TRADE",
		2: "OPPOSITE",
		3: "DOUBLE_TRADE",
		4: "DOUBLE_OPPOSITE",
	}
	ProtoOAOrderTriggerMethodByString = map[string]ProtoOAOrderTriggerMethod{
		"TRADE":           1,
		"OPPOSITE":        2,
		"DOUBLE_TRADE":    3,
		"DOUBLE_OPPOSITE": 4,
	}
)
View Source
var (
	ProtoOAExecutionTypeToString = map[ProtoOAExecutionType]string{
		2:  "ORDER_ACCEPTED",
		3:  "ORDER_FILLED",
		4:  "ORDER_REPLACED",
		5:  "ORDER_CANCELLED",
		6:  "ORDER_EXPIRED",
		7:  "ORDER_REJECTED",
		8:  "ORDER_CANCEL_REJECTED",
		9:  "SWAP",
		10: "DEPOSIT_WITHDRAW",
		11: "ORDER_PARTIAL_FILL",
		12: "BONUS_DEPOSIT_WITHDRAW",
	}
	ProtoOAExecutionTypeByString = map[string]ProtoOAExecutionType{
		"ORDER_ACCEPTED":         2,
		"ORDER_FILLED":           3,
		"ORDER_REPLACED":         4,
		"ORDER_CANCELLED":        5,
		"ORDER_EXPIRED":          6,
		"ORDER_REJECTED":         7,
		"ORDER_CANCEL_REJECTED":  8,
		"SWAP":                   9,
		"DEPOSIT_WITHDRAW":       10,
		"ORDER_PARTIAL_FILL":     11,
		"BONUS_DEPOSIT_WITHDRAW": 12,
	}
)
View Source
var (
	ProtoOAChangeBonusTypeToString = map[ProtoOAChangeBonusType]string{
		0: "BONUS_DEPOSIT",
		1: "BONUS_WITHDRAW",
	}
	ProtoOAChangeBonusTypeByString = map[string]ProtoOAChangeBonusType{
		"BONUS_DEPOSIT":  0,
		"BONUS_WITHDRAW": 1,
	}
)
View Source
var (
	ProtoOAChangeBalanceTypeToString = map[ProtoOAChangeBalanceType]string{
		0:  "BALANCE_DEPOSIT",
		1:  "BALANCE_WITHDRAW",
		3:  "BALANCE_DEPOSIT_STRATEGY_COMMISSION_INNER",
		4:  "BALANCE_WITHDRAW_STRATEGY_COMMISSION_INNER",
		5:  "BALANCE_DEPOSIT_IB_COMMISSIONS",
		6:  "BALANCE_WITHDRAW_IB_SHARED_PERCENTAGE",
		7:  "BALANCE_DEPOSIT_IB_SHARED_PERCENTAGE_FROM_SUB_IB",
		8:  "BALANCE_DEPOSIT_IB_SHARED_PERCENTAGE_FROM_BROKER",
		9:  "BALANCE_DEPOSIT_REBATE",
		10: "BALANCE_WITHDRAW_REBATE",
		11: "BALANCE_DEPOSIT_STRATEGY_COMMISSION_OUTER",
		12: "BALANCE_WITHDRAW_STRATEGY_COMMISSION_OUTER",
		13: "BALANCE_WITHDRAW_BONUS_COMPENSATION",
		14: "BALANCE_WITHDRAW_IB_SHARED_PERCENTAGE_TO_BROKER",
		15: "BALANCE_DEPOSIT_DIVIDENDS",
		16: "BALANCE_WITHDRAW_DIVIDENDS",
		17: "BALANCE_WITHDRAW_GSL_CHARGE",
		18: "BALANCE_WITHDRAW_ROLLOVER",
		19: "BALANCE_DEPOSIT_NONWITHDRAWABLE_BONUS",
		20: "BALANCE_WITHDRAW_NONWITHDRAWABLE_BONUS",
		21: "BALANCE_DEPOSIT_SWAP",
		22: "BALANCE_WITHDRAW_SWAP",
		27: "BALANCE_DEPOSIT_MANAGEMENT_FEE",
		28: "BALANCE_WITHDRAW_MANAGEMENT_FEE",
		29: "BALANCE_DEPOSIT_PERFORMANCE_FEE",
		30: "BALANCE_WITHDRAW_FOR_SUBACCOUNT",
		31: "BALANCE_DEPOSIT_TO_SUBACCOUNT",
		32: "BALANCE_WITHDRAW_FROM_SUBACCOUNT",
		33: "BALANCE_DEPOSIT_FROM_SUBACCOUNT",
		34: "BALANCE_WITHDRAW_COPY_FEE",
		35: "BALANCE_WITHDRAW_INACTIVITY_FEE",
		36: "BALANCE_DEPOSIT_TRANSFER",
		37: "BALANCE_WITHDRAW_TRANSFER",
		38: "BALANCE_DEPOSIT_CONVERTED_BONUS",
		39: "BALANCE_DEPOSIT_NEGATIVE_BALANCE_PROTECTION",
	}
	ProtoOAChangeBalanceTypeByString = map[string]ProtoOAChangeBalanceType{
		"BALANCE_DEPOSIT":                                  0,
		"BALANCE_WITHDRAW":                                 1,
		"BALANCE_DEPOSIT_STRATEGY_COMMISSION_INNER":        3,
		"BALANCE_WITHDRAW_STRATEGY_COMMISSION_INNER":       4,
		"BALANCE_DEPOSIT_IB_COMMISSIONS":                   5,
		"BALANCE_WITHDRAW_IB_SHARED_PERCENTAGE":            6,
		"BALANCE_DEPOSIT_IB_SHARED_PERCENTAGE_FROM_SUB_IB": 7,
		"BALANCE_DEPOSIT_IB_SHARED_PERCENTAGE_FROM_BROKER": 8,
		"BALANCE_DEPOSIT_REBATE":                           9,
		"BALANCE_WITHDRAW_REBATE":                          10,
		"BALANCE_DEPOSIT_STRATEGY_COMMISSION_OUTER":        11,
		"BALANCE_WITHDRAW_STRATEGY_COMMISSION_OUTER":       12,
		"BALANCE_WITHDRAW_BONUS_COMPENSATION":              13,
		"BALANCE_WITHDRAW_IB_SHARED_PERCENTAGE_TO_BROKER":  14,
		"BALANCE_DEPOSIT_DIVIDENDS":                        15,
		"BALANCE_WITHDRAW_DIVIDENDS":                       16,
		"BALANCE_WITHDRAW_GSL_CHARGE":                      17,
		"BALANCE_WITHDRAW_ROLLOVER":                        18,
		"BALANCE_DEPOSIT_NONWITHDRAWABLE_BONUS":            19,
		"BALANCE_WITHDRAW_NONWITHDRAWABLE_BONUS":           20,
		"BALANCE_DEPOSIT_SWAP":                             21,
		"BALANCE_WITHDRAW_SWAP":                            22,
		"BALANCE_DEPOSIT_MANAGEMENT_FEE":                   27,
		"BALANCE_WITHDRAW_MANAGEMENT_FEE":                  28,
		"BALANCE_DEPOSIT_PERFORMANCE_FEE":                  29,
		"BALANCE_WITHDRAW_FOR_SUBACCOUNT":                  30,
		"BALANCE_DEPOSIT_TO_SUBACCOUNT":                    31,
		"BALANCE_WITHDRAW_FROM_SUBACCOUNT":                 32,
		"BALANCE_DEPOSIT_FROM_SUBACCOUNT":                  33,
		"BALANCE_WITHDRAW_COPY_FEE":                        34,
		"BALANCE_WITHDRAW_INACTIVITY_FEE":                  35,
		"BALANCE_DEPOSIT_TRANSFER":                         36,
		"BALANCE_WITHDRAW_TRANSFER":                        37,
		"BALANCE_DEPOSIT_CONVERTED_BONUS":                  38,
		"BALANCE_DEPOSIT_NEGATIVE_BALANCE_PROTECTION":      39,
	}
)
View Source
var (
	ProtoOADealStatusToString = map[ProtoOADealStatus]string{
		2: "FILLED",
		3: "PARTIALLY_FILLED",
		4: "REJECTED",
		5: "INTERNALLY_REJECTED",
		6: "ERROR",
		7: "MISSED",
	}
	ProtoOADealStatusByString = map[string]ProtoOADealStatus{
		"FILLED":              2,
		"PARTIALLY_FILLED":    3,
		"REJECTED":            4,
		"INTERNALLY_REJECTED": 5,
		"ERROR":               6,
		"MISSED":              7,
	}
)
View Source
var (
	ProtoOATrendbarPeriodToString = map[ProtoOATrendbarPeriod]string{
		1:  "M1",
		2:  "M2",
		3:  "M3",
		4:  "M4",
		5:  "M5",
		6:  "M10",
		7:  "M15",
		8:  "M30",
		9:  "H1",
		10: "H4",
		11: "H12",
		12: "D1",
		13: "W1",
		14: "MN1",
	}
	ProtoOATrendbarPeriodByString = map[string]ProtoOATrendbarPeriod{
		"M1":  1,
		"M2":  2,
		"M3":  3,
		"M4":  4,
		"M5":  5,
		"M10": 6,
		"M15": 7,
		"M30": 8,
		"H1":  9,
		"H4":  10,
		"H12": 11,
		"D1":  12,
		"W1":  13,
		"MN1": 14,
	}
)
View Source
var (
	ProtoOAQuoteTypeToString = map[ProtoOAQuoteType]string{
		1: "BID",
		2: "ASK",
	}
	ProtoOAQuoteTypeByString = map[string]ProtoOAQuoteType{
		"BID": 1,
		"ASK": 2,
	}
)
View Source
var (
	ProtoOAClientPermissionScopeToString = map[ProtoOAClientPermissionScope]string{
		0: "SCOPE_VIEW",
		1: "SCOPE_TRADE",
	}
	ProtoOAClientPermissionScopeByString = map[string]ProtoOAClientPermissionScope{
		"SCOPE_VIEW":  0,
		"SCOPE_TRADE": 1,
	}
)
View Source
var (
	ProtoOANotificationTypeToString = map[ProtoOANotificationType]string{
		61: "MARGIN_LEVEL_THRESHOLD_1",
		62: "MARGIN_LEVEL_THRESHOLD_2",
		63: "MARGIN_LEVEL_THRESHOLD_3",
	}
	ProtoOANotificationTypeByString = map[string]ProtoOANotificationType{
		"MARGIN_LEVEL_THRESHOLD_1": 61,
		"MARGIN_LEVEL_THRESHOLD_2": 62,
		"MARGIN_LEVEL_THRESHOLD_3": 63,
	}
)
View Source
var (
	ProtoOAErrorCodeToString = map[ProtoOAErrorCode]string{
		1:   "OA_AUTH_TOKEN_EXPIRED",
		2:   "ACCOUNT_NOT_AUTHORIZED",
		12:  "RET_NO_SUCH_LOGIN",
		14:  "ALREADY_LOGGED_IN",
		64:  "RET_ACCOUNT_DISABLED",
		101: "CH_CLIENT_AUTH_FAILURE",
		102: "CH_CLIENT_NOT_AUTHENTICATED",
		103: "CH_CLIENT_ALREADY_AUTHENTICATED",
		104: "CH_ACCESS_TOKEN_INVALID",
		105: "CH_SERVER_NOT_REACHABLE",
		106: "CH_CTID_TRADER_ACCOUNT_NOT_FOUND",
		107: "CH_OA_CLIENT_NOT_FOUND",
		108: "REQUEST_FREQUENCY_EXCEEDED",
		109: "SERVER_IS_UNDER_MAINTENANCE",
		110: "CHANNEL_IS_BLOCKED",
		67:  "CONNECTIONS_LIMIT_EXCEEDED",
		68:  "WORSE_GSL_NOT_ALLOWED",
		69:  "SYMBOL_HAS_HOLIDAY",
		112: "NOT_SUBSCRIBED_TO_SPOTS",
		113: "ALREADY_SUBSCRIBED",
		114: "SYMBOL_NOT_FOUND",
		115: "UNKNOWN_SYMBOL",
		35:  "INCORRECT_BOUNDARIES",
		117: "NO_QUOTES",
		118: "NOT_ENOUGH_MONEY",
		119: "MAX_EXPOSURE_REACHED",
		120: "POSITION_NOT_FOUND",
		121: "ORDER_NOT_FOUND",
		122: "POSITION_NOT_OPEN",
		123: "POSITION_LOCKED",
		124: "TOO_MANY_POSITIONS",
		125: "TRADING_BAD_VOLUME",
		126: "TRADING_BAD_STOPS",
		127: "TRADING_BAD_PRICES",
		128: "TRADING_BAD_STAKE",
		129: "PROTECTION_IS_TOO_CLOSE_TO_MARKET",
		130: "TRADING_BAD_EXPIRATION_DATE",
		131: "PENDING_EXECUTION",
		132: "TRADING_DISABLED",
		133: "TRADING_NOT_ALLOWED",
		134: "UNABLE_TO_CANCEL_ORDER",
		135: "UNABLE_TO_AMEND_ORDER",
		136: "SHORT_SELLING_NOT_ALLOWED",
	}
	ProtoOAErrorCodeByString = map[string]ProtoOAErrorCode{
		"OA_AUTH_TOKEN_EXPIRED":             1,
		"ACCOUNT_NOT_AUTHORIZED":            2,
		"RET_NO_SUCH_LOGIN":                 12,
		"ALREADY_LOGGED_IN":                 14,
		"RET_ACCOUNT_DISABLED":              64,
		"CH_CLIENT_AUTH_FAILURE":            101,
		"CH_CLIENT_NOT_AUTHENTICATED":       102,
		"CH_CLIENT_ALREADY_AUTHENTICATED":   103,
		"CH_ACCESS_TOKEN_INVALID":           104,
		"CH_SERVER_NOT_REACHABLE":           105,
		"CH_CTID_TRADER_ACCOUNT_NOT_FOUND":  106,
		"CH_OA_CLIENT_NOT_FOUND":            107,
		"REQUEST_FREQUENCY_EXCEEDED":        108,
		"SERVER_IS_UNDER_MAINTENANCE":       109,
		"CHANNEL_IS_BLOCKED":                110,
		"CONNECTIONS_LIMIT_EXCEEDED":        67,
		"WORSE_GSL_NOT_ALLOWED":             68,
		"SYMBOL_HAS_HOLIDAY":                69,
		"NOT_SUBSCRIBED_TO_SPOTS":           112,
		"ALREADY_SUBSCRIBED":                113,
		"SYMBOL_NOT_FOUND":                  114,
		"UNKNOWN_SYMBOL":                    115,
		"INCORRECT_BOUNDARIES":              35,
		"NO_QUOTES":                         117,
		"NOT_ENOUGH_MONEY":                  118,
		"MAX_EXPOSURE_REACHED":              119,
		"POSITION_NOT_FOUND":                120,
		"ORDER_NOT_FOUND":                   121,
		"POSITION_NOT_OPEN":                 122,
		"POSITION_LOCKED":                   123,
		"TOO_MANY_POSITIONS":                124,
		"TRADING_BAD_VOLUME":                125,
		"TRADING_BAD_STOPS":                 126,
		"TRADING_BAD_PRICES":                127,
		"TRADING_BAD_STAKE":                 128,
		"PROTECTION_IS_TOO_CLOSE_TO_MARKET": 129,
		"TRADING_BAD_EXPIRATION_DATE":       130,
		"PENDING_EXECUTION":                 131,
		"TRADING_DISABLED":                  132,
		"TRADING_NOT_ALLOWED":               133,
		"UNABLE_TO_CANCEL_ORDER":            134,
		"UNABLE_TO_AMEND_ORDER":             135,
		"SHORT_SELLING_NOT_ALLOWED":         136,
	}
)
View Source
var (
	ProtoOALimitedRiskMarginCalculationStrategyToString = map[ProtoOALimitedRiskMarginCalculationStrategy]string{
		0: "ACCORDING_TO_LEVERAGE",
		1: "ACCORDING_TO_GSL",
		2: "ACCORDING_TO_GSL_AND_LEVERAGE",
	}
	ProtoOALimitedRiskMarginCalculationStrategyByString = map[string]ProtoOALimitedRiskMarginCalculationStrategy{
		"ACCORDING_TO_LEVERAGE":         0,
		"ACCORDING_TO_GSL":              1,
		"ACCORDING_TO_GSL_AND_LEVERAGE": 2,
	}
)
View Source
var (
	ProtoOAStopOutStrategyToString = map[ProtoOAStopOutStrategy]string{
		0: "MOST_MARGIN_USED_FIRST",
		1: "MOST_LOSING_FIRST",
	}
	ProtoOAStopOutStrategyByString = map[string]ProtoOAStopOutStrategy{
		"MOST_MARGIN_USED_FIRST": 0,
		"MOST_LOSING_FIRST":      1,
	}
)

Functions

This section is empty.

Types

type APIEvent

type APIEvent = messages.APIEvent

type APIEventKey

type APIEventKey = messages.APIEventKey

type APIEventKeyData

type APIEventKeyData interface {
	BuildKey() APIEventKey
}

type AccessToken

type AccessToken string

type AccessTokenAlreadyExistsError

type AccessTokenAlreadyExistsError struct {
	AccessToken AccessToken
}

func (*AccessTokenAlreadyExistsError) Error

type AccessTokenDoesNotExistError

type AccessTokenDoesNotExistError struct {
	AccessToken AccessToken
}

func (*AccessTokenDoesNotExistError) Error

type AccountDisconnectConfirmClearedError

type AccountDisconnectConfirmClearedError struct {
	AccountId CtraderAccountId
}

func (*AccountDisconnectConfirmClearedError) Error

type AccountIdAlreadyExistsError

type AccountIdAlreadyExistsError struct {
	AccountId   CtraderAccountId
	AccessToken AccessToken
}

func (*AccountIdAlreadyExistsError) Error

type AccountIdDoesNotExistError

type AccountIdDoesNotExistError struct {
	AccountId CtraderAccountId
}

func (*AccountIdDoesNotExistError) Error

type AccountIdDoesNotExistOnTokenError

type AccountIdDoesNotExistOnTokenError struct {
	AccountId   CtraderAccountId
	AccessToken AccessToken
}

func (*AccountIdDoesNotExistOnTokenError) Error

type AccountManager

type AccountManager[EventT comparable, SubDataT any] interface {
	LockModification(context.Context)

	HasAccessToken(AccessToken) bool
	AddAccessToken(AccessToken) error
	RemoveAccessToken(AccessToken) error
	UpdateAccessToken(old, new AccessToken) error

	AddAccountId(AccessToken, CtraderAccountId) error
	RemoveAccountId(CtraderAccountId) error

	AddEventSubscription(CtraderAccountId, EventT, SubDataT) error
	RemoveEventSubscription(CtraderAccountId, EventT) error

	GetAccessTokenByAccountId() map[CtraderAccountId]AccessToken
	GetAllAccountIds() []CtraderAccountId
	GetAccountIdsOfAccessToken(AccessToken) ([]CtraderAccountId, error)
	GetEventSubscriptionsOfAccountId(CtraderAccountId) (map[EventT]SubDataT, error)

	WaitForAccDisconnectConfirm(ctid CtraderAccountId) error
	ConfirmAccDisconnect(ctid CtraderAccountId)
	ClearAccDisconnectConfirms()
}

func NewAccountManager

func NewAccountManager[EventT comparable, SubDataT any]() AccountManager[EventT, SubDataT]

type BaseEvent

type BaseEvent = messages.BaseEvent

type ClearMap added in v0.4.0

type ClearMap[E comparable, V any] interface {
	// WithRebuildThreshold modifies the number of operations threshold by which
	// the map will be rebuild.
	//
	// The default value is defined as ClearMap_RebuildThresholdN.
	WithRebuildThreshold(int) ClearMap[E, V]

	// Set stores the value for the given key.
	Set(E, V)
	// Get retrieves the value for the given key and reports whether it exists.
	Get(E) (V, bool)
	// Exists reports whether the given key exists in the map.
	Exists(E) bool
	// Delete removes the entry for the given key. After rebuildThreshold deletions,
	// the map is rebuilt to reclaim memory.
	Delete(E)
	// Range provides access to the range over map functionality, loopFn is the callback
	// function for each iteration of range.
	Range(loopFn func(E, V))

	// Resets the map.
	Clear()
	// contains filtered or unexported methods
}

ClearMap is a map wrapper that periodically rebuilds its underlying map to reduce memory usage. It rebuilds the map to a new map at a given interval of Delete operations to lower the map's memory profile.

The idea is to mitigate Go map memory fragmentation: when items are deleted from a Go map, the internal hash table may retain allocated memory even though entries are removed. By rebuilding the map after a threshold number of deletions, unused memory is released back to the allocator.

Type parameters:

  • E: the key type (must be comparable)
  • V: the value type

func NewClearMap added in v0.4.0

func NewClearMap[E comparable, V any]() ClearMap[E, V]

NewClearMap creates a new ClearMap with the default removal threshold defined as ClearMap_RebuildThresholdN.

Returns a new ClearMap instance.

type ClientEvent

type ClientEvent = messages.ClientEvent

type CtraderAccountId

type CtraderAccountId int64

func (CtraderAccountId) CheckError

func (id CtraderAccountId) CheckError() error

CheckError validates the account id. It returns a non-nil error when the id is invalid (zero). Additional validation rules can be added later if required.

type DistributableEvent

type DistributableEvent = messages.DistributableEvent

type ErrorList added in v0.4.0

type ErrorList struct {
	ErrContext string
	Errs       []error
}

func (*ErrorList) Error added in v0.4.0

func (e *ErrorList) Error() string

type EventHandler

type EventHandler[T BaseEvent] interface {
	HasListenerSource(eventType EventType) bool

	SetDefaultListener(eventType EventType, eventCh chan T) error
	UnsetDefaultListener(eventType EventType) error
	SetListener(eventType EventType, keyData APIEventKeyData, eventCh chan T) error
	UnsetListener(eventType EventType, keyData APIEventKeyData) error

	HandleEvent(eventType EventType, event T) error
}

EventHandler is the type used for distributing API events to specific channels based on subscription keys.

func NewEventHandler

func NewEventHandler[T BaseEvent]() EventHandler[T]

type EventSubscriptionAlreadyExistsError

type EventSubscriptionAlreadyExistsError[EventT comparable] struct {
	EventType EventT
	AccountId CtraderAccountId
}

func (*EventSubscriptionAlreadyExistsError[EventT]) Error

func (e *EventSubscriptionAlreadyExistsError[EventT]) Error() string

type EventSubscriptionDoesNotExistError

type EventSubscriptionDoesNotExistError[EventT comparable] struct {
	EventType EventT
	AccountId CtraderAccountId
}

func (*EventSubscriptionDoesNotExistError[EventT]) Error

func (e *EventSubscriptionDoesNotExistError[EventT]) Error() string

type EventType

type EventType = messages.ProtoOAPayloadType

type FunctionInvalidArgError

type FunctionInvalidArgError struct {
	FunctionName string
	Err          error
}

func (*FunctionInvalidArgError) Error

func (e *FunctionInvalidArgError) Error() string

type IEventHandler

type IEventHandler[T BaseEvent] interface {
	EventHandler[T]
	Clear()
}

func NewIEventHandler

func NewIEventHandler[T BaseEvent]() IEventHandler[T]

type LifeCycleAlreadyRunningError

type LifeCycleAlreadyRunningError struct {
	CallContext string
}

func (*LifeCycleAlreadyRunningError) Error

type LifeCycleNotRunningError

type LifeCycleNotRunningError struct {
	CallContext string
}

func (*LifeCycleNotRunningError) Error

func (e *LifeCycleNotRunningError) Error() string

type LifecycleData

type LifecycleData interface {
	Start() error
	Stop() error
	IsRunning() bool

	GetContext() (context.Context, error)
	SetClientInitialized(bool) error
	IsClientInitialized() bool
	SignalMessageSend()
	GetOnMessageSendCh() (chan struct{}, error)

	SetClientDisconnected()
	SetClientConnected()
	BlockUntilReconnected(context.Context) bool
}

func NewLifecycleData

func NewLifecycleData() LifecycleData

type LinkedList

type LinkedList[T comparable] interface {
	WithAllowDuplicates() LinkedList[T]

	Clear()
	Has(t T) bool
	IsEmpty() bool
	Length() int
	Append(t T) error
	Prepend(t T) error
	PopHead() (T, error)
	PopTail() (T, error)
	Remove(t T) error
	PeekHead() (T, error)
	PeekTail() (T, error)
}

func NewLinkedList

func NewLinkedList[T comparable]() LinkedList[T]

type ListenerAlreadySetError

type ListenerAlreadySetError struct {
	EventType EventType
	// contains filtered or unexported fields
}

func (*ListenerAlreadySetError) Error

func (e *ListenerAlreadySetError) Error() string

type ListenerNotSetError

type ListenerNotSetError struct {
	EventType EventType
	// contains filtered or unexported fields
}

func (*ListenerNotSetError) Error

func (e *ListenerNotSetError) Error() string

type OpenAPIPayload

type OpenAPIPayload interface {
	proto.Message

	GetOAType() messages.ProtoOAPayloadType
}

type ProtoErrorCode added in v0.4.1

type ProtoErrorCode = messages.ProtoErrorCode
const (
	ProtoErrorCode_UNKNOWN_ERROR           ProtoErrorCode = 1  // Generic error.
	ProtoErrorCode_UNSUPPORTED_MESSAGE     ProtoErrorCode = 2  // Message is not supported. Wrong message.
	ProtoErrorCode_INVALID_REQUEST         ProtoErrorCode = 3  // Generic error.  Usually used when input value is not correct.
	ProtoErrorCode_TIMEOUT_ERROR           ProtoErrorCode = 5  // Deal execution is reached timeout and rejected.
	ProtoErrorCode_ENTITY_NOT_FOUND        ProtoErrorCode = 6  // Generic error for requests by id.
	ProtoErrorCode_CANT_ROUTE_REQUEST      ProtoErrorCode = 7  // Connection to Server is lost or not supported.
	ProtoErrorCode_FRAME_TOO_LONG          ProtoErrorCode = 8  // Message is too large.
	ProtoErrorCode_MARKET_CLOSED           ProtoErrorCode = 9  // Market is closed.
	ProtoErrorCode_CONCURRENT_MODIFICATION ProtoErrorCode = 10 // Order is blocked (e.g. under execution) and change cannot be applied.
	ProtoErrorCode_BLOCKED_PAYLOAD_TYPE    ProtoErrorCode = 11 // Message is blocked by server or rate limit is reached.
)

type ProtoOAAccessRights added in v0.4.1

type ProtoOAAccessRights = messages.ProtoOAAccessRights

Enum for specifying access right for a trader.

const (
	ProtoOAAccessRights_FULL_ACCESS ProtoOAAccessRights = 0 // Enable all trading.
	ProtoOAAccessRights_CLOSE_ONLY  ProtoOAAccessRights = 1 // Only closing trading request are enabled.
	ProtoOAAccessRights_NO_TRADING  ProtoOAAccessRights = 2 // View only access.
	ProtoOAAccessRights_NO_LOGIN    ProtoOAAccessRights = 3 // No access.
)

type ProtoOAAccountAuthRes added in v0.4.1

type ProtoOAAccountAuthRes = messages.ProtoOAAccountAuthRes

Response to the ProtoOAApplicationAuthReq request.

type ProtoOAAccountDisconnectEvent added in v0.4.1

type ProtoOAAccountDisconnectEvent = messages.ProtoOAAccountDisconnectEvent

Event that is sent when the established session for an account is dropped on the server side. A new session must be authorized for the account.

type ProtoOAAccountLogoutRes added in v0.4.1

type ProtoOAAccountLogoutRes = messages.ProtoOAAccountLogoutRes

Response to the ProtoOAAccountLogoutReq request. Actual logout of trading account will be completed on ProtoOAAccountDisconnectEvent.

type ProtoOAAccountType added in v0.4.1

type ProtoOAAccountType = messages.ProtoOAAccountType

Enum for specifying type of an account.

const (
	ProtoOAAccountType_HEDGED         ProtoOAAccountType = 0 // Allows multiple positions on a trading account for a symbol.
	ProtoOAAccountType_NETTED         ProtoOAAccountType = 1 // Only one position per symbol is allowed on a trading account.
	ProtoOAAccountType_SPREAD_BETTING ProtoOAAccountType = 2 // Spread betting type account.
)

type ProtoOAAccountsTokenInvalidatedEvent added in v0.4.1

type ProtoOAAccountsTokenInvalidatedEvent = messages.ProtoOAAccountsTokenInvalidatedEvent

Event that is sent when a session to a specific trader's account is terminated by the server but the existing connections with the other trader's accounts are maintained. Reasons to trigger: account was deleted, cTID was deleted, token was refreshed, token was revoked.

type ProtoOAAmendOrderReq added in v0.4.1

type ProtoOAAmendOrderReq = messages.ProtoOAAmendOrderReq

Request for amending the existing pending order. Allowed only if the Access Token has "trade" permissions for the trading account.

type ProtoOAAmendOrderRes added in v0.4.1

type ProtoOAAmendOrderRes = messages.ProtoOAExecutionEvent

Response to the ProtoOAAmendOrderReq request. IMPORTANT: ProtoOAAmendOrderReq is async, the API client makes ProtoOAAmendOrderReq syncronous by providing this type as an assertion to ProtoOAExecutionEvent. That way you have a syncronous request and do not need to worry about ProtoOAExecutionEvent.

type ProtoOAAmendPositionSLTPReq added in v0.4.1

type ProtoOAAmendPositionSLTPReq = messages.ProtoOAAmendPositionSLTPReq

Request for amending StopLoss and TakeProfit of existing position. Allowed only if the accessToken has "trade" permissions for the trading account.

type ProtoOAAmendPositionSLTPRes added in v0.4.1

type ProtoOAAmendPositionSLTPRes = messages.ProtoOAExecutionEvent

Response to the ProtoOAAmendPositionSLTPReq request. IMPORTANT: ProtoOAAmendPositionSLTPReq is async, the API client makes ProtoOAAmendPositionSLTPReq syncronous by providing this type as an assertion to ProtoOAExecutionEvent. That way you have a syncronous request and do not need to worry about ProtoOAExecutionEvent.

type ProtoOAArchivedSymbol added in v0.4.1

type ProtoOAArchivedSymbol = messages.ProtoOAArchivedSymbol

Archived symbol entity.

type ProtoOAAsset added in v0.4.1

type ProtoOAAsset = messages.ProtoOAAsset

Asset entity.

type ProtoOAAssetClass added in v0.4.1

type ProtoOAAssetClass = messages.ProtoOAAssetClass

Asset class entity.

type ProtoOAAssetClassListReq added in v0.4.1

type ProtoOAAssetClassListReq = messages.ProtoOAAssetClassListReq

Request for a list of asset classes available for the trader's account.

type ProtoOAAssetClassListRes added in v0.4.1

type ProtoOAAssetClassListRes = messages.ProtoOAAssetClassListRes

Response to the ProtoOAAssetListReq request.

type ProtoOAAssetListReq added in v0.4.1

type ProtoOAAssetListReq = messages.ProtoOAAssetListReq

Request for the list of assets available for a trader's account.

type ProtoOAAssetListRes added in v0.4.1

type ProtoOAAssetListRes = messages.ProtoOAAssetListRes

Response to the ProtoOAAssetListReq request.

type ProtoOABonusDepositWithdraw added in v0.4.1

type ProtoOABonusDepositWithdraw = messages.ProtoOABonusDepositWithdraw

Bonus deposit/withdrawal entity.

type ProtoOACancelOrderReq added in v0.4.1

type ProtoOACancelOrderReq = messages.ProtoOACancelOrderReq

Request for cancelling existing pending order. Allowed only if the accessToken has "trade" permissions for the trading account.

type ProtoOACancelOrderRes added in v0.4.1

type ProtoOACancelOrderRes = messages.ProtoOAExecutionEvent

Response to the ProtoOACancelOrderReq request. IMPORTANT: ProtoOACancelOrderReq is async, the API client makes ProtoOACancelOrderReq syncronous by providing this type as an assertion to ProtoOAExecutionEvent. That way you have a syncronous request and do not need to worry about ProtoOAExecutionEvent.

type ProtoOACashFlowHistoryListReq added in v0.4.1

type ProtoOACashFlowHistoryListReq = messages.ProtoOACashFlowHistoryListReq

Request for getting Trader's historical data of deposits and withdrawals.

type ProtoOACashFlowHistoryListRes added in v0.4.1

type ProtoOACashFlowHistoryListRes = messages.ProtoOACashFlowHistoryListRes

Response to the ProtoOACashFlowHistoryListReq request.

type ProtoOAChangeBalanceType added in v0.4.1

type ProtoOAChangeBalanceType = messages.ProtoOAChangeBalanceType

Balance operation entity. Covers all cash movement operations related to account, trading, IB operations, mirroring, etc.

const (
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT                                  ProtoOAChangeBalanceType = 0  // Cash deposit.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW                                 ProtoOAChangeBalanceType = 1  // Cash withdrawal.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_STRATEGY_COMMISSION_INNER        ProtoOAChangeBalanceType = 3  // Received mirroring commission.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_STRATEGY_COMMISSION_INNER       ProtoOAChangeBalanceType = 4  // Paid mirroring commission.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_IB_COMMISSIONS                   ProtoOAChangeBalanceType = 5  // For IB account. Commissions paid by trader.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_IB_SHARED_PERCENTAGE            ProtoOAChangeBalanceType = 6  // For IB account. Withdrawal of commissions shared with broker.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_IB_SHARED_PERCENTAGE_FROM_SUB_IB ProtoOAChangeBalanceType = 7  // For IB account. Commissions paid by sub-ibs.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_IB_SHARED_PERCENTAGE_FROM_BROKER ProtoOAChangeBalanceType = 8  // For IB account. Commissions paid by broker.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_REBATE                           ProtoOAChangeBalanceType = 9  // Deposit rebate for trading volume for period.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_REBATE                          ProtoOAChangeBalanceType = 10 // Withdrawal of rebate.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_STRATEGY_COMMISSION_OUTER        ProtoOAChangeBalanceType = 11 // Mirroring commission.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_STRATEGY_COMMISSION_OUTER       ProtoOAChangeBalanceType = 12 // Mirroring commission.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_BONUS_COMPENSATION              ProtoOAChangeBalanceType = 13 // For IB account. Share commission with the Broker.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_IB_SHARED_PERCENTAGE_TO_BROKER  ProtoOAChangeBalanceType = 14 // IB commissions.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_DIVIDENDS                        ProtoOAChangeBalanceType = 15 // Deposit dividends payments.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_DIVIDENDS                       ProtoOAChangeBalanceType = 16 // Negative dividend charge for short position.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_GSL_CHARGE                      ProtoOAChangeBalanceType = 17 // Charge for guaranteedStopLoss.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_ROLLOVER                        ProtoOAChangeBalanceType = 18 // Charge of rollover fee for Shariah compliant accounts.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_NONWITHDRAWABLE_BONUS            ProtoOAChangeBalanceType = 19 // Broker's operation to deposit bonus.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_NONWITHDRAWABLE_BONUS           ProtoOAChangeBalanceType = 20 // Broker's operation to withdrawal bonus.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_SWAP                             ProtoOAChangeBalanceType = 21 // Deposits of negative SWAP.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_SWAP                            ProtoOAChangeBalanceType = 22 // SWAP charges.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_MANAGEMENT_FEE                   ProtoOAChangeBalanceType = 27 // Mirroring commission.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_MANAGEMENT_FEE                  ProtoOAChangeBalanceType = 28 // Mirroring commission. Deprecated since 7.1 in favor of BALANCE_WITHDRAW_COPY_FEE (34).
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_PERFORMANCE_FEE                  ProtoOAChangeBalanceType = 29 // Mirroring commission.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_FOR_SUBACCOUNT                  ProtoOAChangeBalanceType = 30 // Withdraw for subaccount creation (cTrader Copy).
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_TO_SUBACCOUNT                    ProtoOAChangeBalanceType = 31 // Deposit to subaccount on creation (cTrader Copy).
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_FROM_SUBACCOUNT                 ProtoOAChangeBalanceType = 32 // Manual user's withdraw from subaccount (cTrader Copy), to parent account.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_FROM_SUBACCOUNT                  ProtoOAChangeBalanceType = 33 // Manual user's deposit to subaccount (cTrader Copy), from parent account.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_COPY_FEE                        ProtoOAChangeBalanceType = 34 // Withdrawal fees to Strategy Provider.
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_INACTIVITY_FEE                  ProtoOAChangeBalanceType = 35 // Withdraw of inactivity fee from the balance.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_TRANSFER                         ProtoOAChangeBalanceType = 36 // Deposit within the same server (from another account).
	ProtoOAChangeBalanceType_BALANCE_WITHDRAW_TRANSFER                        ProtoOAChangeBalanceType = 37 // Withdraw within the same server (to another account).
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_CONVERTED_BONUS                  ProtoOAChangeBalanceType = 38 // Bonus being converted from virtual bonus to real deposit.
	ProtoOAChangeBalanceType_BALANCE_DEPOSIT_NEGATIVE_BALANCE_PROTECTION      ProtoOAChangeBalanceType = 39 // Applies if negative balance protection is configured by broker, should make balance = 0.
)

type ProtoOAChangeBonusType added in v0.4.1

type ProtoOAChangeBonusType = messages.ProtoOAChangeBonusType

Enum for bonus operation type.

const (
	ProtoOAChangeBonusType_BONUS_DEPOSIT  ProtoOAChangeBonusType = 0
	ProtoOAChangeBonusType_BONUS_WITHDRAW ProtoOAChangeBonusType = 1
)

type ProtoOAClientDisconnectEvent added in v0.4.1

type ProtoOAClientDisconnectEvent = messages.ProtoOAClientDisconnectEvent

Event that is sent when the connection with the client application is cancelled by the server. All the sessions for the traders' accounts will be terminated.

IMPORTANT: Do not try to recover the connection. The client takes care of reconnecting and re-establishing the sessions internally.

type ProtoOAClientPermissionScope added in v0.4.1

type ProtoOAClientPermissionScope = messages.ProtoOAClientPermissionScope

Enum for Open API application permission in regards to token.

const (
	ProtoOAClientPermissionScope_SCOPE_VIEW  ProtoOAClientPermissionScope = 0 // Allows to use only view commends. Trade is prohibited.
	ProtoOAClientPermissionScope_SCOPE_TRADE ProtoOAClientPermissionScope = 1 // Allows to use all commands.
)

type ProtoOAClosePositionDetail added in v0.4.1

type ProtoOAClosePositionDetail = messages.ProtoOAClosePositionDetail

Trading details for closing deal.

type ProtoOAClosePositionReq added in v0.4.1

type ProtoOAClosePositionReq = messages.ProtoOAClosePositionReq

Request for closing or partially closing of an existing position. Allowed only if the accessToken has "trade" permissions for the trading account.

type ProtoOAClosePositionRes added in v0.4.1

type ProtoOAClosePositionRes = messages.ProtoOAExecutionEvent

Response to the ProtoOAClosePositionReq request. IMPORTANT: ProtoOAClosePositionReq is async, the API client makes ProtoOAClosePositionReq syncronous by providing this type as an assertion to ProtoOAExecutionEvent. That way you have a syncronous request and do not need to worry about ProtoOAExecutionEvent.

type ProtoOACommissionType added in v0.4.1

type ProtoOACommissionType = messages.ProtoOACommissionType

Enum for specifying type of trading commission.

const (
	ProtoOACommissionType_USD_PER_MILLION_USD   ProtoOACommissionType = 1 // USD per million USD volume - usually used for FX. Example: 50 USD for 1 mil USD of trading volume.
	ProtoOACommissionType_USD_PER_LOT           ProtoOACommissionType = 2 // USD per 1 lot - usually used for CFDs and futures for commodities, and indices. Example: 15 USD for 1 contract.
	ProtoOACommissionType_PERCENTAGE_OFByString ProtoOACommissionType = 3 // Percentage of trading volume - usually used for Equities. Example: 0.005% of notional trading volume. Multiplied by 100,000.
	ProtoOACommissionType_QUOTE_CCY_PER_LOT     ProtoOACommissionType = 4 // Quote ccy of Symbol per 1 lot - will be used for CFDs and futures for commodities, and indices. Example: 15 EUR for 1 contract of DAX.
)

type ProtoOACtidProfile added in v0.4.1

type ProtoOACtidProfile = messages.ProtoOACtidProfile

Trader profile entity. Empty due to GDPR.

type ProtoOACtidTraderAccount added in v0.4.1

type ProtoOACtidTraderAccount = messages.ProtoOACtidTraderAccount

Trader account entity.

type ProtoOADayOfWeek added in v0.4.1

type ProtoOADayOfWeek = messages.ProtoOADayOfWeek

Enum for day of week.

const (
	ProtoOADayOfWeek_NONE      ProtoOADayOfWeek = 0
	ProtoOADayOfWeek_MONDAY    ProtoOADayOfWeek = 1
	ProtoOADayOfWeek_TUESDAY   ProtoOADayOfWeek = 2
	ProtoOADayOfWeek_WEDNESDAY ProtoOADayOfWeek = 3
	ProtoOADayOfWeek_THURSDAY  ProtoOADayOfWeek = 4
	ProtoOADayOfWeek_FRIDAY    ProtoOADayOfWeek = 5
	ProtoOADayOfWeek_SATURDAY  ProtoOADayOfWeek = 6
	ProtoOADayOfWeek_SUNDAY    ProtoOADayOfWeek = 7
)

type ProtoOADeal added in v0.4.1

type ProtoOADeal = messages.ProtoOADeal

Execution entity.

type ProtoOADealListByPositionIdReq added in v0.4.1

type ProtoOADealListByPositionIdReq = messages.ProtoOADealListByPositionIdReq

Request for retrieving the deals related to a position.

type ProtoOADealListByPositionIdRes added in v0.4.1

type ProtoOADealListByPositionIdRes = messages.ProtoOADealListByPositionIdRes

Response to the ProtoOADealListByPositionIdReq request.

type ProtoOADealListReq added in v0.4.1

type ProtoOADealListReq = messages.ProtoOADealListReq

Request for getting Trader's deals historical data (execution details).

type ProtoOADealListRes added in v0.4.1

type ProtoOADealListRes = messages.ProtoOADealListRes

Response to the ProtoOADealListReq request.

type ProtoOADealOffset added in v0.4.1

type ProtoOADealOffset = messages.ProtoOADealOffset

Deal details for ProtoOADealOffsetListReq.

type ProtoOADealOffsetListReq added in v0.4.1

type ProtoOADealOffsetListReq = messages.ProtoOADealOffsetListReq

Request for getting sets of Deals that were offset by a specific Deal and that are offsetting the Deal.

type ProtoOADealOffsetListRes added in v0.4.1

type ProtoOADealOffsetListRes = messages.ProtoOADealOffsetListRes

Response to the ProtoOADealOffsetListReq request.

type ProtoOADealStatus added in v0.4.1

type ProtoOADealStatus = messages.ProtoOADealStatus

Enum for deal status.

const (
	ProtoOADealStatus_FILLED              ProtoOADealStatus = 2 // Deal filled.
	ProtoOADealStatus_PARTIALLY_FILLED    ProtoOADealStatus = 3 // Deal is partially filled.
	ProtoOADealStatus_REJECTED            ProtoOADealStatus = 4 // Deal is correct but was rejected by liquidity provider (e.g. no liquidity).
	ProtoOADealStatus_INTERNALLY_REJECTED ProtoOADealStatus = 5 // Deal rejected by server (e.g. no price quotes).
	ProtoOADealStatus_ERROR               ProtoOADealStatus = 6 // Deal is rejected by LP due to error (e.g. symbol is unknown).
	ProtoOADealStatus_MISSED              ProtoOADealStatus = 7 // Liquidity provider did not sent response on the deal during specified execution time period.
)

type ProtoOADepositWithdraw added in v0.4.1

type ProtoOADepositWithdraw = messages.ProtoOADepositWithdraw

Account deposit/withdrawal operation entity.

type ProtoOADepthEvent added in v0.4.1

type ProtoOADepthEvent = messages.ProtoOADepthEvent

Event that is sent when the structure of depth of market is changed. Requires subscription on the depth of markets for the symbol, see ProtoOASubscribeDepthQuotesReq.

type ProtoOADepthQuote added in v0.4.1

type ProtoOADepthQuote = messages.ProtoOADepthQuote

Depth of market entity.

type ProtoOADynamicLeverage added in v0.4.1

type ProtoOADynamicLeverage = messages.ProtoOADynamicLeverage

Dynamic leverage entity.

type ProtoOADynamicLeverageTier added in v0.4.1

type ProtoOADynamicLeverageTier = messages.ProtoOADynamicLeverageTier

Dynamic leverage tier entity.

type ProtoOAErrorCode added in v0.4.1

type ProtoOAErrorCode = messages.ProtoOAErrorCode

Enum for error code.

const (
	// Authorization
	ProtoOAErrorCode_OA_AUTH_TOKEN_EXPIRED            ProtoOAErrorCode = 1   // When token used for account authorization is expired.
	ProtoOAErrorCode_ACCOUNT_NOT_AUTHORIZED           ProtoOAErrorCode = 2   // When account is not authorized.
	ProtoOAErrorCode_RET_NO_SUCH_LOGIN                ProtoOAErrorCode = 12  // When such account no longer exists.
	ProtoOAErrorCode_ALREADY_LOGGED_IN                ProtoOAErrorCode = 14  // When client tries to authorize after it was already authorized.
	ProtoOAErrorCode_RET_ACCOUNT_DISABLED             ProtoOAErrorCode = 64  // When account is disabled.
	ProtoOAErrorCode_CH_CLIENT_AUTH_FAILURE           ProtoOAErrorCode = 101 // Open API client is not activated or wrong client credentials.
	ProtoOAErrorCode_CH_CLIENT_NOT_AUTHENTICATED      ProtoOAErrorCode = 102 // When a command is sent for not authorized Open API client.
	ProtoOAErrorCode_CH_CLIENT_ALREADY_AUTHENTICATED  ProtoOAErrorCode = 103 // Client is trying to authenticate twice.
	ProtoOAErrorCode_CH_ACCESS_TOKEN_INVALID          ProtoOAErrorCode = 104 // Access token is invalid.
	ProtoOAErrorCode_CH_SERVER_NOT_REACHABLE          ProtoOAErrorCode = 105 // Trading service is not available.
	ProtoOAErrorCode_CH_CTID_TRADER_ACCOUNT_NOT_FOUND ProtoOAErrorCode = 106 // Trading account is not found.
	ProtoOAErrorCode_CH_OA_CLIENT_NOT_FOUND           ProtoOAErrorCode = 107 // Could not find this client id.
	// General
	ProtoOAErrorCode_REQUEST_FREQUENCY_EXCEEDED  ProtoOAErrorCode = 108 // Request frequency is reached.
	ProtoOAErrorCode_SERVER_IS_UNDER_MAINTENANCE ProtoOAErrorCode = 109 // Server is under maintenance.
	ProtoOAErrorCode_CHANNEL_IS_BLOCKED          ProtoOAErrorCode = 110 // Operations are not allowed for this account.
	ProtoOAErrorCode_CONNECTIONS_LIMIT_EXCEEDED  ProtoOAErrorCode = 67  // Limit of connections is reached for this Open API client.
	ProtoOAErrorCode_WORSE_GSL_NOT_ALLOWED       ProtoOAErrorCode = 68  // Not allowed to increase risk for Positions with Guaranteed Stop Loss.
	ProtoOAErrorCode_SYMBOL_HAS_HOLIDAY          ProtoOAErrorCode = 69  // Trading disabled because symbol has holiday.
	// Pricing
	ProtoOAErrorCode_NOT_SUBSCRIBED_TO_SPOTS ProtoOAErrorCode = 112 // When trying to subscribe to depth, trendbars, etc. without spot subscription.
	ProtoOAErrorCode_ALREADY_SUBSCRIBED      ProtoOAErrorCode = 113 // When subscription is requested for an active.
	ProtoOAErrorCode_SYMBOL_NOT_FOUND        ProtoOAErrorCode = 114 // Symbol not found.
	ProtoOAErrorCode_UNKNOWN_SYMBOL          ProtoOAErrorCode = 115 // Note: to be merged with SYMBOL_NOT_FOUND.
	ProtoOAErrorCode_INCORRECT_BOUNDARIES    ProtoOAErrorCode = 35  // When requested period (from,to) is too large or invalid values are set to from/to.
	// Trading
	ProtoOAErrorCode_NO_QUOTES                         ProtoOAErrorCode = 117 // Trading cannot be done as not quotes are available. Applicable for Book B.
	ProtoOAErrorCode_NOT_ENOUGH_MONEY                  ProtoOAErrorCode = 118 // Not enough funds to allocate margin.
	ProtoOAErrorCode_MAX_EXPOSURE_REACHED              ProtoOAErrorCode = 119 // Max exposure limit is reached for a {trader, symbol, side}.
	ProtoOAErrorCode_POSITION_NOT_FOUND                ProtoOAErrorCode = 120 // Position not found.
	ProtoOAErrorCode_ORDER_NOT_FOUND                   ProtoOAErrorCode = 121 // Order not found.
	ProtoOAErrorCode_POSITION_NOT_OPEN                 ProtoOAErrorCode = 122 // When trying to close a position that it is not open.
	ProtoOAErrorCode_POSITION_LOCKED                   ProtoOAErrorCode = 123 // Position in the state that does not allow to perform an operation.
	ProtoOAErrorCode_TOO_MANY_POSITIONS                ProtoOAErrorCode = 124 // Trading account reached its limit for max number of open positions and orders.
	ProtoOAErrorCode_TRADING_BAD_VOLUME                ProtoOAErrorCode = 125 // Invalid volume.
	ProtoOAErrorCode_TRADING_BAD_STOPS                 ProtoOAErrorCode = 126 // Invalid stop price.
	ProtoOAErrorCode_TRADING_BAD_PRICES                ProtoOAErrorCode = 127 // Invalid price (e.g. negative).
	ProtoOAErrorCode_TRADING_BAD_STAKE                 ProtoOAErrorCode = 128 // Invalid stake volume (e.g. negative).
	ProtoOAErrorCode_PROTECTION_IS_TOO_CLOSE_TO_MARKET ProtoOAErrorCode = 129 // Invalid protection prices.
	ProtoOAErrorCode_TRADING_BAD_EXPIRATION_DATE       ProtoOAErrorCode = 130 // Invalid expiration.
	ProtoOAErrorCode_PENDING_EXECUTION                 ProtoOAErrorCode = 131 // Unable to apply changes as position has an order under execution.
	ProtoOAErrorCode_TRADING_DISABLED                  ProtoOAErrorCode = 132 // Trading is blocked for the symbol.
	ProtoOAErrorCode_TRADING_NOT_ALLOWED               ProtoOAErrorCode = 133 // Trading account is in read only mode.
	ProtoOAErrorCode_UNABLE_TO_CANCEL_ORDER            ProtoOAErrorCode = 134 // Unable to cancel order.
	ProtoOAErrorCode_UNABLE_TO_AMEND_ORDER             ProtoOAErrorCode = 135 // Unable to amend order.
	ProtoOAErrorCode_SHORT_SELLING_NOT_ALLOWED         ProtoOAErrorCode = 136 // Short selling is not allowed.
)

type ProtoOAErrorRes added in v0.4.1

type ProtoOAErrorRes = messages.ProtoOAErrorRes

Generic response when an ERROR occurred.

type ProtoOAExecutionEvent added in v0.4.1

type ProtoOAExecutionEvent = messages.ProtoOAExecutionEvent

Event that is sent following the successful order acceptance or execution by the server. Acts as response to the ProtoOANewOrderReq, ProtoOACancelOrderReq, ProtoOAAmendOrderReq, ProtoOAAmendPositionSLTPReq, ProtoOAClosePositionReq requests. Also, the event is sent when a Deposit/Withdrawal took place. IMPORTANT: In this API wrapper it is only emitted if field ExecutionType value is DEPOSIT_WITHDRAW, BONUS_DEPOSIT_WITHDRAW or SWAP. Otherwise it is handled internally and not emitted as APIEvent.

type ProtoOAExecutionType added in v0.4.1

type ProtoOAExecutionType = messages.ProtoOAExecutionType

Enum for execution event type.

const (
	ProtoOAExecutionType_ORDER_ACCEPTED         ProtoOAExecutionType = 2  // Order passed validation.
	ProtoOAExecutionType_ORDER_FILLED           ProtoOAExecutionType = 3  // Order filled.
	ProtoOAExecutionType_ORDER_REPLACED         ProtoOAExecutionType = 4  // Pending order is changed with a new one.
	ProtoOAExecutionType_ORDER_CANCELLED        ProtoOAExecutionType = 5  // Order cancelled.
	ProtoOAExecutionType_ORDER_EXPIRED          ProtoOAExecutionType = 6  // Order with GTD time in force is expired.
	ProtoOAExecutionType_ORDER_REJECTED         ProtoOAExecutionType = 7  // Order is rejected due to validations.
	ProtoOAExecutionType_ORDER_CANCEL_REJECTED  ProtoOAExecutionType = 8  // Cancel order request is rejected.
	ProtoOAExecutionType_SWAP                   ProtoOAExecutionType = 9  // Type related to SWAP execution events.
	ProtoOAExecutionType_DEPOSIT_WITHDRAW       ProtoOAExecutionType = 10 // Type related to event of deposit or withdrawal cash flow operation.
	ProtoOAExecutionType_ORDER_PARTIAL_FILL     ProtoOAExecutionType = 11 // Order is partially filled.
	ProtoOAExecutionType_BONUS_DEPOSIT_WITHDRAW ProtoOAExecutionType = 12 // Type related to event of bonus deposit or bonus withdrawal.
)

type ProtoOAExpectedMargin added in v0.4.1

type ProtoOAExpectedMargin = messages.ProtoOAExpectedMargin

Expected margin computation entity.

type ProtoOAExpectedMarginReq added in v0.4.1

type ProtoOAExpectedMarginReq = messages.ProtoOAExpectedMarginReq

Request for getting the margin estimate according to leverage profiles. Can be used before sending a new order request. This doesn't consider ACCORDING_TO_GSL margin calculation type, as this calculation is trivial: usedMargin = (VWAP price of the position - GSL price) * volume * Quote2Deposit.

type ProtoOAExpectedMarginRes added in v0.4.1

type ProtoOAExpectedMarginRes = messages.ProtoOAExpectedMarginRes

Response to the ProtoOAExpectedMarginReq request.

type ProtoOAGetAccountListByAccessTokenReq added in v0.4.1

type ProtoOAGetAccountListByAccessTokenReq = messages.ProtoOAGetAccountListByAccessTokenReq

Request for getting the list of granted trader's account for the access token.

type ProtoOAGetAccountListByAccessTokenRes added in v0.4.1

type ProtoOAGetAccountListByAccessTokenRes = messages.ProtoOAGetAccountListByAccessTokenRes

Response to the ProtoOAGetAccountListByAccessTokenReq request.

type ProtoOAGetCtidProfileByTokenReq added in v0.4.1

type ProtoOAGetCtidProfileByTokenReq = messages.ProtoOAGetCtidProfileByTokenReq

Request for getting details of Trader's profile. Limited due to GDRP requirements.

type ProtoOAGetCtidProfileByTokenRes added in v0.4.1

type ProtoOAGetCtidProfileByTokenRes = messages.ProtoOAGetCtidProfileByTokenRes

Response to the ProtoOAGetCtidProfileByTokenReq request.

type ProtoOAGetDynamicLeverageByIDReq added in v0.4.1

type ProtoOAGetDynamicLeverageByIDReq = messages.ProtoOAGetDynamicLeverageByIDReq

Request for getting a dynamic leverage entity referenced in ProtoOASymbol.leverageId.

type ProtoOAGetDynamicLeverageByIDRes added in v0.4.1

type ProtoOAGetDynamicLeverageByIDRes = messages.ProtoOAGetDynamicLeverageByIDRes

Response to the ProtoOAGetDynamicLeverageByIDReq request.

type ProtoOAGetPositionUnrealizedPnLReq added in v0.4.1

type ProtoOAGetPositionUnrealizedPnLReq = messages.ProtoOAGetPositionUnrealizedPnLReq

Request for getting trader's positions' unrealized PnLs.

type ProtoOAGetPositionUnrealizedPnLRes added in v0.4.1

type ProtoOAGetPositionUnrealizedPnLRes = messages.ProtoOAGetPositionUnrealizedPnLRes

Response to the ProtoOAGetPositionUnrealizedPnLReq request.

type ProtoOAGetTickDataReq added in v0.4.1

type ProtoOAGetTickDataReq = messages.ProtoOAGetTickDataReq

Request for getting historical tick data for the symbol.

type ProtoOAGetTickDataRes added in v0.4.1

type ProtoOAGetTickDataRes = messages.ProtoOAGetTickDataRes

Response to the ProtoOAGetTickDataReq request.

type ProtoOAGetTrendbarsReq added in v0.4.1

type ProtoOAGetTrendbarsReq = messages.ProtoOAGetTrendbarsReq

Request for getting historical trend bars for the symbol.

type ProtoOAGetTrendbarsRes added in v0.4.1

type ProtoOAGetTrendbarsRes = messages.ProtoOAGetTrendbarsRes

Response to the ProtoOAGetTrendbarsReq request.

type ProtoOAHoliday added in v0.4.1

type ProtoOAHoliday = messages.ProtoOAHoliday

Holiday entity.

type ProtoOAInterval added in v0.4.1

type ProtoOAInterval = messages.ProtoOAInterval

Symbol trading session entity.

type ProtoOALightSymbol added in v0.4.1

type ProtoOALightSymbol = messages.ProtoOALightSymbol

ProtoOALightSymbol entity.

type ProtoOALimitedRiskMarginCalculationStrategy added in v0.4.1

type ProtoOALimitedRiskMarginCalculationStrategy = messages.ProtoOALimitedRiskMarginCalculationStrategy

Enum for limited risk margin calculation strategy.

const (
	ProtoOALimitedRiskMarginCalculationStrategy_ACCORDING_TO_LEVERAGE         ProtoOALimitedRiskMarginCalculationStrategy = 0
	ProtoOALimitedRiskMarginCalculationStrategy_ACCORDING_TO_GSL              ProtoOALimitedRiskMarginCalculationStrategy = 1
	ProtoOALimitedRiskMarginCalculationStrategy_ACCORDING_TO_GSL_AND_LEVERAGE ProtoOALimitedRiskMarginCalculationStrategy = 2
)

type ProtoOAMarginCall added in v0.4.1

type ProtoOAMarginCall = messages.ProtoOAMarginCall

Margin call entity, specifies threshold for exact margin call type. Only 3 instances of margin calls are supported, identified by marginCallType. See ProtoOANotificationType for details.

type ProtoOAMarginCallListReq added in v0.4.1

type ProtoOAMarginCallListReq = messages.ProtoOAMarginCallListReq

Request for a list of existing margin call thresholds configured for a user.

type ProtoOAMarginCallListRes added in v0.4.1

type ProtoOAMarginCallListRes = messages.ProtoOAMarginCallListRes

Response to the ProtoOATraderLogoutReq request. Has a list of existing user Margin Calls, usually contains 3 items.

type ProtoOAMarginCallTriggerEvent added in v0.4.1

type ProtoOAMarginCallTriggerEvent = messages.ProtoOAMarginCallTriggerEvent

Event that is sent when account margin level reaches target marginLevelThreshold. Event is sent no more than once every 10 minutes to avoid spamming.

type ProtoOAMarginCallUpdateEvent added in v0.4.1

type ProtoOAMarginCallUpdateEvent = messages.ProtoOAMarginCallUpdateEvent

Event that is sent when a Margin Call threshold configuration is updated.

type ProtoOAMarginCallUpdateReq added in v0.4.1

type ProtoOAMarginCallUpdateReq = messages.ProtoOAMarginCallUpdateReq

Request to modify marginLevelThreshold of specified marginCallType for ctidTraderAccountId.

type ProtoOAMarginCallUpdateRes added in v0.4.1

type ProtoOAMarginCallUpdateRes = messages.ProtoOAMarginCallUpdateRes

Response to the ProtoOAMarginCallUpdateReq request. If this response received, it means that margin call was successfully updated.

type ProtoOAMarginChangedEvent added in v0.4.1

type ProtoOAMarginChangedEvent = messages.ProtoOAMarginChangedEvent

Event that is sent when the margin allocated to a specific position is changed.

type ProtoOAMinCommissionType added in v0.4.1

type ProtoOAMinCommissionType = messages.ProtoOAMinCommissionType

Enum for specifying type of minimum trading commission.

const (
	ProtoOAMinCommissionType_CURRENCY       ProtoOAMinCommissionType = 1
	ProtoOAMinCommissionType_QUOTE_CURRENCY ProtoOAMinCommissionType = 2
)

type ProtoOANewOrderReq added in v0.4.1

type ProtoOANewOrderReq = messages.ProtoOANewOrderReq

Request for sending a new trading order. Allowed only if the accessToken has the "trade" permissions for the trading account.

type ProtoOANewOrderRes added in v0.4.1

type ProtoOANewOrderRes = messages.ProtoOAExecutionEvent

Response to the ProtoOANewOrderReq request. IMPORTANT: ProtoOANewOrderReq is async, the API client makes ProtoOANewOrderReq syncronous by providing this type as an assertion to ProtoOAExecutionEvent. That way you have a syncronous request and do not need to worry about ProtoOAExecutionEvent.

type ProtoOANotificationType added in v0.4.1

type ProtoOANotificationType = messages.ProtoOANotificationType

Type of notification, currently only 3 instances of marginCall are supported.

const (
	ProtoOANotificationType_MARGIN_LEVEL_THRESHOLD_1 ProtoOANotificationType = 61 // One of three margin calls, they are all similar.
	ProtoOANotificationType_MARGIN_LEVEL_THRESHOLD_2 ProtoOANotificationType = 62 // One of three margin calls, they are all similar.
	ProtoOANotificationType_MARGIN_LEVEL_THRESHOLD_3 ProtoOANotificationType = 63 // One of three margin calls, they are all similar.
)

type ProtoOAOrder added in v0.4.1

type ProtoOAOrder = messages.ProtoOAOrder

Trade order entity.

type ProtoOAOrderDetailsReq added in v0.4.1

type ProtoOAOrderDetailsReq = messages.ProtoOAOrderDetailsReq

Request for getting Order and its related Deals.

type ProtoOAOrderDetailsRes added in v0.4.1

type ProtoOAOrderDetailsRes = messages.ProtoOAOrderDetailsRes

Response to the ProtoOAOrderDetailsReq request.

type ProtoOAOrderListByPositionIdReq added in v0.4.1

type ProtoOAOrderListByPositionIdReq = messages.ProtoOAOrderListByPositionIdReq

Request for retrieving Orders related to a Position by using Position ID. Filtered by utcLastUpdateTimestamp.

type ProtoOAOrderListByPositionIdRes added in v0.4.1

type ProtoOAOrderListByPositionIdRes = messages.ProtoOAOrderListByPositionIdRes

Response to the ProtoOAOrderListByPositionIdReq request.

type ProtoOAOrderListReq added in v0.4.1

type ProtoOAOrderListReq = messages.ProtoOAOrderListReq

Request for getting Trader's orders filtered by timestamp.

type ProtoOAOrderListRes added in v0.4.1

type ProtoOAOrderListRes = messages.ProtoOAOrderListRes

Response to the ProtoOAOrderListReq request.

type ProtoOAOrderStatus added in v0.4.1

type ProtoOAOrderStatus = messages.ProtoOAOrderStatus

Enum for order status.

const (
	ProtoOAOrderStatus_ORDER_STATUS_ACCEPTED  ProtoOAOrderStatus = 1 // Order request validated and accepted for execution.
	ProtoOAOrderStatus_ORDER_STATUS_FILLED    ProtoOAOrderStatus = 2 // Order is fully filled.
	ProtoOAOrderStatus_ORDER_STATUS_REJECTED  ProtoOAOrderStatus = 3 // Order is rejected due to validation.
	ProtoOAOrderStatus_ORDER_STATUS_EXPIRED   ProtoOAOrderStatus = 4 // Order expired. Might be valid for orders with partially filled volume that were expired on LP.
	ProtoOAOrderStatus_ORDER_STATUS_CANCELLED ProtoOAOrderStatus = 5 // Order is cancelled. Might be valid for orders with partially filled volume that were cancelled by LP.
)

type ProtoOAOrderTriggerMethod added in v0.4.1

type ProtoOAOrderTriggerMethod = messages.ProtoOAOrderTriggerMethod

Enum for stop order and stop loss triggering method.

const (
	ProtoOAOrderTriggerMethod_TRADE           ProtoOAOrderTriggerMethod = 1 // Stop Order: buy is triggered by ask, sell by bid; Stop Loss Order: for buy position is triggered by bid and for sell position by ask.
	ProtoOAOrderTriggerMethod_OPPOSITE        ProtoOAOrderTriggerMethod = 2 // Stop Order: buy is triggered by bid, sell by ask; Stop Loss Order: for buy position is triggered by ask and for sell position by bid.
	ProtoOAOrderTriggerMethod_DOUBLE_TRADE    ProtoOAOrderTriggerMethod = 3 // The same as TRADE, but trigger is checked after the second consecutive tick.
	ProtoOAOrderTriggerMethod_DOUBLE_OPPOSITE ProtoOAOrderTriggerMethod = 4 // The same as OPPOSITE, but trigger is checked after the second consecutive tick.
)

type ProtoOAOrderType added in v0.4.1

type ProtoOAOrderType = messages.ProtoOAOrderType

Enum for order type.

const (
	ProtoOAOrderType_MARKET                ProtoOAOrderType = 1
	ProtoOAOrderType_LIMIT                 ProtoOAOrderType = 2
	ProtoOAOrderType_STOP                  ProtoOAOrderType = 3
	ProtoOAOrderType_STOP_LOSS_TAKE_PROFIT ProtoOAOrderType = 4
	ProtoOAOrderType_MARKET_RANGE          ProtoOAOrderType = 5
	ProtoOAOrderType_STOP_LIMIT            ProtoOAOrderType = 6
)

type ProtoOAPayloadType added in v0.4.1

type ProtoOAPayloadType = messages.ProtoOAPayloadType

Enum for payload type.

const (
	PROTO_OA_APPLICATION_AUTH_REQ ProtoOAPayloadType = 2100
	// PROTO_OA_APPLICATION_AUTH_RES             ProtoOAPayloadType = 2101
	PROTO_OA_ACCOUNT_AUTH_REQ ProtoOAPayloadType = 2102
	// PROTO_OA_ACCOUNT_AUTH_RES                 ProtoOAPayloadType = 2103
	PROTO_OA_VERSION_REQ ProtoOAPayloadType = 2104
	// PROTO_OA_VERSION_RES                      ProtoOAPayloadType = 2105
	PROTO_OA_NEW_ORDER_REQ             ProtoOAPayloadType = 2106
	PROTO_OA_TRAILING_SL_CHANGED_EVENT ProtoOAPayloadType = 2107
	PROTO_OA_CANCEL_ORDER_REQ          ProtoOAPayloadType = 2108
	PROTO_OA_AMEND_ORDER_REQ           ProtoOAPayloadType = 2109
	PROTO_OA_AMEND_POSITION_SLTP_REQ   ProtoOAPayloadType = 2110
	PROTO_OA_CLOSE_POSITION_REQ        ProtoOAPayloadType = 2111
	PROTO_OA_ASSET_LIST_REQ            ProtoOAPayloadType = 2112
	// PROTO_OA_ASSET_LIST_RES                   ProtoOAPayloadType = 2113
	PROTO_OA_SYMBOLS_LIST_REQ ProtoOAPayloadType = 2114
	// PROTO_OA_SYMBOLS_LIST_RES                 ProtoOAPayloadType = 2115
	PROTO_OA_SYMBOL_BY_ID_REQ ProtoOAPayloadType = 2116
	// PROTO_OA_SYMBOL_BY_ID_RES                 ProtoOAPayloadType = 2117
	PROTO_OA_SYMBOLS_FOR_CONVERSION_REQ ProtoOAPayloadType = 2118
	// PROTO_OA_SYMBOLS_FOR_CONVERSION_RES       ProtoOAPayloadType = 2119
	PROTO_OA_SYMBOL_CHANGED_EVENT ProtoOAPayloadType = 2120
	PROTO_OA_TRADER_REQ           ProtoOAPayloadType = 2121
	// PROTO_OA_TRADER_RES                       ProtoOAPayloadType = 2122
	PROTO_OA_TRADER_UPDATE_EVENT ProtoOAPayloadType = 2123
	PROTO_OA_RECONCILE_REQ       ProtoOAPayloadType = 2124
	// PROTO_OA_RECONCILE_RES                    ProtoOAPayloadType = 2125
	PROTO_OA_EXECUTION_EVENT     ProtoOAPayloadType = 2126
	PROTO_OA_SUBSCRIBE_SPOTS_REQ ProtoOAPayloadType = 2127
	// PROTO_OA_SUBSCRIBE_SPOTS_RES              ProtoOAPayloadType = 2128
	PROTO_OA_UNSUBSCRIBE_SPOTS_REQ ProtoOAPayloadType = 2129
	// PROTO_OA_UNSUBSCRIBE_SPOTS_RES            ProtoOAPayloadType = 2130
	PROTO_OA_SPOT_EVENT        ProtoOAPayloadType = 2131
	PROTO_OA_ORDER_ERROR_EVENT ProtoOAPayloadType = 2132
	PROTO_OA_DEAL_LIST_REQ     ProtoOAPayloadType = 2133
	// PROTO_OA_DEAL_LIST_RES                    ProtoOAPayloadType = 2134
	PROTO_OA_SUBSCRIBE_LIVE_TRENDBAR_REQ   ProtoOAPayloadType = 2135
	PROTO_OA_UNSUBSCRIBE_LIVE_TRENDBAR_REQ ProtoOAPayloadType = 2136
	PROTO_OA_GET_TRENDBARS_REQ             ProtoOAPayloadType = 2137
	// PROTO_OA_GET_TRENDBARS_RES                ProtoOAPayloadType = 2138
	PROTO_OA_EXPECTED_MARGIN_REQ ProtoOAPayloadType = 2139
	// PROTO_OA_EXPECTED_MARGIN_RES              ProtoOAPayloadType = 2140
	PROTO_OA_MARGIN_CHANGED_EVENT       ProtoOAPayloadType = 2141
	PROTO_OA_ERROR_RES                  ProtoOAPayloadType = 2142
	PROTO_OA_CASH_FLOW_HISTORY_LIST_REQ ProtoOAPayloadType = 2143
	// PROTO_OA_CASH_FLOW_HISTORY_LIST_RES       ProtoOAPayloadType = 2144
	PROTO_OA_GET_TICKDATA_REQ ProtoOAPayloadType = 2145
	// PROTO_OA_GET_TICKDATA_RES                 ProtoOAPayloadType = 2146
	PROTO_OA_ACCOUNTS_TOKEN_INVALIDATED_EVENT ProtoOAPayloadType = 2147
	PROTO_OA_CLIENT_DISCONNECT_EVENT          ProtoOAPayloadType = 2148
	PROTO_OA_GET_ACCOUNTS_BY_ACCESS_TOKEN_REQ ProtoOAPayloadType = 2149
	// PROTO_OA_GET_ACCOUNTS_BY_ACCESS_TOKEN_RES ProtoOAPayloadType = 2150
	PROTO_OA_GET_CTID_PROFILE_BY_TOKEN_REQ ProtoOAPayloadType = 2151
	// PROTO_OA_GET_CTID_PROFILE_BY_TOKEN_RES    ProtoOAPayloadType = 2152
	PROTO_OA_ASSET_CLASS_LIST_REQ ProtoOAPayloadType = 2153
	// PROTO_OA_ASSET_CLASS_LIST_RES             ProtoOAPayloadType = 2154
	PROTO_OA_DEPTH_EVENT                ProtoOAPayloadType = 2155
	PROTO_OA_SUBSCRIBE_DEPTH_QUOTES_REQ ProtoOAPayloadType = 2156
	// PROTO_OA_SUBSCRIBE_DEPTH_QUOTES_RES       ProtoOAPayloadType = 2157
	PROTO_OA_UNSUBSCRIBE_DEPTH_QUOTES_REQ ProtoOAPayloadType = 2158
	// PROTO_OA_UNSUBSCRIBE_DEPTH_QUOTES_RES     ProtoOAPayloadType = 2159
	PROTO_OA_SYMBOL_CATEGORY_REQ ProtoOAPayloadType = 2160
	// PROTO_OA_SYMBOL_CATEGORY_RES              ProtoOAPayloadType = 2161
	PROTO_OA_ACCOUNT_LOGOUT_REQ ProtoOAPayloadType = 2162
	// PROTO_OA_ACCOUNT_LOGOUT_RES               ProtoOAPayloadType = 2163
	PROTO_OA_ACCOUNT_DISCONNECT_EVENT ProtoOAPayloadType = 2164
	// PROTO_OA_SUBSCRIBE_LIVE_TRENDBAR_RES      ProtoOAPayloadType = 2165
	// PROTO_OA_UNSUBSCRIBE_LIVE_TRENDBAR_RES    ProtoOAPayloadType = 2166
	PROTO_OA_MARGIN_CALL_LIST_REQ ProtoOAPayloadType = 2167
	// PROTO_OA_MARGIN_CALL_LIST_RES             ProtoOAPayloadType = 2168
	PROTO_OA_MARGIN_CALL_UPDATE_REQ ProtoOAPayloadType = 2169
	// PROTO_OA_MARGIN_CALL_UPDATE_RES           ProtoOAPayloadType = 2170
	PROTO_OA_MARGIN_CALL_UPDATE_EVENT  ProtoOAPayloadType = 2171
	PROTO_OA_MARGIN_CALL_TRIGGER_EVENT ProtoOAPayloadType = 2172
	PROTO_OA_REFRESH_TOKEN_REQ         ProtoOAPayloadType = 2173
	// PROTO_OA_REFRESH_TOKEN_RES                ProtoOAPayloadType = 2174
	PROTO_OA_ORDER_LIST_REQ ProtoOAPayloadType = 2175
	// PROTO_OA_ORDER_LIST_RES                   ProtoOAPayloadType = 2176
	PROTO_OA_GET_DYNAMIC_LEVERAGE_REQ ProtoOAPayloadType = 2177
	// PROTO_OA_GET_DYNAMIC_LEVERAGE_RES         ProtoOAPayloadType = 2178
	PROTO_OA_DEAL_LIST_BY_POSITION_ID_REQ ProtoOAPayloadType = 2179
	// PROTO_OA_DEAL_LIST_BY_POSITION_ID_RES     ProtoOAPayloadType = 2180
	PROTO_OA_ORDER_DETAILS_REQ ProtoOAPayloadType = 2181
	// PROTO_OA_ORDER_DETAILS_RES                ProtoOAPayloadType = 2182
	PROTO_OA_ORDER_LIST_BY_POSITION_ID_REQ ProtoOAPayloadType = 2183
	// PROTO_OA_ORDER_LIST_BY_POSITION_ID_RES    ProtoOAPayloadType = 2184
	PROTO_OA_DEAL_OFFSET_LIST_REQ ProtoOAPayloadType = 2185
	// PROTO_OA_DEAL_OFFSET_LIST_RES             ProtoOAPayloadType = 2186
	PROTO_OA_GET_POSITION_UNREALIZED_PNL_REQ ProtoOAPayloadType = 2187
)

type ProtoOAPosition added in v0.4.1

type ProtoOAPosition = messages.ProtoOAPosition

Trade position entity.

type ProtoOAPositionStatus added in v0.4.1

type ProtoOAPositionStatus = messages.ProtoOAPositionStatus

Enum for position status.

const (
	ProtoOAPositionStatus_POSITION_STATUS_OPEN    ProtoOAPositionStatus = 1
	ProtoOAPositionStatus_POSITION_STATUS_CLOSED  ProtoOAPositionStatus = 2
	ProtoOAPositionStatus_POSITION_STATUS_CREATED ProtoOAPositionStatus = 3 // Empty position is created for pending order.
	ProtoOAPositionStatus_POSITION_STATUS_ERROR   ProtoOAPositionStatus = 4
)

type ProtoOAPositionUnrealizedPnL added in v0.4.1

type ProtoOAPositionUnrealizedPnL = messages.ProtoOAPositionUnrealizedPnL

Position unrealized profit and loss entity.

type ProtoOAQuoteType added in v0.4.1

type ProtoOAQuoteType = messages.ProtoOAQuoteType

Price quote type.

const (
	ProtoOAQuoteType_BID ProtoOAQuoteType = 1
	ProtoOAQuoteType_ASK ProtoOAQuoteType = 2
)

type ProtoOAReconcileReq added in v0.4.1

type ProtoOAReconcileReq = messages.ProtoOAReconcileReq

Request for getting Trader's current open positions and pending orders data.

type ProtoOAReconcileRes added in v0.4.1

type ProtoOAReconcileRes = messages.ProtoOAReconcileRes

Response to the ProtoOAReconcileReq request.

type ProtoOARefreshTokenRes added in v0.4.1

type ProtoOARefreshTokenRes = messages.ProtoOARefreshTokenRes

Response to the ProtoOARefreshTokenReq request.

type ProtoOASpotEvent added in v0.4.1

type ProtoOASpotEvent = messages.ProtoOASpotEvent

Event that is sent when a new spot event is generated on the server side. Requires subscription on the spot events, see ProtoOASubscribeSpotsReq. First event, received after subscription will contain latest spot prices even if market is closed.

type ProtoOAStopOutStrategy added in v0.4.1

type ProtoOAStopOutStrategy = messages.ProtoOAStopOutStrategy

Enum for stop out strategy.

const (
	ProtoOAStopOutStrategy_MOST_MARGIN_USED_FIRST ProtoOAStopOutStrategy = 0 // A Stop Out strategy that closes a Position with the largest Used Margin.
	ProtoOAStopOutStrategy_MOST_LOSING_FIRST      ProtoOAStopOutStrategy = 1 // A Stop Out strategy that closes a Position with the least PnL.
)

type ProtoOASwapCalculationType added in v0.4.1

type ProtoOASwapCalculationType = messages.ProtoOASwapCalculationType

Enum for specifying SWAP calculation type for symbol.

const (
	ProtoOASwapCalculationType_PIPS       ProtoOASwapCalculationType = 0 // Specifies type of SWAP computation as PIPS (0).
	ProtoOASwapCalculationType_PERCENTAGE ProtoOASwapCalculationType = 1 // Specifies type of SWAP computation as PERCENTAGE (1, annual, in percent).
	ProtoOASwapCalculationType_POINTS     ProtoOASwapCalculationType = 2 // Specifies type of SWAP computation as POINTS (2).
)

type ProtoOASymbol added in v0.4.1

type ProtoOASymbol = messages.ProtoOASymbol

Trading symbol entity.

type ProtoOASymbolByIdReq added in v0.4.1

type ProtoOASymbolByIdReq = messages.ProtoOASymbolByIdReq

Request for getting a full symbol entity.

type ProtoOASymbolByIdRes added in v0.4.1

type ProtoOASymbolByIdRes = messages.ProtoOASymbolByIdRes

Response to the ProtoOASymbolByIdReq request.

type ProtoOASymbolCategory added in v0.4.1

type ProtoOASymbolCategory = messages.ProtoOASymbolCategory

Symbol category entity.

type ProtoOASymbolCategoryListReq added in v0.4.1

type ProtoOASymbolCategoryListReq = messages.ProtoOASymbolCategoryListReq

Request for a list of symbol categories available for a trading account.

type ProtoOASymbolCategoryListRes added in v0.4.1

type ProtoOASymbolCategoryListRes = messages.ProtoOASymbolCategoryListRes

Response to the ProtoSymbolCategoryListReq request.

type ProtoOASymbolChangedEvent added in v0.4.1

type ProtoOASymbolChangedEvent = messages.ProtoOASymbolChangedEvent

Event that is sent when the symbol is changed on the Server side.

type ProtoOASymbolDistanceType added in v0.4.1

type ProtoOASymbolDistanceType = messages.ProtoOASymbolDistanceType

Enum for specifying stop loss and take profit distances.

const (
	ProtoOASymbolDistanceType_SYMBOL_DISTANCE_IN_POINTS     ProtoOASymbolDistanceType = 1
	ProtoOASymbolDistanceType_SYMBOL_DISTANCE_IN_PERCENTAGE ProtoOASymbolDistanceType = 2
)

type ProtoOASymbolsForConversionReq added in v0.4.1

type ProtoOASymbolsForConversionReq = messages.ProtoOASymbolsForConversionReq

Request for getting a conversion chain between two assets that consists of several symbols. Use when no direct quote is available.

type ProtoOASymbolsForConversionRes added in v0.4.1

type ProtoOASymbolsForConversionRes = messages.ProtoOASymbolsForConversionRes

Response to the ProtoOASymbolsForConversionReq request.

type ProtoOASymbolsListReq added in v0.4.1

type ProtoOASymbolsListReq = messages.ProtoOASymbolsListReq

Request for a list of symbols available for a trading account. Symbol entries are returned with the limited set of fields.

type ProtoOASymbolsListRes added in v0.4.1

type ProtoOASymbolsListRes = messages.ProtoOASymbolsListRes

Response to the ProtoOASymbolsListReq request.

type ProtoOATickData added in v0.4.1

type ProtoOATickData = messages.ProtoOATickData

Historical tick data type.

type ProtoOATimeInForce added in v0.4.1

type ProtoOATimeInForce = messages.ProtoOATimeInForce

Enum for order's time in force.

const (
	ProtoOATimeInForce_GOOD_TILL_DATE      ProtoOATimeInForce = 1
	ProtoOATimeInForce_GOOD_TILL_CANCEL    ProtoOATimeInForce = 2
	ProtoOATimeInForce_IMMEDIATE_OR_CANCEL ProtoOATimeInForce = 3
	ProtoOATimeInForce_FILL_OR_KILL        ProtoOATimeInForce = 4
	ProtoOATimeInForce_MARKET_ON_OPEN      ProtoOATimeInForce = 5
)

type ProtoOATotalMarginCalculationType added in v0.4.1

type ProtoOATotalMarginCalculationType = messages.ProtoOATotalMarginCalculationType

Enum for specifying margin calculation type for an account.

const (
	ProtoOATotalMarginCalculationType_MAX ProtoOATotalMarginCalculationType = 0
	ProtoOATotalMarginCalculationType_SUM ProtoOATotalMarginCalculationType = 1
	ProtoOATotalMarginCalculationType_NET ProtoOATotalMarginCalculationType = 2
)

type ProtoOATradeData added in v0.4.1

type ProtoOATradeData = messages.ProtoOATradeData

Position/order trading details entity.

type ProtoOATradeSide added in v0.4.1

type ProtoOATradeSide = messages.ProtoOATradeSide

Enum for trade side. Used for order, position, deal.

const (
	ProtoOATradeSide_BUY  ProtoOATradeSide = 1
	ProtoOATradeSide_SELL ProtoOATradeSide = 2
)

type ProtoOATrader added in v0.4.1

type ProtoOATrader = messages.ProtoOATrader

Trading account entity.

type ProtoOATraderReq added in v0.4.1

type ProtoOATraderReq = messages.ProtoOATraderReq

Request for getting data of Trader's Account.

type ProtoOATraderRes added in v0.4.1

type ProtoOATraderRes = messages.ProtoOATraderRes

Response to the ProtoOATraderReq request.

type ProtoOATraderUpdatedEvent added in v0.4.1

type ProtoOATraderUpdatedEvent = messages.ProtoOATraderUpdatedEvent

Event that is sent when a Trader is updated on Server side.

type ProtoOATradingMode added in v0.4.1

type ProtoOATradingMode = messages.ProtoOATradingMode

Enum for specifying symbol trading mode.

const (
	ProtoOATradingMode_ENABLED                             ProtoOATradingMode = 0
	ProtoOATradingMode_DISABLED_WITHOUT_PENDINGS_EXECUTION ProtoOATradingMode = 1
	ProtoOATradingMode_DISABLED_WITH_PENDINGS_EXECUTION    ProtoOATradingMode = 2
	ProtoOATradingMode_CLOSE_ONLY_MODE                     ProtoOATradingMode = 3
)

type ProtoOATrailingSLChangedEvent added in v0.4.1

type ProtoOATrailingSLChangedEvent = messages.ProtoOATrailingSLChangedEvent

Event that is sent when the level of the Trailing Stop Loss is changed due to the price level changes.

type ProtoOATrendbar added in v0.4.1

type ProtoOATrendbar = messages.ProtoOATrendbar

Historical Trendbar entity.

type ProtoOATrendbarPeriod added in v0.4.1

type ProtoOATrendbarPeriod = messages.ProtoOATrendbarPeriod

Enum for trendbar period.

const (
	ProtoOATrendbarPeriod_M1  ProtoOATrendbarPeriod = 1
	ProtoOATrendbarPeriod_M2  ProtoOATrendbarPeriod = 2
	ProtoOATrendbarPeriod_M3  ProtoOATrendbarPeriod = 3
	ProtoOATrendbarPeriod_M4  ProtoOATrendbarPeriod = 4
	ProtoOATrendbarPeriod_M5  ProtoOATrendbarPeriod = 5
	ProtoOATrendbarPeriod_M10 ProtoOATrendbarPeriod = 6
	ProtoOATrendbarPeriod_M15 ProtoOATrendbarPeriod = 7
	ProtoOATrendbarPeriod_M30 ProtoOATrendbarPeriod = 8
	ProtoOATrendbarPeriod_H1  ProtoOATrendbarPeriod = 9
	ProtoOATrendbarPeriod_H4  ProtoOATrendbarPeriod = 10
	ProtoOATrendbarPeriod_H12 ProtoOATrendbarPeriod = 11
	ProtoOATrendbarPeriod_D1  ProtoOATrendbarPeriod = 12
	ProtoOATrendbarPeriod_W1  ProtoOATrendbarPeriod = 13
	ProtoOATrendbarPeriod_MN1 ProtoOATrendbarPeriod = 14
)

type ProtoOAVersionReq added in v0.4.1

type ProtoOAVersionReq = messages.ProtoOAVersionReq

Request for getting the proxy version. Can be used to check the current version of the Open API scheme.

type ProtoOAVersionRes added in v0.4.1

type ProtoOAVersionRes = messages.ProtoOAVersionRes

Response to the ProtoOAVersionReq request.

type RateLimiter

type RateLimiter interface {
	SetPenalty(duration time.Duration)
	WaitForPermit()
}

func NewRateLimiter

func NewRateLimiter(n int, interval, hitTimeout time.Duration) (RateLimiter, error)

type RefreshToken

type RefreshToken string

type RequestContextExpiredError

type RequestContextExpiredError struct {
	Err error
}

func (*RequestContextExpiredError) Error

type RequestContextManager added in v0.4.0

type RequestContextManager interface {
	Start() error
	Stop() error
	SetIterationInterval(time.Duration) error
	AddNode(*RequestMetaData) error
	RemoveNode(RequestId) (*RequestMetaData, error)
	UpdateNodeCtx(RequestId, context.Context) error
}

func NewRequestContextManager added in v0.4.0

func NewRequestContextManager() RequestContextManager

type RequestContextManagerAlreadyRunningError added in v0.4.0

type RequestContextManagerAlreadyRunningError struct {
	CallContext string
}

func (*RequestContextManagerAlreadyRunningError) Error added in v0.4.0

type RequestContextManagerClearedError added in v0.4.0

type RequestContextManagerClearedError struct{}

func (*RequestContextManagerClearedError) Error added in v0.4.0

type RequestContextManagerNodeAlreadyIncludedError added in v0.4.0

type RequestContextManagerNodeAlreadyIncludedError struct {
	CallContext string
	Id          RequestId
}

func (*RequestContextManagerNodeAlreadyIncludedError) Error added in v0.4.0

type RequestContextManagerNodeNotIncludedError added in v0.4.0

type RequestContextManagerNodeNotIncludedError struct {
	CallContext string
	Id          RequestId
}

func (*RequestContextManagerNodeNotIncludedError) Error added in v0.4.0

type RequestContextManagerNotRunningError added in v0.4.0

type RequestContextManagerNotRunningError struct {
	CallContext string
}

func (*RequestContextManagerNotRunningError) Error added in v0.4.0

type RequestData

type RequestData struct {
	Ctx     context.Context
	Timeout time.Duration
	Req     OpenAPIPayload
	Res     OpenAPIPayload
}

func (*RequestData) CheckError

func (d *RequestData) CheckError() error

type RequestId

type RequestId string

type RequestMetaData

type RequestMetaData struct {
	*RequestData

	Id RequestId

	ErrCh     chan error
	CtxErrCh  chan error
	ResDataCh chan *ResponseData

	CancelCtx context.CancelFunc // Designed to cancel *RequestData.Ctx
}

func NewRequestMetaData

func NewRequestMetaData(reqData *RequestData, errCh chan error, ctxErrCh chan error, resDataCh chan *ResponseData) (*RequestMetaData, error)

type RequestQueue

type RequestQueue interface {
	WithDataCallbackChan(chan struct{}) RequestQueue
	Clear()
	Enqueue(*RequestMetaData) error
	Dequeue() (*RequestMetaData, error)
	RemoveFromQueue(RequestId) error
}

func NewRequestQueue

func NewRequestQueue() RequestQueue

type ResponseData

type ResponseData struct {
	ProtoMsg    *messages.ProtoMessage
	PayloadType messages.ProtoOAPayloadType
}

type RetryBackoff

type RetryBackoff interface {
	Reset()

	Backoff()
	WaitForPermit(context.Context) bool
}

func NewRetryBackoff

func NewRetryBackoff(ladder []time.Duration, stepDownAfter time.Duration) (RetryBackoff, error)

type SourceChannelNotExistingError

type SourceChannelNotExistingError struct {
	EventType EventType
}

func (*SourceChannelNotExistingError) Error

Jump to

Keyboard shortcuts

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