Documentation
¶
Index ¶
- Constants
- type APIClient
- func (api *APIClient) AddWatchList(isin string) (int, error)
- func (api *APIClient) AllTimeline() (int, error)
- func (api *APIClient) CancelOrder(order_id string) (int, error)
- func (api *APIClient) CancelPriceAlarm(price_alarm_id string) (int, error)
- func (api *APIClient) CancelSavingsPlan(savings_plan_id string) (int, error)
- func (api *APIClient) CashAvailableforOrder() (int, error)
- func (api *APIClient) CashAvailableforPayout() (int, error)
- func (api *APIClient) ChangeSavingsPlan(savings_plan_id string, isin string, amount float64, interval string, ...) (int, error)
- func (api *APIClient) CompactPortfolio() (int, error)
- func (api *APIClient) CreatePriceAlarm(isin string, price float64) (int, error)
- func (api *APIClient) CreateSavingsPlan(isin string, amount float64, interval string, start_date string, ...) (int, error)
- func (api *APIClient) Experience() (int, error)
- func (api *APIClient) GetProcessID() string
- func (api *APIClient) InstrumentDetails(isin string) (int, error)
- func (api *APIClient) InstrumentSuitability(isin string) (int, error)
- func (api *APIClient) LimitedOrder(isin string, exchange string, order_type string, size int, limit float64, ...) (int, error)
- func (api *APIClient) Login() error
- func (api *APIClient) MarketOrder(isin string, exchange string, order_type string, size int, expiry string, ...) (int, error)
- func (api *APIClient) MessageOfTheDay() (int, error)
- func (api *APIClient) NeonCards() (int, error)
- func (api *APIClient) NeonSearch(query string, tags []string, page int, pageSize int) (int, error)
- func (api *APIClient) NeonSearchSuggestedTags(query string) (int, error)
- func (api *APIClient) NeonSearchTags() (int, error)
- func (api *APIClient) NewWebSocketConnection(dataChan chan Message) error
- func (api *APIClient) News(isin string) (int, error)
- func (api *APIClient) NewsSubscriptions() (int, error)
- func (api *APIClient) NextSubscriptionId() int
- func (api *APIClient) OrderOverview() (int, error)
- func (api *APIClient) OrderPrice(isin string, exchange string, order_type string) (int, error)
- func (api *APIClient) OrderSize(isin string, exchange string) (int, error)
- func (api *APIClient) Performance(isin string, exchange string) (int, error)
- func (api *APIClient) PerformanceHistory(isin string, timeframe string, exchange string, resolution string) (int, error)
- func (api *APIClient) Portfolio() (int, error)deprecated
- func (api *APIClient) PortfolioHistory(timeframe string) (int, error)
- func (api *APIClient) PortfolioStatus() (int, error)
- func (api *APIClient) PriceAlarmOverview() (int, error)
- func (api *APIClient) RemoveWatchList(isin string) (int, error)
- func (api *APIClient) SavingsPlanOverview() (int, error)
- func (api *APIClient) SavingsPlanParameters(isin string) (int, error)
- func (api *APIClient) SearchDerivative(underlying_isin string, product_type string) (int, error)
- func (api *APIClient) SetBaseURL(url string)
- func (api *APIClient) SetCredentials(number, pin string)
- func (api *APIClient) SetHTTPClient(client *http.Client)
- func (api *APIClient) SetLocal(local string)
- func (api *APIClient) SetTLSConfig(config *tls.Config)
- func (api *APIClient) SetWSBaseURL(url string)
- func (api *APIClient) StockDetails(isin string) (int, error)
- func (api *APIClient) StopMarketOrder(isin string, exchange string, order_type string, size int, limit float64, ...) (int, error)
- func (api *APIClient) Subscribe(payload map[string]interface{}) (int, error)
- func (api *APIClient) SubscribeNews(isin string) (int, error)
- func (api *APIClient) Ticker(isin string, exchange string) (int, error)
- func (api *APIClient) Timeline(after string) (int, error)
- func (api *APIClient) TimelineDetail(timelineId string) (int, error)
- func (api *APIClient) TimelineDetailOrder(order_id int) (int, error)
- func (api *APIClient) TimelineDetailSavingsPlan(savings_plan_id int) (int, error)
- func (api *APIClient) Unsubscribe(subscriptionId int)
- func (api *APIClient) UnsubscribeNews(isin string) (int, error)
- func (api *APIClient) VerifyLogin(verifyCode int) error
- func (api *APIClient) Watchlist() (int, error)
- type Action
- type Doc
- type Downloader
- func (d *Downloader) CreateOutputDir() error
- func (d *Downloader) Download(doc Doc, titleText string, subTitleText string, subFolder string) error
- func (d *Downloader) DownloadAll(ctx context.Context, data chan Message) error
- func (d *Downloader) DownloadDocument(docUrl string, filePath string) error
- func (d *Downloader) DownloadTimeLineDetails(response TimelineDetail, maxAgeTimestamp int64, isSavingsPlan bool) error
- func (d *Downloader) ExportAccountTransactionsCSV() error
- func (d *Downloader) ExportTransactionsJSON() error
- func (d *Downloader) ReadHistoryFile() error
- func (d *Downloader) SetFilenameFmt(fmt string)
- func (d *Downloader) SetHistoryFile(path string)
- func (d *Downloader) SetOutputPath(path string)
- func (d *Downloader) WriteFile(data []TimeLineEvent, filename string) error
- func (d *Downloader) WriteHistoryFile(docUrl string) error
- type LoginCreds
- type Message
- type Portfolio
- type PortfolioLoader
- type Position
- type RawSavingsPlans
- type RawTimeline
- type Response
- type SavingsPlan
- type SavingsPlaner
- func (s *SavingsPlaner) GetAddedAmountForMonth() (float64, error)
- func (s *SavingsPlaner) GetAllSavingPlansIDs() []string
- func (s *SavingsPlaner) GetAmountForMonth(id string) (float64, error)
- func (s *SavingsPlaner) GetSavingsPlan(id string) (SavingsPlan, error)
- func (s *SavingsPlaner) GetSavingsPlanAmount(id string) (float64, error)
- func (s *SavingsPlaner) GetSavingsPlanAsBytes(id string) ([]byte, error)
- func (s *SavingsPlaner) GetSavingsPlans() []SavingsPlan
- func (s *SavingsPlaner) GetSavingsPlansAsBytes() ([]byte, error)
- func (s *SavingsPlaner) LoadSavingsplans(ctx context.Context, data chan Message) error
- type TimeLine
- func (t *TimeLine) FindTimeLineEventsWithDocs(event TimeLineEvent, maxAgeTimestamp int64) bool
- func (t *TimeLine) GetTimeLineDetails() []TimelineDetail
- func (t *TimeLine) GetTimeLineDetailsAsBytes() ([]byte, error)
- func (t *TimeLine) GetTimeLineEvents() []TimeLineEvent
- func (t *TimeLine) GetTimeLineEventsAsBytes() ([]byte, error)
- func (t *TimeLine) GetTimeLineEventsWithDocs() []TimeLineEvent
- func (t *TimeLine) GetTimeLineEventsWithoutDocs() []TimeLineEvent
- func (t *TimeLine) LoadNextTimeline(response map[string]interface{}, maxAgeTimestamp int64) (int, error)
- func (t *TimeLine) LoadTimeLine(ctx context.Context, data chan Message) error
- func (t *TimeLine) LoadTimeLineDetails(ctx context.Context, data chan Message) error
- func (t *TimeLine) RequestTimeLineDetails(numToRequest *int, maxAgeTimestamp int64) (int, error)
- func (t *TimeLine) SetSinceTimestamp(sinceTimestamp int64)
- func (t *TimeLine) SumTotalOfTimeLineEventsWDocsAndWithoutDocs() int
- type TimeLineEvent
- type TimelineDetail
Constants ¶
View Source
const ( TRADEREPUBLICURL = "https://api.traderepublic.com" TRADEREPUBLIWSS = "wss://api.traderepublic.com" )
Look into https://gitlab.com/marzzzello/pytr/-/blob/master/pytr/account.py https://github.com/Zarathustra2/TradeRepublicApi
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct { Creds *LoginCreds ProcessID string Session []*http.Cookie Client *http.Client WebSocket *wsconnector.WSConnector URL string WSURL string TLSConfig *tls.Config // contains filtered or unexported fields }
func NewAPIClient ¶
func NewAPIClient() *APIClient
func (*APIClient) AllTimeline ¶
func (*APIClient) CancelPriceAlarm ¶
func (*APIClient) CancelSavingsPlan ¶
func (*APIClient) CashAvailableforOrder ¶
func (*APIClient) CashAvailableforPayout ¶
func (*APIClient) ChangeSavingsPlan ¶
func (*APIClient) CompactPortfolio ¶
func (*APIClient) CreatePriceAlarm ¶
func (*APIClient) CreateSavingsPlan ¶
func (*APIClient) Experience ¶
func (*APIClient) GetProcessID ¶
func (*APIClient) InstrumentDetails ¶
func (*APIClient) InstrumentSuitability ¶
func (*APIClient) LimitedOrder ¶
func (*APIClient) MarketOrder ¶
func (*APIClient) MessageOfTheDay ¶
func (*APIClient) NeonSearch ¶
func (*APIClient) NeonSearchSuggestedTags ¶
func (*APIClient) NeonSearchTags ¶
func (*APIClient) NewWebSocketConnection ¶
func (*APIClient) NewsSubscriptions ¶
func (*APIClient) NextSubscriptionId ¶
func (*APIClient) OrderOverview ¶
func (*APIClient) OrderPrice ¶
func (*APIClient) Performance ¶
func (*APIClient) PerformanceHistory ¶
func (*APIClient) PortfolioHistory ¶
func (*APIClient) PortfolioStatus ¶
func (*APIClient) PriceAlarmOverview ¶
func (*APIClient) SavingsPlanOverview ¶
func (*APIClient) SavingsPlanParameters ¶
func (*APIClient) SearchDerivative ¶
func (*APIClient) SetBaseURL ¶
func (*APIClient) SetCredentials ¶
func (*APIClient) SetHTTPClient ¶
func (*APIClient) SetTLSConfig ¶
func (*APIClient) SetWSBaseURL ¶
func (*APIClient) StopMarketOrder ¶
func (*APIClient) TimelineDetail ¶
func (*APIClient) TimelineDetailOrder ¶
func (*APIClient) TimelineDetailSavingsPlan ¶
func (*APIClient) Unsubscribe ¶
func (*APIClient) VerifyLogin ¶
type Action ¶
type Action struct { Type string `json:"type,omitempty"` Payload interface{} `json:"payload,omitempty"` }
type Downloader ¶
type Downloader struct { TR *APIClient OutputPath string HistoryFile string FilenameFmt string FilePaths []string DocUrls []string DocUrlsHistory []string TimeLine *TimeLine }
func NewDownloader ¶
func NewDownloader(client *APIClient) *Downloader
func (*Downloader) CreateOutputDir ¶
func (d *Downloader) CreateOutputDir() error
func (*Downloader) DownloadAll ¶
func (d *Downloader) DownloadAll(ctx context.Context, data chan Message) error
func (*Downloader) DownloadDocument ¶
func (d *Downloader) DownloadDocument(docUrl string, filePath string) error
func (*Downloader) DownloadTimeLineDetails ¶
func (d *Downloader) DownloadTimeLineDetails(response TimelineDetail, maxAgeTimestamp int64, isSavingsPlan bool) error
func (*Downloader) ExportAccountTransactionsCSV ¶
func (d *Downloader) ExportAccountTransactionsCSV() error
func (*Downloader) ExportTransactionsJSON ¶
func (d *Downloader) ExportTransactionsJSON() error
func (*Downloader) ReadHistoryFile ¶
func (d *Downloader) ReadHistoryFile() error
func (*Downloader) SetFilenameFmt ¶
func (d *Downloader) SetFilenameFmt(fmt string)
func (*Downloader) SetHistoryFile ¶
func (d *Downloader) SetHistoryFile(path string)
func (*Downloader) SetOutputPath ¶
func (d *Downloader) SetOutputPath(path string)
func (*Downloader) WriteFile ¶
func (d *Downloader) WriteFile(data []TimeLineEvent, filename string) error
func (*Downloader) WriteHistoryFile ¶
func (d *Downloader) WriteHistoryFile(docUrl string) error
type LoginCreds ¶
type Message ¶
type Message struct { SubscriptionId int Subscription map[string]interface{} Payload map[string]interface{} }
Example: "0 C {payload}"
type Portfolio ¶
type Portfolio struct {
Positions []Position `json:"positions"`
}
func (*Portfolio) GetPositions ¶
func (*Portfolio) GetPositionsAsBytes ¶
type PortfolioLoader ¶
func NewPortfolioLoader ¶
func NewPortfolioLoader(client *APIClient) *PortfolioLoader
func (*PortfolioLoader) LoadPortfolio ¶
func (p *PortfolioLoader) LoadPortfolio(ctx context.Context, data chan Message) error
type RawSavingsPlans ¶
type RawSavingsPlans struct { SavingsPlans []struct { ID string `json:"id"` CreatedAt int64 `json:"createdAt"` InstrumentID string `json:"instrumentId"` Amount float64 `json:"amount"` Interval string `json:"interval"` StartDate struct { Type string `json:"type"` Value int `json:"value"` NextExecutionDate string `json:"nextExecutionDate"` } `json:"startDate"` FirstExecutionDate interface{} `json:"firstExecutionDate"` NextExecutionDate string `json:"nextExecutionDate"` PreviousExecutionDate string `json:"previousExecutionDate"` VirtualPreviousExecutionDate string `json:"virtualPreviousExecutionDate"` FinalExecutionDate interface{} `json:"finalExecutionDate"` PaymentMethodID interface{} `json:"paymentMethodId"` PaymentMethodCode interface{} `json:"paymentMethodCode"` LastPaymentExecutionDate interface{} `json:"lastPaymentExecutionDate"` Paused bool `json:"paused"` } `json:"savingsPlans"` }
type RawTimeline ¶
type RawTimeline struct { Data []TimeLineEvent `json:"data"` Cursors struct { Before string `json:"before,omitempty"` After string `json:"after,omitempty"` } `json:"cursors"` }
type Response ¶
type Response struct { Status int `json:"status"` Payload interface{} `json:"payload,omitempty"` }
type SavingsPlan ¶
type SavingsPlan struct { ID string `json:"id"` CreatedAt int64 `json:"createdAt"` InstrumentID string `json:"instrumentId"` Amount float64 `json:"amount"` Interval string `json:"interval"` StartDate struct { Type string `json:"type"` Value int `json:"value"` NextExecutionDate string `json:"nextExecutionDate"` } `json:"startDate"` FirstExecutionDate interface{} `json:"firstExecutionDate"` NextExecutionDate string `json:"nextExecutionDate"` PreviousExecutionDate string `json:"previousExecutionDate"` VirtualPreviousExecutionDate string `json:"virtualPreviousExecutionDate"` FinalExecutionDate interface{} `json:"finalExecutionDate"` PaymentMethodID interface{} `json:"paymentMethodId"` PaymentMethodCode interface{} `json:"paymentMethodCode"` LastPaymentExecutionDate interface{} `json:"lastPaymentExecutionDate"` Paused bool `json:"paused"` }
type SavingsPlaner ¶
type SavingsPlaner struct { Client *APIClient Plans []SavingsPlan }
func NewSavingsPlan ¶
func NewSavingsPlan(client *APIClient) *SavingsPlaner
func (*SavingsPlaner) GetAddedAmountForMonth ¶
func (s *SavingsPlaner) GetAddedAmountForMonth() (float64, error)
func (*SavingsPlaner) GetAllSavingPlansIDs ¶
func (s *SavingsPlaner) GetAllSavingPlansIDs() []string
func (*SavingsPlaner) GetAmountForMonth ¶
func (s *SavingsPlaner) GetAmountForMonth(id string) (float64, error)
func (*SavingsPlaner) GetSavingsPlan ¶
func (s *SavingsPlaner) GetSavingsPlan(id string) (SavingsPlan, error)
func (*SavingsPlaner) GetSavingsPlanAmount ¶
func (s *SavingsPlaner) GetSavingsPlanAmount(id string) (float64, error)
func (*SavingsPlaner) GetSavingsPlanAsBytes ¶
func (s *SavingsPlaner) GetSavingsPlanAsBytes(id string) ([]byte, error)
func (*SavingsPlaner) GetSavingsPlans ¶
func (s *SavingsPlaner) GetSavingsPlans() []SavingsPlan
func (*SavingsPlaner) GetSavingsPlansAsBytes ¶
func (s *SavingsPlaner) GetSavingsPlansAsBytes() ([]byte, error)
func (*SavingsPlaner) LoadSavingsplans ¶
func (s *SavingsPlaner) LoadSavingsplans(ctx context.Context, data chan Message) error
type TimeLine ¶
type TimeLine struct { Client *APIClient ReceivedDetail int RequestedDetail int NumberofTimlineDetails int NumberofTimline int SinceTimestamp int64 TimeLineEvents []TimeLineEvent TimeLineEventsWithDocs []TimeLineEvent TimelineEventsWithoutDocs []TimeLineEvent TimelineDetails []TimelineDetail }
func NewTimeLine ¶
func (*TimeLine) FindTimeLineEventsWithDocs ¶
func (t *TimeLine) FindTimeLineEventsWithDocs(event TimeLineEvent, maxAgeTimestamp int64) bool
func (*TimeLine) GetTimeLineDetails ¶
func (t *TimeLine) GetTimeLineDetails() []TimelineDetail
func (*TimeLine) GetTimeLineDetailsAsBytes ¶
func (*TimeLine) GetTimeLineEvents ¶
func (t *TimeLine) GetTimeLineEvents() []TimeLineEvent
func (*TimeLine) GetTimeLineEventsAsBytes ¶
func (*TimeLine) GetTimeLineEventsWithDocs ¶
func (t *TimeLine) GetTimeLineEventsWithDocs() []TimeLineEvent
func (*TimeLine) GetTimeLineEventsWithoutDocs ¶
func (t *TimeLine) GetTimeLineEventsWithoutDocs() []TimeLineEvent
func (*TimeLine) LoadNextTimeline ¶
func (*TimeLine) LoadTimeLine ¶
func (*TimeLine) LoadTimeLineDetails ¶
func (*TimeLine) RequestTimeLineDetails ¶
func (*TimeLine) SetSinceTimestamp ¶
func (*TimeLine) SumTotalOfTimeLineEventsWDocsAndWithoutDocs ¶
type TimeLineEvent ¶
type TimeLineEvent struct { Type string `json:"type"` Data struct { ID string `json:"id"` Timestamp int64 `json:"timestamp"` Icon string `json:"icon"` Title string `json:"title"` Body string `json:"body"` Action struct { Type string `json:"type,omitempty"` Payload interface{} `json:"payload,omitempty"` } `json:"action,omitempty"` ActionLabel string `json:"actionLabel,omitempty"` Attributes []interface{} `json:"attributes"` Month string `json:"month"` CashChangeAmount float64 `json:"cashChangeAmount,omitempty"` } `json:"data"` }
type TimelineDetail ¶
Click to show internal directories.
Click to hide internal directories.