Chartbreaker
    Preparing search index...

    Type Alias BrokerDependencies

    External dependencies required for broker implementations.

    type BrokerDependencies = {
        AbortController: WhatWgAbortController;
        boerseGoApiClientId: string;
        boerseGoAuth?: BoerseGoAuth;
        boerseGoPortfolioPush?: BoerseGoPortfolioPush;
        boerseGoWebPush: BoerseGoWebPush;
        deviceClass?: DeviceClass;
        enableBrokerizeLongTermTokens?: boolean;
        enableBrokerizeTradeStatistics?: boolean;
        fetch: WhatWgFetch;
        formatAmount: AmountFormatter;
        hideAccountNumbers?: boolean;
        locale: Locale;
        localStorage: KeyValueStore;
        log: Logger;
        metricsRecorder?: MetricsRecorder;
        platform: Platform;
        ReadableStream?: WhatWgReadableStream;
        sessionStorage: KeyValueStore;
        setCookie: (
            opts: { domain?: string; key?: string; value?: string },
        ) => void;
        showTestingEnvironments: boolean;
        stock3ApiUrl?: string;
        TextDecoder?: WhatWgTextDecoder;
        WebSocket: WhatWgWebSocket;
        XMLHttpRequest?: WhatWgXMLHttpRequest;
        onFreestoxxGroupAdded?(): void;
        openUrl?(opts: { url: string }): void;
        subscribeQuotes(
            subscription: string,
            cb: Nodeback<StockQuote>,
        ): ObservableSubscription;
        track?(data: TrackingData): void;
    }
    Index

    Properties

    AbortController: WhatWgAbortController

    An implementation of AbortController. In a modern browser, this can simply be window.AbortController.bind(window). In other environments like node, other implementations can be used. Note that this needs to be compatible with the fetch implementation also provided.

    boerseGoApiClientId: string

    The client id to use for BörseGo API requests (used for the instrument API).

    boerseGoAuth?: BoerseGoAuth

    If authorized requests to the BörseGo API should be made (this is required for PX), a BoerseGoAuth must be provided.

    boerseGoPortfolioPush?: BoerseGoPortfolioPush
    boerseGoWebPush: BoerseGoWebPush

    For BörseGo-specific WebPush events, this has to be implemented. Currently this is used to observe trailing stops in PX portfolios.

    deviceClass?: DeviceClass

    Optionally specify the kind of device this runs on.

    enableBrokerizeLongTermTokens?: boolean

    If true, enables long-term brokerize guest user tokens to be stored in LocalStorage. The brokerize guest user's refresh_token_without_tradingsession will be persisted in LocalStorage. This does not extend trading session lifetime, but only the lifetime of the brokerize guest user account.

    This saves resources in the brokerize backend, as new logins do not need to re-sync the entire account data each day.

    Of course, this only affects brokerize implementations.

    enableBrokerizeTradeStatistics?: boolean

    true to enable the new brokerize trade statistic features. Turning it on means that the order list view "history" becomes available. This is a temporary feature toggle which should be removed once trade stats are available in all frontends.

    An implementation of fetch. In a modern browser, this can simply be window.fetch.bind(window). In other environments like node, other implementations can be used.

    formatAmount: AmountFormatter

    Format an amount as string. This is used where amounts are part of human-readable texts generated by the library. In most cases, the amount object is exposed though.

    the montary amount to format

    hideAccountNumbers?: boolean

    If present and true, account numbers are shortened in order to not expose them in the frontend.

    locale: Locale

    The locale (used for formatting rules and translations).

    localStorage: KeyValueStore

    A (persistent) Key/Value store, e.g. for settings or local caches. The localStorage can be shared across bg-trading brokers.

    log: Logger

    A logger

    metricsRecorder?: MetricsRecorder

    An optional MetricsRecorder for recording some statistics (e.g. request counts etc.)

    platform: Platform

    The platform this runs on.

    ReadableStream?: WhatWgReadableStream

    An implementation of ReadableStream. In a modern browser, this can simply be window.ReadableStream.bind(window). In other environments like node, other implementations can be used. Used by WH Selfinvest quote push.

    sessionStorage: KeyValueStore

    A (volatile) Key/Value store, e.g. for session data. The sessionStorage can be shared across bg-trading brokers.

    setCookie: (opts: { domain?: string; key?: string; value?: string }) => void

    Set a cookie that will be used for fetch calls. In browsers, this can be sth like document.cookie=key+'='+value+';domain='+domain.

    showTestingEnvironments: boolean

    True to include the brokers' testing environments (use this for testing of the implementation).

    stock3ApiUrl?: string

    Used to configure alternative stock3-API urls, e.g. for testing staging envs

    TextDecoder?: WhatWgTextDecoder

    An implementation of TextDecoder. In a modern browser, this can simply be window.TextDecoder.bind(window). In other environments like node, other implementations can be used. Used by WH Selfinvest quote push.

    WebSocket: WhatWgWebSocket

    An implementation of WebSocket. In a modern browser, this can simply be window.WebSocket.bind(window). In other environments like node, other implementations can be used.

    XMLHttpRequest?: WhatWgXMLHttpRequest

    An implementation of XMLHttpRequest. In a modern browser, this can simply be window.XMLHttpRequest.bind(window). In other environments like node, other implementations can be used. Used by WH Selfinvest quote push.

    Methods

    • GRID-34427 GRID-34748 when a onFreestoxxGroupAdded function is provided, it will be called after the user has been added to the freestoxx group.

      Returns void

    • Method to open a url in a new tab or external browser. Used for example to open a broker website

      Parameters

      • opts: { url: string }

      Returns void