lib

package
v0.0.0-...-852338e Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *logging.Logger

Logger -

Functions

This section is empty.

Types

type ActiveAssets

type ActiveAssets struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ActiveAssets -

type Apps

type Apps struct {
	HTTPClient  func() *core.HTTPClient
	Websocket   func() *interfaces.WebsocketClient
	Option      core.BrokerOption
	Control     *control
	ControlTest *controlTest
}

Apps -

func (*Apps) GetCallback

func (cc *Apps) GetCallback() (data interface{})

GetCallback -

func (*Apps) Run

func (cc *Apps) Run(hc func() *core.HTTPClient, wsc func() *interfaces.WebsocketClient) bool

Run -

func (*Apps) SetCallback

func (cc *Apps) SetCallback(data interface{})

SetCallback -

type AssetsData

AssetsData -

type BalanceChanged

type BalanceChanged struct {
	Name             string `json:"name"`
	MicroserviceName string `json:"microserviceName"`
	Msg              struct {
		ID             int64 `json:"id"`
		UserID         int64 `json:"user_id"`
		CurrentBalance struct {
			ID               int64   `json:"id"`
			Type             int     `json:"type"`
			Index            int64   `json:"index"`
			Amount           float64 `json:"amount"`
			IsFiat           bool    `json:"if_fiat"`
			Currency         string  `json:"currency"`
			NewAmount        float64 `json:"new_amount"`
			IsMarginal       bool    `json:"is_marginal"`
			BonusAmount      float64 `json:"bonus_amount"`
			EnrolledAmount   float64 `json:"enrolled_amount"`
			BonusTotalAmount float64 `json:"bonus_total_amount"`
		} `json:"current_balance"`
	} `json:"msg"`
}

BalanceChanged -

type Balances

type Balances struct {
	ID                int64   `json:"id"`
	UserID            int64   `json:"user_id"`
	Type              int     `json:"type"`
	Amount            float64 `json:"amount"`
	EnrolledAmount    float64 `json:"enrolled_amount"`
	EnrolledSumAmount float64 `json:"enrolled_sum_amount"`
	HoldAmount        float64 `json:"hold_amount"`
	OrdersAmount      float64 `json:"orders_amount"`
	AuthAmount        float64 `json:"auth_amount"`
	Equivalent        float64 `json:"equivalent"`
	Currency          string  `json:"currency"`
	IsFiat            bool    `json:"is_fiat"`
	IsMarginal        bool    `json:"is_marginal"`
	HasDeposits       bool    `json:"has_deposits"`
}

Balances -

type BuyBinary

type BuyBinary struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Body    struct {
		ActiveID      int     `json:"active_id"`
		OptionTypeID  int     `json:"option_type_id"`
		UserBalanceID int64   `json:"user_balance_id"`
		Direction     string  `json:"direction"`
		Expired       int64   `json:"expired"`
		Price         float64 `json:"price"`
		ProfitPercent float64 `json:"profit_percent"`
		Value         float64 `json:"value"`
		RefundValue   float64 `json:"refund_value"`
	} `json:"body"`
}

BuyBinary -

type BuyDigital

type BuyDigital struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Body    struct {
		UserBalanceID int64  `json:"user_balance_id"`
		Amount        string `json:"amount"`
		InstrumentID  string `json:"instrument_id"`
	} `json:"body"`
}

BuyDigital -

type Database

type Database struct {
	DB         *nutsdb.DB
	Stores     Stores
	Logger     *logging.Logger
	ID         string
	DBLocation string
	// contains filtered or unexported fields
}

Database -

func GetDatabase

func GetDatabase(id string) *Database

GetDatabase -

func NewDatabase

func NewDatabase(loc, id string, lo *logging.Logger) *Database

NewDatabase -

func (*Database) Close

func (cc *Database) Close() error

Close -

func (*Database) Del

func (cc *Database) Del(bucket, key string) (err error)

Del -

func (*Database) DeleteAllTransaction

func (cc *Database) DeleteAllTransaction()

DeleteAllTransaction -

func (*Database) DeleteTest

func (cc *Database) DeleteTest(opt tasks.TestTasks) (err error)

DeleteTest -

func (*Database) DeleteTransaction

func (cc *Database) DeleteTransaction(ids int64)

DeleteTransaction -

func (*Database) Get

func (cc *Database) Get(bucket, key string, autocreateBucket bool) (value []byte, err error)

Get -

func (*Database) GetAll

func (cc *Database) GetAll(bucket string) (res interface{})

GetAll -

func (*Database) GetAllTransaction

func (cc *Database) GetAllTransaction(taskID interface{}, status []brokers.DealStatus, startTime int64, limit int) (data []brokers.Transactions)

GetAllTransaction -

func (*Database) GetNLastTransaction

func (cc *Database) GetNLastTransaction(tasksID string, last int) []brokers.Transactions

GetNLastTransaction -

func (*Database) GetStatsTasks

func (cc *Database) GetStatsTasks(taskID string) (ts tasks.StatsTask)

GetStatsTasks -

func (*Database) GetTransaction

func (cc *Database) GetTransaction(id int64) (data brokers.Transactions, err error)

GetTransaction -

func (*Database) Init

func (cc *Database) Init() (err error)

Init -

func (*Database) InsertTest

func (cc *Database) InsertTest(opt tasks.TestTasks) (err error)

InsertTest -

func (*Database) InsertTransacation

func (cc *Database) InsertTransacation(id int64, data interface{}) (err error)

InsertTransacation -

func (*Database) Set

func (cc *Database) Set(bucket, key string, value []byte, autocreateBucket bool) (err error)

Set -

func (*Database) UpdateTest

func (cc *Database) UpdateTest(opt tasks.TestTasks) (err error)

UpdateTest -

type DigitalOpetionPlacedResponse

type DigitalOpetionPlacedResponse struct {
	Name      string `json:"name"`
	RequestID string `json:"request_id"`
	Msg       struct {
		Message string `json:"message"`
		ID      int64  `json:"id"`
	} `json:"msg"`
	Status int `json:"status"`
}

DigitalOpetionPlacedResponse -

type GetComission

type GetComission struct {
	Name      string `json:"name"`
	RequestID string `json:"request_id"`
	Msg       struct {
		Name    string `json:"name"`
		Version string `json:"version"`
		Body    struct {
			InstrumentType string `json:"instrument_type"`
			UserGroupID    int64  `json:"user_group_id"`
		} `json:"body"`
	} `json:"msg"`
}

GetComission -

type GetHistory

type GetHistory struct {
	Name             string `json:"name"`
	Version          string `json:"version"`
	MicroserviceName string `json:"microserviceName"`
	Body             struct {
		UserBalanceID   int64    `json:"user_balance_id"`
		InstrumentTypes []string `json:"instrument_types"`
		Limit           int      `json:"limit"`
		Offset          int      `json:"offset"`
		Start           int64    `json:"start"`
		End             int64    `json:"end"`
	} `json:"body"`
}

GetHistory -

type GetHistoryResponse

type GetHistoryResponse struct {
	Status int `json:"status"`
	Msg    struct {
		Error     string `json:"error"`
		Positions []struct {
			ID                  string  `json:"id"`
			UserID              int64   `json:"user_id"`
			UserBalanceID       int64   `json:"user_balance_id"`
			ExternalID          int64   `json:"external_id"`
			ActiveID            int     `json:"active_id"`
			Source              string  `json:"source"`
			InstrumentType      string  `json:"instrument_type"`
			Status              string  `json:"status"`
			OpenTime            int64   `json:"open_time"`
			OpenQuote           float64 `json:"open_quote"`
			Invest              float64 `json:"invest"`
			InvestEnrolled      float64 `json:"invest_enrolled"`
			CloseQuote          float64 `json:"close_quote"`
			InstrumentID        string  `json:"instrument_id"`
			CloseReason         string  `json:"close_reason"`
			CloseTime           int64   `json:"close_time"`
			CloseProfit         float64 `json:"close_profit"`
			CloseProfitEnrolled float64 `json:"close_profit_enrolled"`
			RawEvent            struct {
				ID                  int64   `json:"id"`
				ExpirationValue     float64 `json:"expiration_value"`
				WinEnrolledAmount   float64 `json:"win_enrolled_amount"`
				Result              string  `json:"result"`
				OpenTime            int64   `json:"open_time"`
				OptionTypeID        int     `json:"option_type_id"`
				UserBalanceType     int     `json:"user_balance_type"`
				Index               int     `json:"index"`
				EnrolledAmount      float64 `json:"enrolled_amount"`
				Direction           string  `json:"direction"`
				BalanceID           int64   `json:"balance_id"`
				OpenTimeMillisecond int64   `json:"open_time_millisecond"`
				OptionType          string  `json:"option_type"`
				UserID              int64   `json:"user_id"`
				Amount              float64 `json:"amount"`
				BuyAmount           float64 `json:"buy_amount"`
				Currency            string  `json:"currency"`
				ProfitAmount        float64 `json:"profit_amount"`
				UserGroupID         int     `json:"user_group_id"`
				ExpirationTime      int64   `json:"expiration_time"`
				Value               float64 `json:"value"`
				OptionID            int64   `json:"option_id"`
				ActiveID            int     `json:"active_id"`
				OrderIds            []int64 `json:"order_ids"`
			} `json:"raw_event"`
		} `json:"positions"`
	} `json:"msg"`
}

GetHistoryResponse -

type LoginResponseError

type LoginResponseError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

LoginResponseError -

type LoginSuccess

type LoginSuccess struct {
	Code string `json:"code"`
	SSID string `json:"ssid"`
}

LoginSuccess -

type MessageData

type MessageData struct {
	Name      string `json:"name"`
	Status    int    `json:"status"`
	RequestID string `json:"request_id"`
}

MessageData - get data type of message

type OptionResponse

type OptionResponse struct {
	Name      string `json:"name"`
	RequestID string `json:"request_id"`
	Status    int    `json:"status"`
	Msg       struct {
		Message            string  `json:"message"`
		ID                 int64   `json:"id"`
		UserID             int64   `json:"user_id"`
		RefundValue        float64 `json:"refund_value"`
		Exp                int64   `json:"exp"`
		Price              float64 `json:"price"`
		Created            int64   `json:"created"`
		CreatedMillisecond int64   `json:"created_millisecond"`
		TimeRate           int64   `json:"time_rate"`
		Type               string  `json:"type"`
		Act                int     `json:"act"`
		Direction          string  `json:"direction"`
		Value              float64 `json:"value"`
		ProfitIncome       float64 `json:"profit_income"`
	} `json:"msg"`
}

OptionResponse -

type OptionsClosed

type OptionsClosed struct {
	Name             string `json:"name"`
	MicroserviceName string `json:"microserviceName"`
	Msg              struct {
		Index               int64   `json:"index"`
		Value               float64 `json:"value"`
		Active              string  `json:"active"`
		Amount              float64 `json:"amount"`
		EnrolledAmount      float64 `json:"enrolled_amount"`
		UserID              int64   `json:"user_id"`
		Currency            string  `json:"currency"`
		ActiveID            int     `json:"active_id"`
		Direction           string  `json:"direction"`
		OpenTime            int64   `json:"open_time"`
		OpenTimeMillisecond int64   `json:"open_time_millisecond"`
		OptionID            int64   `json:"option_id"`
		BalanceID           int64   `json:"balance_id"`
		CountryID           int     `json:"country_id"`
		OptionType          string  `json:"option_type"`
		PlatformID          int     `json:"platform_id"`
		OptionTypeID        int     `json:"option_type_id"`
		ProfitPercent       float64 `json:"profit_percent"`
		BalanceTypeID       int     `json:"balance_type_id"`
		ExpirationTime      int64   `json:"expiration_time"`
		Result              string  `json:"result"`
		ExpirationValue     float64 `json:"expiration_value"`
		WinEnrolledAmount   float64 `json:"win_enrolled_amount"`
	} `json:"msg"`
}

OptionsClosed -

type OptionsOpened

type OptionsOpened struct {
	Name             string `json:"name"`
	MicroserviceName string `json:"microserviceName"`
	Msg              struct {
		Index               int64   `json:"index"`
		Value               float64 `json:"value"`
		Active              string  `json:"active"`
		Amount              float64 `json:"amount"`
		EnrolledAmount      float64 `json:"enrolled_amount"`
		UserID              int64   `json:"user_id"`
		Currency            string  `json:"currency"`
		ActiveID            int     `json:"active_id"`
		Direction           string  `json:"direction"`
		OpenTime            int64   `json:"open_time"`
		OpenTimeMillisecond int64   `json:"open_time_millisecond"`
		OptionID            int64   `json:"option_id"`
		BalanceID           int64   `json:"balance_id"`
		CountryID           int     `json:"country_id"`
		OptionType          string  `json:"option_type"`
		PlatformID          int     `json:"platform_id"`
		OptionTypeID        int     `json:"option_type_id"`
		ProfitPercent       float64 `json:"profit_percent"`
		BalanceTypeID       int     `json:"balance_type_id"`
		ExpirationTime      int64   `json:"expiration_time"`
	} `json:"msg"`
}

OptionsOpened -

type OptionsRejected

type OptionsRejected struct {
	Name             string `json:"name"`
	MicroserviceName string `json:"microserviceName"`
	Msg              struct {
		Index     int64   `json:"index"`
		Value     float64 `json:"value"`
		Amount    float64 `json:"amount"`
		UserID    int64   `json:"user_id"`
		BalanceID int64   `json:"balance_id"`
		OptionID  int64   `json:"option_id"`
		Reason    string  `json:"reason"`
	} `json:"msg"`
}

OptionsRejected -

type PositionChanged

type PositionChanged struct {
	Name             string `json:"name"`
	MicroserviceName string `json:"microserviceName"`
	Msg              struct {
		Version                int64   `json:"version"`
		ID                     string  `json:"id"`
		UserID                 int64   `json:"user_id"`
		UserBalance            int64   `json:"user_balance_id"`
		PlatformID             int     `json:"platform_id"`
		ExternalID             int64   `json:"external_id"`
		ActiveID               int     `json:"active_id"`
		InstrumentID           string  `json:"instrument_id"`
		Source                 string  `json:"source"`
		InstrumentType         string  `json:"instrument_type"`
		Status                 string  `json:"status"`
		OpenTime               int64   `json:"open_time"`
		OpenQuote              float64 `json:"open_quote"`
		Invest                 float64 `json:"invest"`
		InvestEnrolled         float64 `json:"invest_enrolled"`
		SellProfit             float64 `json:"sell_profit"`
		SellProfitEnrolled     float64 `json:"sell_profit_enrolled"`
		ExpectedProfit         float64 `json:"expected_profit"`
		ExpectedProfitEnrolled float64 `json:"expected_profit_enrolled"`
		CloseQuote             float64 `json:"close_quote"`
		CloseTime              int64   `json:"close_time"`
		CloseProfit            float64 `json:"close_profit"`
		CloseProfitEnrolled    float64 `json:"close_profit_enrolled"`
		CloseReason            string  `json:"close_reason"`
		RawEvent               struct {
			ID                   int64   `json:"id"`
			InstrumentExpiration int64   `json:"instrument_expiration"`
			OpenUnderlyingPrice  float64 `json:"open_underlying_price"`
			BuyAmount            float64 `json:"buy_amount"`
			Status               string  `json:"status"`
			UserBalanceType      int     `json:"user_balance_type"`
			UserBalanceID        int64   `json:"user_balance_id"`
			CloseAt              int64   `json:"close_at"`
			OrderIds             []int64 `json:"order_ids"`
		} `json:"raw_event"`
	} `json:"msg"`
}

PositionChanged -

type Profile

type Profile struct {
	Name      string     `json:"name"`
	Msg       ProfileMsg `json:"msg"`
	RequestID string     `json:"request_id"`
}

Profile -

type ProfileMsg

type ProfileMsg struct {
	ID           int64      `json:"id"`
	GroupID      int64      `json:"group_id"`
	Balance      float64    `json:"balance"`
	BalanceID    float64    `json:"balance_id"`
	BalanceType  int        `json:"balance_type"`
	Balances     []Balances `json:"balances"`
	CountryID    int        `json:"country_id"`
	Currency     string     `json:"currency"`
	CurrencyChar string     `json:"currency_char"`
	CurrencyID   int        `json:"currency_id"`
	Email        string     `json:"email"`
	Name         string     `json:"name"`
}

ProfileMsg -

type RobinAsset

type RobinAsset struct {
	ID   int
	Used bool
}

RobinAsset -

type SelectionType

type SelectionType struct {
	AssetID    int
	Method     iqoptiontype.InstrumentType
	Profit     float64
	Expiration int64
	TypeID     iqoptiontype.ProviderInstrumentType
	Spot       rates.Spot
}

SelectionType -

type SendLogin

type SendLogin struct {
	Name      string `json:"name"`
	Msg       string `json:"msg"`
	RequestID string `json:"request_id"`
}

SendLogin -

type SendMessage

type SendMessage struct {
	Name      string      `json:"name"`
	RequestID string      `json:"request_id"`
	Msg       interface{} `json:"msg"`
}

SendMessage -

type SendSubPotitionChange

type SendSubPotitionChange struct {
	Name      string `json:"name"`
	RequestID string `json:"request_id"`
	Msg       struct {
		Name    string `json:"name"`
		Version string `json:"version"`
		Params  struct {
			RoutingFilter struct {
				UserID         int64  `json:"user_id"`
				UserBalanceID  int64  `json:"user_balance_id"`
				InstrumentType string `json:"instrument_type"`
			} `json:"routingFilters"`
		} `json:"params"`
	} `json:"msg"`
}

SendSubPotitionChange -

type Signal

type Signal struct {
	Direction  indicator.Signal
	Result     brokers.DealResult
	Open       time.Time
	Close      time.Time
	OpenValue  float64
	CloseValue float64
}

Signal -

type Stores

type Stores struct {
	Token        string
	Transactions *syncTransactionsMap
	TasksTest    *syncTasksTestsMap
}

Stores -

type SubChannel

type SubChannel struct {
	sync.Mutex
	// contains filtered or unexported fields
}

SubChannel -

func (*SubChannel) Close

func (cc *SubChannel) Close(callback func())

Close -

type TimeSyncMessage

type TimeSyncMessage struct {
	Name string `json:"name"`
	Msg  int64  `json:"msg"`
}

TimeSyncMessage - time sync

Jump to

Keyboard shortcuts

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