fidelity

package
v0.0.0-...-c18efd6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HomePageURL   = `https://fidelity.com/`
	LoginURL      = `https://digital.fidelity.com/prgw/digital/login/full-page`
	LogoutURL     = `` /* 129-byte string literal not displayed */
	SummaryURL    = `https://digital.fidelity.com/ftgw/digital/portfolio/summary`
	ActivityURL   = `https://digital.fidelity.com/ftgw/digital/portfolio/activity`
	GraphQLURL    = `https://digital.fidelity.com/ftgw/digital/portfolio/api/graphql`
	QuoteURL      = `https://digital.fidelity.com/prgw/digital/research/quote/dashboard/summary?symbol=%s`
	MarketDataURL = `https://api.markitdigital.com/xref/v1/symbols/%s`
	CUSIPURL      = `` /* 163-byte string literal not displayed */
)

Variables

View Source
var (
	GQLGetContext = `` /* 7389-byte string literal not displayed */

	GQLGetAcctFeatureContext = `` /* 1341-byte string literal not displayed */

	GQLGetTransactions = `` /* 3310-byte string literal not displayed */

)
View Source
var (
	ErrBadHTTPResponse = errors.New("bad HTTP response")
)
View Source
var (
	ErrInvalidResponseCode = errors.New("invalid status code returned from activity graph QL")
)

Functions

func AccountActivity

func AccountActivity(client *resty.Client, accounts []*Account) (map[string][]*pvlib.Transaction, error)

func FetchMutualFundTickerData

func FetchMutualFundTickerData(asset *common.Asset, page playwright.Page) error

func FetchStockTickerData

func FetchStockTickerData(asset *common.Asset, bearerToken string) error

func Login

func Login(page playwright.Page) error

Login checks if the current session is expired; if it is login

func ParseAccountActivity

func ParseAccountActivity(fidelityActivityJSON string) (trxMap map[string][]*pvlib.Transaction, err error)

ParseAccountActivity reads a json string with account activity downloaded from Fidelity

func RestyFromBrowser

func RestyFromBrowser(context playwright.BrowserContext) (*resty.Client, error)

func StartPlaywright

func StartPlaywright(headless bool) (page playwright.Page, context playwright.BrowserContext, browser playwright.Browser, pw *playwright.Playwright)

StartPlaywright starts the playwright server and browser, it then creates a new context and page with the stealth extensions loaded

func StopPlaywright

func StopPlaywright(context playwright.BrowserContext, browser playwright.Browser, pw *playwright.Playwright)

Types

type Account

type Account struct {
	AccountNumber             string  `json:"acctNum"`
	AccountType               string  `json:"acctType"`
	AccountSubType            string  `json:"acctSubType"`
	AccountSubTypeDescription string  `json:"acctSubTypeDesc"`
	Name                      string  `json:"name"`
	BorrowFullyPaidCode       string  `json:"borrowFullyPaidCode"`
	RegTypeDescription        string  `json:"regTypeDesc"`
	IsMultiCurrencyAllowed    bool    `json:"isMultiCurrencyAllowed"`
	RelationshipRoleTypeCode  string  `json:"relRoleTypeCode"`
	CostBasisCode             *string `json:"costBasisCode"`
	IsTradable                bool    `json:"isTradable"`
	SystemOfRecord            *string `json:"sysOfRcd"`
	BillPayEnrolled           bool    `json:"billPayEnrolled"`
}

func GetAccounts

func GetAccounts(client *resty.Client) ([]*Account, error)

type GraphQLQuery

type GraphQLQuery struct {
	OperationName string         `json:"operationName"`
	Variables     map[string]any `json:"variables"`
	Query         string         `json:"query"`
}

Jump to

Keyboard shortcuts

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