Documentation
¶
Overview ¶
Package t212 is a Go client for the Trading 212 public API.
Trading 212's API is currently in beta. See https://docs.trading212.com for the upstream specification.
Construct a Client with NewClient and use its methods to call endpoints. All methods take a context.Context and return either generated model types (see models.gen.go) or sentinel-wrapped errors that can be inspected with errors.Is — see errors.go for the available sentinels.
Package t212 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.0 DO NOT EDIT.
Index ¶
- Constants
- Variables
- type AccountBucketDetailedResponse
- type AccountBucketDetailedResponseDividendCashAction
- type AccountBucketInstrumentResult
- type AccountBucketInstrumentsDetailedResponse
- type AccountBucketResultResponse
- type AccountBucketResultResponseStatus
- type AccountSummary
- type Cash
- type Client
- func (c *Client) AccountSummary(ctx context.Context) (*AccountSummary, error)
- func (c *Client) CancelOrder(ctx context.Context, id int64) error
- func (c *Client) Dividends(ctx context.Context, params *DividendsParams) (*PaginatedResponseHistoryDividendItem, error)
- func (c *Client) Exchanges(ctx context.Context) ([]Exchange, error)
- func (c *Client) HistoricalOrders(ctx context.Context, params *Orders1Params) (*PaginatedResponseHistoricalOrder, error)
- func (c *Client) Instruments(ctx context.Context) ([]TradableInstrument, error)
- func (c *Client) OrderByID(ctx context.Context, id int64) (*Order, error)
- func (c *Client) Orders(ctx context.Context) ([]Order, error)
- func (c *Client) PlaceLimitOrder(ctx context.Context, req *LimitRequest) (*Order, error)
- func (c *Client) PlaceMarketOrder(ctx context.Context, req *MarketRequest) (*Order, error)
- func (c *Client) PlaceStopLimitOrder(ctx context.Context, req *StopLimitRequest) (*Order, error)
- func (c *Client) PlaceStopOrder(ctx context.Context, req *StopRequest) (*Order, error)
- func (c *Client) Positions(ctx context.Context, params *GetPositionsParams) ([]Position, error)
- func (c *Client) Reports(ctx context.Context) ([]ReportResponse, error)
- func (c *Client) RequestReport(ctx context.Context, req *PublicReportRequest) (*EnqueuedReportResponse, error)
- func (c *Client) Transactions(ctx context.Context, params *TransactionsParams) (*PaginatedResponseHistoryTransactionItem, error)
- type ClientOpts
- type CreateJSONRequestBody
- type DividendDetails
- type DividendsParams
- type DuplicateBucketRequest
- type DuplicatePieJSONRequestBody
- type EnqueuedReportResponse
- type Exchange
- type Fill
- type FillTradingMethod
- type FillType
- type FillWalletImpact
- type GetPositionsParams
- type HistoricalOrder
- type HistoryDividendItem
- type HistoryDividendItemType
- type HistoryTransactionItem
- type HistoryTransactionItemType
- type Instrument
- type InstrumentIssue
- type InstrumentIssueName
- type InstrumentIssueSeverity
- type InvestmentResult
- type Investments
- type LimitRequest
- type MarketRequest
- type Order
- type OrderInitiatedFrom
- type OrderSide
- type OrderStatus
- type OrderStrategy
- type OrderType
- type Orders1Params
- type PaginatedResponseHistoricalOrder
- type PaginatedResponseHistoryDividendItem
- type PaginatedResponseHistoryTransactionItem
- type PieRequest
- type PieRequestDividendCashAction
- type PlaceLimitOrderJSONRequestBody
- type PlaceMarketOrderJSONRequestBody
- type PlaceStopOrder1JSONRequestBody
- type PlaceStopOrderJSONRequestBody
- type Position
- type PositionWalletImpact
- type PublicReportRequest
- type ReportDataIncluded
- type ReportResponse
- type ReportResponseStatus
- type RequestReportJSONRequestBody
- type StopLimitRequest
- type StopRequest
- type Tax
- type TaxName
- type TimeEvent
- type TimeEventType
- type TimeValidity
- type TradableInstrument
- type TradableInstrumentType
- type TransactionsParams
- type UpdateJSONRequestBody
- type WorkingSchedule
Constants ¶
const ( AuthWithSecretKeyScopes authWithSecretKeyContextKey = "authWithSecretKey.Scopes" LegacyApiKeyHeaderScopes legacyApiKeyHeaderContextKey = "legacyApiKeyHeader.Scopes" )
const DefaultTimeout = 15 * time.Second
DefaultTimeout is the default HTTP timeout used when a Client is constructed via NewClient.
Variables ¶
var ( // ErrNilOpts is returned when nil is passed where a *ClientOpts is required. ErrNilOpts = errors.New("nil client opts") // ErrInvalidEnv indicates ClientOpts.Env is set to a value other than // "demo" or "live" (case-insensitive). ErrInvalidEnv = errors.New("invalid env") // ErrEmptyAPIKeyID indicates ClientOpts.APIKeyID is empty. ErrEmptyAPIKeyID = errors.New("empty api key id") // ErrEmptyAPISecret indicates ClientOpts.APISecret is empty. ErrEmptyAPISecret = errors.New("empty api secret") // ErrRequest wraps transport-level failures: request construction errors, // network errors, and context cancellation. ErrRequest = errors.New("request failed") // ErrEncode wraps JSON marshaling failures of request bodies. ErrEncode = errors.New("encode failed") // ErrDecode wraps JSON unmarshaling failures of response bodies. ErrDecode = errors.New("decode failed") // ErrBadRequest is returned for HTTP 400 responses. ErrBadRequest = errors.New("bad request") // environment mismatch — keys are demo-only or live-only). ErrUnauthorized = errors.New("unauthorized") // ErrForbidden is returned for HTTP 403 responses (missing scope on the // API key). ErrForbidden = errors.New("forbidden") // ErrNotFound is returned for HTTP 404 responses. ErrNotFound = errors.New("not found") // ErrTimeout is returned for HTTP 408 responses. ErrTimeout = errors.New("timeout") // ErrRateLimited is returned for HTTP 429 responses. Inspect response // headers (x-ratelimit-reset) on the underlying request to back off. ErrRateLimited = errors.New("rate limited") // ErrUnexpectedStatus is returned for any other non-2xx response. ErrUnexpectedStatus = errors.New("unexpected status") )
Sentinel errors returned by the package. Callers should compare with errors.Is to handle specific failure modes.
Functions ¶
This section is empty.
Types ¶
type AccountBucketDetailedResponse ¶
type AccountBucketDetailedResponse struct {
CreationDate *time.Time `json:"creationDate,omitempty"`
DividendCashAction *AccountBucketDetailedResponseDividendCashAction `json:"dividendCashAction,omitempty"`
EndDate *time.Time `json:"endDate,omitempty"`
Goal *float32 `json:"goal,omitempty"`
Icon *string `json:"icon,omitempty"`
Id *int64 `json:"id,omitempty"`
InitialInvestment *float32 `json:"initialInvestment,omitempty"`
Name *string `json:"name,omitempty"`
PublicUrl *string `json:"publicUrl,omitempty"`
}
AccountBucketDetailedResponse defines model for AccountBucketDetailedResponse.
type AccountBucketDetailedResponseDividendCashAction ¶
type AccountBucketDetailedResponseDividendCashAction string
AccountBucketDetailedResponseDividendCashAction defines model for AccountBucketDetailedResponse.DividendCashAction.
const ( AccountBucketDetailedResponseDividendCashActionREINVEST AccountBucketDetailedResponseDividendCashAction = "REINVEST" AccountBucketDetailedResponseDividendCashActionTOACCOUNTCASH AccountBucketDetailedResponseDividendCashAction = "TO_ACCOUNT_CASH" )
Defines values for AccountBucketDetailedResponseDividendCashAction.
func (AccountBucketDetailedResponseDividendCashAction) Valid ¶
func (e AccountBucketDetailedResponseDividendCashAction) Valid() bool
Valid indicates whether the value is a known member of the AccountBucketDetailedResponseDividendCashAction enum.
type AccountBucketInstrumentResult ¶
type AccountBucketInstrumentResult struct {
Issues *[]InstrumentIssue `json:"issues,omitempty"`
OwnedQuantity *float32 `json:"ownedQuantity,omitempty"`
Result *InvestmentResult `json:"result,omitempty"`
Ticker *string `json:"ticker,omitempty"`
}
AccountBucketInstrumentResult defines model for AccountBucketInstrumentResult.
type AccountBucketInstrumentsDetailedResponse ¶
type AccountBucketInstrumentsDetailedResponse struct {
Instruments *[]AccountBucketInstrumentResult `json:"instruments,omitempty"`
Settings *AccountBucketDetailedResponse `json:"settings,omitempty"`
}
AccountBucketInstrumentsDetailedResponse defines model for AccountBucketInstrumentsDetailedResponse.
type AccountBucketResultResponse ¶
type AccountBucketResultResponse struct {
// Cash Amount of money put into the pie in account currency
Cash *float32 `json:"cash,omitempty"`
DividendDetails *DividendDetails `json:"dividendDetails,omitempty"`
Id *int64 `json:"id,omitempty"`
// Progress Progress of the pie based on the set goal
Progress *float32 `json:"progress,omitempty"`
Result *InvestmentResult `json:"result,omitempty"`
// Status Status of the pie based on the set goal
Status *AccountBucketResultResponseStatus `json:"status,omitempty"`
}
AccountBucketResultResponse defines model for AccountBucketResultResponse.
type AccountBucketResultResponseStatus ¶
type AccountBucketResultResponseStatus string
AccountBucketResultResponseStatus Status of the pie based on the set goal
const ( AHEAD AccountBucketResultResponseStatus = "AHEAD" BEHIND AccountBucketResultResponseStatus = "BEHIND" ONTRACK AccountBucketResultResponseStatus = "ON_TRACK" )
Defines values for AccountBucketResultResponseStatus.
func (AccountBucketResultResponseStatus) Valid ¶
func (e AccountBucketResultResponseStatus) Valid() bool
Valid indicates whether the value is a known member of the AccountBucketResultResponseStatus enum.
type AccountSummary ¶
type AccountSummary struct {
Cash *Cash `json:"cash,omitempty"`
// Currency Primary account currency in ISO 4217 format.
Currency *string `json:"currency,omitempty"`
// Id Primary trading account number. This is the same account ID you would see in the Trading 212 web or mobile application.
Id *int64 `json:"id,omitempty"`
Investments *Investments `json:"investments,omitempty"`
// TotalValue Investments value in your account's primary currency.
TotalValue *float32 `json:"totalValue,omitempty"`
}
AccountSummary defines model for AccountSummary.
type Cash ¶
type Cash struct {
// AvailableToTrade Funds available for investing.
AvailableToTrade *float32 `json:"availableToTrade,omitempty"`
// InPies It’s the sum of the cash inside of all pies that is not yet invested.
InPies *float32 `json:"inPies,omitempty"`
// ReservedForOrders The amount of cash reserved for pending orders. This cash is not available for placing new trades.
ReservedForOrders *float32 `json:"reservedForOrders,omitempty"`
}
Cash defines model for Cash.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Trading 212 API client. It is safe for concurrent use.
func NewClient ¶
func NewClient(opts *ClientOpts) (*Client, error)
NewClient validates opts and returns a configured Client. The returned Client uses HTTP Basic auth derived from APIKeyID and APISecret and an HTTP timeout of DefaultTimeout.
func (*Client) AccountSummary ¶
func (c *Client) AccountSummary(ctx context.Context) (*AccountSummary, error)
AccountSummary fetches the equity account summary: account ID, primary currency, total value, and the cash and investments breakdown.
GET /api/v0/equity/account/summary (rate limit: 1 req / 5s).
func (*Client) CancelOrder ¶
CancelOrder requests cancellation of an active order. Cancellation is not guaranteed if the order is already in the process of being filled.
DELETE /api/v0/equity/orders/{id} (rate limit: 50 req / 1m).
func (*Client) Dividends ¶
func (c *Client) Dividends(ctx context.Context, params *DividendsParams) (*PaginatedResponseHistoryDividendItem, error)
Dividends fetches a page of dividend history.
GET /api/v0/equity/history/dividends (rate limit: 50 req / 1m).
func (*Client) Exchanges ¶
Exchanges fetches exchange metadata, including each exchange's working schedule (market open/close events).
GET /api/v0/equity/metadata/exchanges (rate limit: 1 req / 30s).
func (*Client) HistoricalOrders ¶
func (c *Client) HistoricalOrders(ctx context.Context, params *Orders1Params) (*PaginatedResponseHistoricalOrder, error)
HistoricalOrders fetches a page of historical orders. Use params for cursor-based pagination, ticker filtering, and per-page limit.
GET /api/v0/equity/history/orders (rate limit: 50 req / 1m).
func (*Client) Instruments ¶
func (c *Client) Instruments(ctx context.Context) ([]TradableInstrument, error)
Instruments fetches all instruments tradable on the account. The list is large (~5MB) and refreshed every 10 minutes server-side; consider caching.
GET /api/v0/equity/metadata/instruments (rate limit: 1 req / 50s).
func (*Client) OrderByID ¶
OrderByID fetches a single pending order by its numeric ID.
GET /api/v0/equity/orders/{id} (rate limit: 1 req / 1s).
func (*Client) Orders ¶
Orders fetches all currently active (pending) orders.
GET /api/v0/equity/orders (rate limit: 1 req / 5s).
func (*Client) PlaceLimitOrder ¶
PlaceLimitOrder places a limit order.
POST /api/v0/equity/orders/limit (rate limit: 1 req / 2s).
func (*Client) PlaceMarketOrder ¶
PlaceMarketOrder places a market order. A positive Quantity buys; a negative Quantity sells.
Note: the Trading 212 API is not idempotent — sending the same request twice may create duplicate orders.
POST /api/v0/equity/orders/market (rate limit: 50 req / 1m).
func (*Client) PlaceStopLimitOrder ¶
PlaceStopLimitOrder places a stop-limit order, which becomes a limit order once StopPrice is reached.
POST /api/v0/equity/orders/stop_limit (rate limit: 1 req / 2s).
func (*Client) PlaceStopOrder ¶
PlaceStopOrder places a stop order, which becomes a market order once StopPrice is reached.
POST /api/v0/equity/orders/stop (rate limit: 1 req / 2s).
func (*Client) Positions ¶
Positions fetches all open positions, optionally filtered by ticker via params.Ticker. Pass nil for params to fetch all positions.
GET /api/v0/equity/positions (rate limit: 1 req / 1s).
func (*Client) Reports ¶
func (c *Client) Reports(ctx context.Context) ([]ReportResponse, error)
Reports lists all requested CSV reports and their current status. When a report's status is "Finished", its DownloadLink is populated.
GET /api/v0/equity/history/exports (rate limit: 1 req / 1m).
func (*Client) RequestReport ¶
func (c *Client) RequestReport(ctx context.Context, req *PublicReportRequest) (*EnqueuedReportResponse, error)
RequestReport asynchronously kicks off generation of a CSV report covering the requested data range. Use Reports to poll for completion and obtain the download link.
POST /api/v0/equity/history/exports (rate limit: 1 req / 30s).
func (*Client) Transactions ¶
func (c *Client) Transactions(ctx context.Context, params *TransactionsParams) (*PaginatedResponseHistoryTransactionItem, error)
Transactions fetches a page of cash transactions (deposits, withdrawals, fees, internal transfers).
GET /api/v0/equity/history/transactions (rate limit: 50 req / 1m).
type ClientOpts ¶
type ClientOpts struct {
// Env selects the Trading 212 environment. Accepts "demo" (default) or
// "live" (case-insensitive). Empty defaults to demo.
Env string
// APIKeyID is the API key identifier issued by Trading 212. API keys
// generated in a demo account only work against the demo environment, and
// vice versa.
APIKeyID string
// APISecret is the API secret paired with APIKeyID.
APISecret string
}
ClientOpts configures a Client.
func (*ClientOpts) Validate ¶
func (opts *ClientOpts) Validate() error
Validate reports whether opts is usable. It returns one of ErrNilOpts, ErrInvalidEnv, ErrEmptyAPIKeyID, or ErrEmptyAPISecret on failure.
type CreateJSONRequestBody ¶
type CreateJSONRequestBody = PieRequest
CreateJSONRequestBody defines body for Create for application/json ContentType.
type DividendDetails ¶
type DividendDetails struct {
Gained *float32 `json:"gained,omitempty"`
InCash *float32 `json:"inCash,omitempty"`
Reinvested *float32 `json:"reinvested,omitempty"`
}
DividendDetails defines model for DividendDetails.
type DividendsParams ¶
type DividendsParams struct {
// Cursor Pagination cursor
Cursor *int64 `form:"cursor,omitempty" json:"cursor,omitempty"`
// Ticker Ticker filter
Ticker *string `form:"ticker,omitempty" json:"ticker,omitempty"`
// Limit Max items: 50
Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"`
}
DividendsParams defines parameters for Dividends.
type DuplicateBucketRequest ¶
type DuplicateBucketRequest struct {
Icon *string `json:"icon,omitempty"`
Name *string `json:"name,omitempty"`
}
DuplicateBucketRequest defines model for DuplicateBucketRequest.
type DuplicatePieJSONRequestBody ¶
type DuplicatePieJSONRequestBody = DuplicateBucketRequest
DuplicatePieJSONRequestBody defines body for DuplicatePie for application/json ContentType.
type EnqueuedReportResponse ¶
type EnqueuedReportResponse struct {
ReportId *int64 `json:"reportId,omitempty"`
}
EnqueuedReportResponse defines model for EnqueuedReportResponse.
type Exchange ¶
type Exchange struct {
Id *int64 `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
WorkingSchedules *[]WorkingSchedule `json:"workingSchedules,omitempty"`
}
Exchange defines model for Exchange.
type Fill ¶
type Fill struct {
FilledAt *time.Time `json:"filledAt,omitempty"`
Id *int64 `json:"id,omitempty"`
Price *float32 `json:"price,omitempty"`
Quantity *float32 `json:"quantity,omitempty"`
TradingMethod *FillTradingMethod `json:"tradingMethod,omitempty"`
Type *FillType `json:"type,omitempty"`
WalletImpact *FillWalletImpact `json:"walletImpact,omitempty"`
}
Fill defines model for Fill.
type FillTradingMethod ¶
type FillTradingMethod string
FillTradingMethod defines model for Fill.TradingMethod.
const ( OTC FillTradingMethod = "OTC" TOTV FillTradingMethod = "TOTV" )
Defines values for FillTradingMethod.
func (FillTradingMethod) Valid ¶
func (e FillTradingMethod) Valid() bool
Valid indicates whether the value is a known member of the FillTradingMethod enum.
type FillType ¶
type FillType string
FillType defines model for Fill.Type.
const ( CASHANDSTOCKACQUISITION FillType = "CASH_AND_STOCK_ACQUISITION" CUSTOMSTOCKDISTRIBUTION FillType = "CUSTOM_STOCK_DISTRIBUTION" EQUITYRIGHTS FillType = "EQUITY_RIGHTS" FOP FillType = "FOP" FOPCORRECTION FillType = "FOP_CORRECTION" SCRIPSTOCKDIVIDENDS FillType = "SCRIP_STOCK_DIVIDENDS" SPINOFF FillType = "SPIN_OFF" STOCKACQUISITION FillType = "STOCK_ACQUISITION" STOCKDISTRIBUTION FillType = "STOCK_DISTRIBUTION" STOCKDIVIDENDS FillType = "STOCK_DIVIDENDS" STOCKSPLIT FillType = "STOCK_SPLIT" TRADE FillType = "TRADE" )
Defines values for FillType.
type FillWalletImpact ¶
type FillWalletImpact struct {
Currency *string `json:"currency,omitempty"`
FxRate *float32 `json:"fxRate,omitempty"`
NetValue *float32 `json:"netValue,omitempty"`
RealisedProfitLoss *float32 `json:"realisedProfitLoss,omitempty"`
Taxes *[]Tax `json:"taxes,omitempty"`
}
FillWalletImpact defines model for FillWalletImpact.
type GetPositionsParams ¶
type GetPositionsParams struct {
Ticker *string `form:"ticker,omitempty" json:"ticker,omitempty"`
}
GetPositionsParams defines parameters for GetPositions.
type HistoricalOrder ¶
type HistoricalOrder struct {
Fill *Fill `json:"fill,omitempty"`
Order *Order `json:"order,omitempty"`
}
HistoricalOrder defines model for HistoricalOrder.
type HistoryDividendItem ¶
type HistoryDividendItem struct {
// Amount In account's primary currency.
Amount *float32 `json:"amount,omitempty"`
AmountInEuro *float32 `json:"amountInEuro,omitempty"`
// Currency The account's primary currency.
Currency *string `json:"currency,omitempty"`
GrossAmountPerShare *float32 `json:"grossAmountPerShare,omitempty"`
// Instrument Instrument information as given by /instruments endpoint.
Instrument *Instrument `json:"instrument,omitempty"`
PaidOn *time.Time `json:"paidOn,omitempty"`
Quantity *float32 `json:"quantity,omitempty"`
Reference *string `json:"reference,omitempty"`
Ticker *string `json:"ticker,omitempty"`
TickerCurrency *string `json:"tickerCurrency,omitempty"`
Type *HistoryDividendItemType `json:"type,omitempty"`
}
HistoryDividendItem defines model for HistoryDividendItem.
type HistoryDividendItemType ¶
type HistoryDividendItemType string
HistoryDividendItemType defines model for HistoryDividendItem.Type.
const ( BONUS HistoryDividendItemType = "BONUS" BONUSMANUFACTUREDPAYMENT HistoryDividendItemType = "BONUS_MANUFACTURED_PAYMENT" CAPITALGAINS HistoryDividendItemType = "CAPITAL_GAINS" CAPITALGAINSDISTRIBUTION HistoryDividendItemType = "CAPITAL_GAINS_DISTRIBUTION" CAPITALGAINSDISTRIBUTIONMANUFACTUREDPAYMENT HistoryDividendItemType = "CAPITAL_GAINS_DISTRIBUTION_MANUFACTURED_PAYMENT" CAPITALGAINSDISTRIBUTIONNONUS HistoryDividendItemType = "CAPITAL_GAINS_DISTRIBUTION_NON_US" CAPITALGAINSDISTRIBUTIONNONUSMANUFACTUREDPAYMENT HistoryDividendItemType = "CAPITAL_GAINS_DISTRIBUTION_NON_US_MANUFACTURED_PAYMENT" CAPITALGAINSMANUFACTUREDPAYMENT HistoryDividendItemType = "CAPITAL_GAINS_MANUFACTURED_PAYMENT" DEMERGER HistoryDividendItemType = "DEMERGER" DEMERGERMANUFACTUREDPAYMENT HistoryDividendItemType = "DEMERGER_MANUFACTURED_PAYMENT" DIVIDEND HistoryDividendItemType = "DIVIDEND" DIVIDENDMANUFACTUREDPAYMENT HistoryDividendItemType = "DIVIDEND_MANUFACTURED_PAYMENT" DIVIDENDSPAIDBYFOREIGNCORPORATIONS HistoryDividendItemType = "DIVIDENDS_PAID_BY_FOREIGN_CORPORATIONS" DIVIDENDSPAIDBYFOREIGNCORPORATIONSMANUFACTUREDPAYMENT HistoryDividendItemType = "DIVIDENDS_PAID_BY_FOREIGN_CORPORATIONS_MANUFACTURED_PAYMENT" DIVIDENDSPAIDBYUSCORPORATIONS HistoryDividendItemType = "DIVIDENDS_PAID_BY_US_CORPORATIONS" DIVIDENDSPAIDBYUSCORPORATIONSMANUFACTUREDPAYMENT HistoryDividendItemType = "DIVIDENDS_PAID_BY_US_CORPORATIONS_MANUFACTURED_PAYMENT" INTEREST HistoryDividendItemType = "INTEREST" INTERESTMANUFACTUREDPAYMENT HistoryDividendItemType = "INTEREST_MANUFACTURED_PAYMENT" INTERESTPAIDBYFOREIGNCORPORATIONS HistoryDividendItemType = "INTEREST_PAID_BY_FOREIGN_CORPORATIONS" INTERESTPAIDBYFOREIGNCORPORATIONSMANUFACTUREDPAYMENT HistoryDividendItemType = "INTEREST_PAID_BY_FOREIGN_CORPORATIONS_MANUFACTURED_PAYMENT" INTERESTPAIDBYUSOBLIGORS HistoryDividendItemType = "INTEREST_PAID_BY_US_OBLIGORS" INTERESTPAIDBYUSOBLIGORSMANUFACTUREDPAYMENT HistoryDividendItemType = "INTEREST_PAID_BY_US_OBLIGORS_MANUFACTURED_PAYMENT" INTERIMLIQUIDATION HistoryDividendItemType = "INTERIM_LIQUIDATION" INTERIMLIQUIDATIONMANUFACTUREDPAYMENT HistoryDividendItemType = "INTERIM_LIQUIDATION_MANUFACTURED_PAYMENT" LONGTERMCAPITALGAINS HistoryDividendItemType = "LONG_TERM_CAPITAL_GAINS" LONGTERMCAPITALGAINSMANUFACTUREDPAYMENT HistoryDividendItemType = "LONG_TERM_CAPITAL_GAINS_MANUFACTURED_PAYMENT" MULTIPLE1042STAXCOMPONENTS HistoryDividendItemType = "MULTIPLE_1042S_TAX_COMPONENTS" MULTIPLE1042STAXCOMPONENTSMANUFACTUREDPAYMENT HistoryDividendItemType = "MULTIPLE_1042S_TAX_COMPONENTS_MANUFACTURED_PAYMENT" ORDINARY HistoryDividendItemType = "ORDINARY" ORDINARYMANUFACTUREDPAYMENT HistoryDividendItemType = "ORDINARY_MANUFACTURED_PAYMENT" OTHERDIVIDENDEQUIVALENT HistoryDividendItemType = "OTHER_DIVIDEND_EQUIVALENT" OTHERDIVIDENDEQUIVALENTMANUFACTUREDPAYMENT HistoryDividendItemType = "OTHER_DIVIDEND_EQUIVALENT_MANUFACTURED_PAYMENT" OTHERINCOME HistoryDividendItemType = "OTHER_INCOME" OTHERINCOMEMANUFACTUREDPAYMENT HistoryDividendItemType = "OTHER_INCOME_MANUFACTURED_PAYMENT" PROPERTYINCOME HistoryDividendItemType = "PROPERTY_INCOME" PROPERTYINCOMEDISTRIBUTION HistoryDividendItemType = "PROPERTY_INCOME_DISTRIBUTION" PROPERTYINCOMEDISTRIBUTIONMANUFACTUREDPAYMENT HistoryDividendItemType = "PROPERTY_INCOME_DISTRIBUTION_MANUFACTURED_PAYMENT" PROPERTYINCOMEMANUFACTUREDPAYMENT HistoryDividendItemType = "PROPERTY_INCOME_MANUFACTURED_PAYMENT" PTPUNCHARACTERISEDINCOME HistoryDividendItemType = "PTP_UNCHARACTERISED_INCOME" PTPUNCHARACTERISEDINCOMEMANUFACTUREDPAYMENT HistoryDividendItemType = "PTP_UNCHARACTERISED_INCOME_MANUFACTURED_PAYMENT" PUBLICLYTRADEDPARTNERSHIPDISTRIBUTION HistoryDividendItemType = "PUBLICLY_TRADED_PARTNERSHIP_DISTRIBUTION" PUBLICLYTRADEDPARTNERSHIPDISTRIBUTIONMANUFACTUREDPAYMENT HistoryDividendItemType = "PUBLICLY_TRADED_PARTNERSHIP_DISTRIBUTION_MANUFACTURED_PAYMENT" QUALIFIEDINVESTMENTENTITY HistoryDividendItemType = "QUALIFIED_INVESTMENT_ENTITY" QUALIFIEDINVESTMENTENTITYMANUFACTUREDPAYMENT HistoryDividendItemType = "QUALIFIED_INVESTMENT_ENTITY_MANUFACTURED_PAYMENT" REALPROPERTYINCOMEANDNATURALRESOURCESROYALTIES HistoryDividendItemType = "REAL_PROPERTY_INCOME_AND_NATURAL_RESOURCES_ROYALTIES" REALPROPERTYINCOMEANDNATURALRESOURCESROYALTIESMANUFACTUREDPAYMENT HistoryDividendItemType = "REAL_PROPERTY_INCOME_AND_NATURAL_RESOURCES_ROYALTIES_MANUFACTURED_PAYMENT" RETURNOFCAPITAL HistoryDividendItemType = "RETURN_OF_CAPITAL" RETURNOFCAPITALMANUFACTUREDPAYMENT HistoryDividendItemType = "RETURN_OF_CAPITAL_MANUFACTURED_PAYMENT" RETURNOFCAPITALNONUS HistoryDividendItemType = "RETURN_OF_CAPITAL_NON_US" RETURNOFCAPITALNONUSMANUFACTUREDPAYMENT HistoryDividendItemType = "RETURN_OF_CAPITAL_NON_US_MANUFACTURED_PAYMENT" SHORTTERMCAPITALGAINS HistoryDividendItemType = "SHORT_TERM_CAPITAL_GAINS" SHORTTERMCAPITALGAINSMANUFACTUREDPAYMENT HistoryDividendItemType = "SHORT_TERM_CAPITAL_GAINS_MANUFACTURED_PAYMENT" TAXEVENT1446FFORPUBLICLYTRADEDSECURITIES HistoryDividendItemType = "TAX_EVENT_1446F_FOR_PUBLICLY_TRADED_SECURITIES" TAXEVENT1446FFORPUBLICLYTRADEDSECURITIESMANUFACTUREDPAYMENT HistoryDividendItemType = "TAX_EVENT_1446F_FOR_PUBLICLY_TRADED_SECURITIES_MANUFACTURED_PAYMENT" TAXEXEMPTED HistoryDividendItemType = "TAX_EXEMPTED" TAXEXEMPTEDMANUFACTUREDPAYMENT HistoryDividendItemType = "TAX_EXEMPTED_MANUFACTURED_PAYMENT" TRUSTDISTRIBUTION HistoryDividendItemType = "TRUST_DISTRIBUTION" TRUSTDISTRIBUTIONMANUFACTUREDPAYMENT HistoryDividendItemType = "TRUST_DISTRIBUTION_MANUFACTURED_PAYMENT" )
Defines values for HistoryDividendItemType.
func (HistoryDividendItemType) Valid ¶
func (e HistoryDividendItemType) Valid() bool
Valid indicates whether the value is a known member of the HistoryDividendItemType enum.
type HistoryTransactionItem ¶
type HistoryTransactionItem struct {
// Amount Amount in the currency of the transaction
Amount *float32 `json:"amount,omitempty"`
// Currency Currency of the transaction
Currency *string `json:"currency,omitempty"`
DateTime *time.Time `json:"dateTime,omitempty"`
// Reference ID
Reference *string `json:"reference,omitempty"`
Type *HistoryTransactionItemType `json:"type,omitempty"`
}
HistoryTransactionItem defines model for HistoryTransactionItem.
type HistoryTransactionItemType ¶
type HistoryTransactionItemType string
HistoryTransactionItemType defines model for HistoryTransactionItem.Type.
const ( DEPOSIT HistoryTransactionItemType = "DEPOSIT" FEE HistoryTransactionItemType = "FEE" TRANSFER HistoryTransactionItemType = "TRANSFER" WITHDRAW HistoryTransactionItemType = "WITHDRAW" )
Defines values for HistoryTransactionItemType.
func (HistoryTransactionItemType) Valid ¶
func (e HistoryTransactionItemType) Valid() bool
Valid indicates whether the value is a known member of the HistoryTransactionItemType enum.
type Instrument ¶
type Instrument struct {
// Currency Instrument currency in ISO 4217 format.
Currency *string `json:"currency,omitempty"`
// Isin ISIN of the instrument.
Isin *string `json:"isin,omitempty"`
// Name Name of the instrument.
Name *string `json:"name,omitempty"`
// Ticker Unique instrument identifier.
Ticker *string `json:"ticker,omitempty"`
}
Instrument Instrument information as given by /instruments endpoint.
type InstrumentIssue ¶
type InstrumentIssue struct {
Name *InstrumentIssueName `json:"name,omitempty"`
Severity *InstrumentIssueSeverity `json:"severity,omitempty"`
}
InstrumentIssue defines model for InstrumentIssue.
type InstrumentIssueName ¶
type InstrumentIssueName string
InstrumentIssueName defines model for InstrumentIssue.Name.
const ( APPROACHINGMAXPOSITIONSIZE InstrumentIssueName = "APPROACHING_MAX_POSITION_SIZE" COMPLEXINSTRUMENTAPPTESTREQUIRED InstrumentIssueName = "COMPLEX_INSTRUMENT_APP_TEST_REQUIRED" DELISTED InstrumentIssueName = "DELISTED" MAXPOSITIONSIZEREACHED InstrumentIssueName = "MAX_POSITION_SIZE_REACHED" NOLONGERTRADABLE InstrumentIssueName = "NO_LONGER_TRADABLE" PRICETOOLOW InstrumentIssueName = "PRICE_TOO_LOW" SUSPENDED InstrumentIssueName = "SUSPENDED" )
Defines values for InstrumentIssueName.
func (InstrumentIssueName) Valid ¶
func (e InstrumentIssueName) Valid() bool
Valid indicates whether the value is a known member of the InstrumentIssueName enum.
type InstrumentIssueSeverity ¶
type InstrumentIssueSeverity string
InstrumentIssueSeverity defines model for InstrumentIssue.Severity.
const ( INFORMATIVE InstrumentIssueSeverity = "INFORMATIVE" IRREVERSIBLE InstrumentIssueSeverity = "IRREVERSIBLE" REVERSIBLE InstrumentIssueSeverity = "REVERSIBLE" )
Defines values for InstrumentIssueSeverity.
func (InstrumentIssueSeverity) Valid ¶
func (e InstrumentIssueSeverity) Valid() bool
Valid indicates whether the value is a known member of the InstrumentIssueSeverity enum.
type InvestmentResult ¶
type InvestmentResult struct {
PriceAvgInvestedValue *float32 `json:"priceAvgInvestedValue,omitempty"`
PriceAvgResult *float32 `json:"priceAvgResult,omitempty"`
PriceAvgResultCoef *float32 `json:"priceAvgResultCoef,omitempty"`
PriceAvgValue *float32 `json:"priceAvgValue,omitempty"`
}
InvestmentResult defines model for InvestmentResult.
type Investments ¶
type Investments struct {
// CurrentValue Current value of all the investments.
CurrentValue *float32 `json:"currentValue,omitempty"`
// RealizedProfitLoss The all-time realised profit loss from all of the trades executed.
RealizedProfitLoss *float32 `json:"realizedProfitLoss,omitempty"`
// TotalCost The cost basis of your current investments. The total amount of funds you've invested in the shares you currently own.
TotalCost *float32 `json:"totalCost,omitempty"`
// UnrealizedProfitLoss The potential profit/loss of your current investments, showing how much you could gain or lose if you were to sell them now.
UnrealizedProfitLoss *float32 `json:"unrealizedProfitLoss,omitempty"`
}
Investments defines model for Investments.
type LimitRequest ¶
type LimitRequest struct {
LimitPrice *float32 `json:"limitPrice,omitempty"`
Quantity *float32 `json:"quantity,omitempty"`
Ticker *string `json:"ticker,omitempty"`
// TimeValidity Specifies how long the order remains active:
// * DAY: The order will automatically expire if not executed by midnight in the time zone of the instrument's exchange.
// * GOOD_TILL_CANCEL: The order remains active indefinitely until it is either filled or explicitly cancelled by you.
TimeValidity *TimeValidity `json:"timeValidity,omitempty"`
}
LimitRequest defines model for LimitRequest.
type MarketRequest ¶
type MarketRequest struct {
ExtendedHours *bool `json:"extendedHours,omitempty"`
Quantity *float32 `json:"quantity,omitempty"`
Ticker *string `json:"ticker,omitempty"`
}
MarketRequest defines model for MarketRequest.
type Order ¶
type Order struct {
// CreatedAt The ISO 8601 formatted date of when the order was created.
CreatedAt *time.Time `json:"createdAt,omitempty"`
// Currency The currency used for the order in ISO 4217 format.
Currency *string `json:"currency,omitempty"`
// ExtendedHours If true, the order is eligible for execution outside regular trading hours.
ExtendedHours *bool `json:"extendedHours,omitempty"`
// FilledQuantity The number of shares that have been successfully executed. Applicable to quantity orders.
FilledQuantity *float32 `json:"filledQuantity,omitempty"`
// FilledValue The total monetary value of the executed portion of the order. Applicable to orders placed by value.Note: Placing orders by value is not currently supported via the API but can be done through other Trading 212 platforms.
FilledValue *float32 `json:"filledValue,omitempty"`
// Id A unique, system-generated identifier for the order.
Id *int64 `json:"id,omitempty"`
// InitiatedFrom How the order was initiated.
InitiatedFrom *OrderInitiatedFrom `json:"initiatedFrom,omitempty"`
// Instrument Instrument information as given by /instruments endpoint.
Instrument *Instrument `json:"instrument,omitempty"`
// LimitPrice Applicable to LIMIT and STOP_LIMIT orders.
LimitPrice *float32 `json:"limitPrice,omitempty"`
// Quantity The total number of shares requested. Applicable to quantity orders.
Quantity *float32 `json:"quantity,omitempty"`
// Side Indicates whether the order is BUY or SELL.
Side *OrderSide `json:"side,omitempty"`
// Status The current state of the order in its lifecycle.
Status *OrderStatus `json:"status,omitempty"`
// StopPrice Applicable to STOP and STOP_LIMIT orders.
StopPrice *float32 `json:"stopPrice,omitempty"`
// Strategy The strategy used to place the order, either by QUANTITY or VALUE. The API currently only supports placing orders by QUANTITY.
Strategy *OrderStrategy `json:"strategy,omitempty"`
// Ticker Unique instrument identifier. Get from the /instruments endpoint
Ticker *string `json:"ticker,omitempty"`
// TimeInForce Specifies how long the order remains active:
// * DAY: The order will automatically expire if not executed by midnight in the time zone of the instrument's exchange.
// * GOOD_TILL_CANCEL: The order remains active indefinitely until it is either filled or explicitly cancelled by you.
TimeInForce *TimeValidity `json:"timeInForce,omitempty"`
Type *OrderType `json:"type,omitempty"`
// Value The total monetary value of the order. Applicable to value orders.
Value *float32 `json:"value,omitempty"`
}
Order defines model for Order.
type OrderInitiatedFrom ¶
type OrderInitiatedFrom string
OrderInitiatedFrom How the order was initiated.
const ( ANDROID OrderInitiatedFrom = "ANDROID" API OrderInitiatedFrom = "API" AUTOINVEST OrderInitiatedFrom = "AUTOINVEST" IOS OrderInitiatedFrom = "IOS" SYSTEM OrderInitiatedFrom = "SYSTEM" WEB OrderInitiatedFrom = "WEB" )
Defines values for OrderInitiatedFrom.
func (OrderInitiatedFrom) Valid ¶
func (e OrderInitiatedFrom) Valid() bool
Valid indicates whether the value is a known member of the OrderInitiatedFrom enum.
type OrderStatus ¶
type OrderStatus string
OrderStatus The current state of the order in its lifecycle.
const ( CANCELLED OrderStatus = "CANCELLED" CANCELLING OrderStatus = "CANCELLING" CONFIRMED OrderStatus = "CONFIRMED" FILLED OrderStatus = "FILLED" LOCAL OrderStatus = "LOCAL" NEW OrderStatus = "NEW" PARTIALLYFILLED OrderStatus = "PARTIALLY_FILLED" REJECTED OrderStatus = "REJECTED" REPLACED OrderStatus = "REPLACED" REPLACING OrderStatus = "REPLACING" UNCONFIRMED OrderStatus = "UNCONFIRMED" )
Defines values for OrderStatus.
func (OrderStatus) Valid ¶
func (e OrderStatus) Valid() bool
Valid indicates whether the value is a known member of the OrderStatus enum.
type OrderStrategy ¶
type OrderStrategy string
OrderStrategy The strategy used to place the order, either by QUANTITY or VALUE. The API currently only supports placing orders by QUANTITY.
const ( QUANTITY OrderStrategy = "QUANTITY" VALUE OrderStrategy = "VALUE" )
Defines values for OrderStrategy.
func (OrderStrategy) Valid ¶
func (e OrderStrategy) Valid() bool
Valid indicates whether the value is a known member of the OrderStrategy enum.
type OrderType ¶
type OrderType string
OrderType defines model for Order.Type.
type Orders1Params ¶
type Orders1Params struct {
// Cursor Pagination cursor
Cursor *int64 `form:"cursor,omitempty" json:"cursor,omitempty"`
// Ticker Ticker filter
Ticker *string `form:"ticker,omitempty" json:"ticker,omitempty"`
// Limit Max items: 50
Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"`
}
Orders1Params defines parameters for Orders1.
type PaginatedResponseHistoricalOrder ¶
type PaginatedResponseHistoricalOrder struct {
Items *[]HistoricalOrder `json:"items,omitempty"`
NextPagePath *string `json:"nextPagePath,omitempty"`
}
PaginatedResponseHistoricalOrder defines model for PaginatedResponseHistoricalOrder.
type PaginatedResponseHistoryDividendItem ¶
type PaginatedResponseHistoryDividendItem struct {
Items *[]HistoryDividendItem `json:"items,omitempty"`
NextPagePath *string `json:"nextPagePath,omitempty"`
}
PaginatedResponseHistoryDividendItem defines model for PaginatedResponseHistoryDividendItem.
type PaginatedResponseHistoryTransactionItem ¶
type PaginatedResponseHistoryTransactionItem struct {
Items *[]HistoryTransactionItem `json:"items,omitempty"`
NextPagePath *string `json:"nextPagePath,omitempty"`
}
PaginatedResponseHistoryTransactionItem defines model for PaginatedResponseHistoryTransactionItem.
type PieRequest ¶
type PieRequest struct {
DividendCashAction *PieRequestDividendCashAction `json:"dividendCashAction,omitempty"`
EndDate *time.Time `json:"endDate,omitempty"`
// Goal Total desired value of the pie in account currency
Goal *float32 `json:"goal,omitempty"`
Icon *string `json:"icon,omitempty"`
Name *string `json:"name,omitempty"`
}
PieRequest defines model for PieRequest.
type PieRequestDividendCashAction ¶
type PieRequestDividendCashAction string
PieRequestDividendCashAction defines model for PieRequest.DividendCashAction.
const ( PieRequestDividendCashActionREINVEST PieRequestDividendCashAction = "REINVEST" PieRequestDividendCashActionTOACCOUNTCASH PieRequestDividendCashAction = "TO_ACCOUNT_CASH" )
Defines values for PieRequestDividendCashAction.
func (PieRequestDividendCashAction) Valid ¶
func (e PieRequestDividendCashAction) Valid() bool
Valid indicates whether the value is a known member of the PieRequestDividendCashAction enum.
type PlaceLimitOrderJSONRequestBody ¶
type PlaceLimitOrderJSONRequestBody = LimitRequest
PlaceLimitOrderJSONRequestBody defines body for PlaceLimitOrder for application/json ContentType.
type PlaceMarketOrderJSONRequestBody ¶
type PlaceMarketOrderJSONRequestBody = MarketRequest
PlaceMarketOrderJSONRequestBody defines body for PlaceMarketOrder for application/json ContentType.
type PlaceStopOrder1JSONRequestBody ¶
type PlaceStopOrder1JSONRequestBody = StopRequest
PlaceStopOrder1JSONRequestBody defines body for PlaceStopOrder1 for application/json ContentType.
type PlaceStopOrderJSONRequestBody ¶
type PlaceStopOrderJSONRequestBody = StopLimitRequest
PlaceStopOrderJSONRequestBody defines body for PlaceStopOrder for application/json ContentType.
type Position ¶
type Position struct {
// AveragePricePaid Average price paid, in instrument currency, per share.
AveragePricePaid *float32 `json:"averagePricePaid,omitempty"`
// CreatedAt The ISO 8601 formatted date of when the position was opened.
CreatedAt *time.Time `json:"createdAt,omitempty"`
// CurrentPrice Current price, in instrument currency, of a single share.
CurrentPrice *float32 `json:"currentPrice,omitempty"`
// Instrument Instrument information as given by /instruments endpoint.
Instrument *Instrument `json:"instrument,omitempty"`
// Quantity Total quantity of shares owned.
Quantity *float32 `json:"quantity,omitempty"`
// QuantityAvailableForTrading Quantity of shares available for trading.
QuantityAvailableForTrading *float32 `json:"quantityAvailableForTrading,omitempty"`
// QuantityInPies Quantity of shares currently used in pie.
QuantityInPies *float32 `json:"quantityInPies,omitempty"`
WalletImpact *PositionWalletImpact `json:"walletImpact,omitempty"`
}
Position defines model for Position.
type PositionWalletImpact ¶
type PositionWalletImpact struct {
// Currency The currency code used to represent all the wallet impact information.
Currency *string `json:"currency,omitempty"`
// CurrentValue The current market value of the position.
CurrentValue *float32 `json:"currentValue,omitempty"`
// FxImpact The positive or negative impact on the position's value due to currency rate changes.
FxImpact *float32 `json:"fxImpact,omitempty"`
// TotalCost The total cost paid for the position.
TotalCost *float32 `json:"totalCost,omitempty"`
// UnrealizedProfitLoss The unrealized profit & loss for the position. Calculated as currentValue - totalCost.
UnrealizedProfitLoss *float32 `json:"unrealizedProfitLoss,omitempty"`
}
PositionWalletImpact defines model for PositionWalletImpact.
type PublicReportRequest ¶
type PublicReportRequest struct {
DataIncluded *ReportDataIncluded `json:"dataIncluded,omitempty"`
TimeFrom *time.Time `json:"timeFrom,omitempty"`
TimeTo *time.Time `json:"timeTo,omitempty"`
}
PublicReportRequest defines model for PublicReportRequest.
type ReportDataIncluded ¶
type ReportDataIncluded struct {
IncludeDividends *bool `json:"includeDividends,omitempty"`
IncludeInterest *bool `json:"includeInterest,omitempty"`
IncludeOrders *bool `json:"includeOrders,omitempty"`
IncludeTransactions *bool `json:"includeTransactions,omitempty"`
}
ReportDataIncluded defines model for ReportDataIncluded.
type ReportResponse ¶
type ReportResponse struct {
DataIncluded *ReportDataIncluded `json:"dataIncluded,omitempty"`
DownloadLink *string `json:"downloadLink,omitempty"`
ReportId *int64 `json:"reportId,omitempty"`
Status *ReportResponseStatus `json:"status,omitempty"`
TimeFrom *time.Time `json:"timeFrom,omitempty"`
TimeTo *time.Time `json:"timeTo,omitempty"`
}
ReportResponse defines model for ReportResponse.
type ReportResponseStatus ¶
type ReportResponseStatus string
ReportResponseStatus defines model for ReportResponse.Status.
const ( Canceled ReportResponseStatus = "Canceled" Failed ReportResponseStatus = "Failed" Finished ReportResponseStatus = "Finished" Processing ReportResponseStatus = "Processing" Queued ReportResponseStatus = "Queued" Running ReportResponseStatus = "Running" )
Defines values for ReportResponseStatus.
func (ReportResponseStatus) Valid ¶
func (e ReportResponseStatus) Valid() bool
Valid indicates whether the value is a known member of the ReportResponseStatus enum.
type RequestReportJSONRequestBody ¶
type RequestReportJSONRequestBody = PublicReportRequest
RequestReportJSONRequestBody defines body for RequestReport for application/json ContentType.
type StopLimitRequest ¶
type StopLimitRequest struct {
LimitPrice *float32 `json:"limitPrice,omitempty"`
Quantity *float32 `json:"quantity,omitempty"`
StopPrice *float32 `json:"stopPrice,omitempty"`
Ticker *string `json:"ticker,omitempty"`
// TimeValidity Specifies how long the order remains active:
// * DAY: The order will automatically expire if not executed by midnight in the time zone of the instrument's exchange.
// * GOOD_TILL_CANCEL: The order remains active indefinitely until it is either filled or explicitly cancelled by you.
TimeValidity *TimeValidity `json:"timeValidity,omitempty"`
}
StopLimitRequest defines model for StopLimitRequest.
type StopRequest ¶
type StopRequest struct {
Quantity *float32 `json:"quantity,omitempty"`
StopPrice *float32 `json:"stopPrice,omitempty"`
Ticker *string `json:"ticker,omitempty"`
// TimeValidity Specifies how long the order remains active:
// * DAY: The order will automatically expire if not executed by midnight in the time zone of the instrument's exchange.
// * GOOD_TILL_CANCEL: The order remains active indefinitely until it is either filled or explicitly cancelled by you.
TimeValidity *TimeValidity `json:"timeValidity,omitempty"`
}
StopRequest defines model for StopRequest.
type Tax ¶
type Tax struct {
ChargedAt *time.Time `json:"chargedAt,omitempty"`
Currency *string `json:"currency,omitempty"`
Name *TaxName `json:"name,omitempty"`
Quantity *float32 `json:"quantity,omitempty"`
}
Tax defines model for Tax.
type TaxName ¶
type TaxName string
TaxName defines model for Tax.Name.
const ( COMMISSIONTURNOVER TaxName = "COMMISSION_TURNOVER" CURRENCYCONVERSIONFEE TaxName = "CURRENCY_CONVERSION_FEE" FINRAFEE TaxName = "FINRA_FEE" FRENCHTRANSACTIONTAX TaxName = "FRENCH_TRANSACTION_TAX" PTMLEVY TaxName = "PTM_LEVY" STAMPDUTY TaxName = "STAMP_DUTY" STAMPDUTYRESERVETAX TaxName = "STAMP_DUTY_RESERVE_TAX" TRANSACTIONFEE TaxName = "TRANSACTION_FEE" )
Defines values for TaxName.
type TimeEvent ¶
type TimeEvent struct {
Date *time.Time `json:"date,omitempty"`
Type *TimeEventType `json:"type,omitempty"`
}
TimeEvent defines model for TimeEvent.
type TimeEventType ¶
type TimeEventType string
TimeEventType defines model for TimeEvent.Type.
const ( AFTERHOURSCLOSE TimeEventType = "AFTER_HOURS_CLOSE" AFTERHOURSOPEN TimeEventType = "AFTER_HOURS_OPEN" BREAKEND TimeEventType = "BREAK_END" BREAKSTART TimeEventType = "BREAK_START" CLOSE TimeEventType = "CLOSE" OPEN TimeEventType = "OPEN" OVERNIGHTOPEN TimeEventType = "OVERNIGHT_OPEN" PREMARKETOPEN TimeEventType = "PRE_MARKET_OPEN" )
Defines values for TimeEventType.
func (TimeEventType) Valid ¶
func (e TimeEventType) Valid() bool
Valid indicates whether the value is a known member of the TimeEventType enum.
type TimeValidity ¶
type TimeValidity string
TimeValidity Specifies how long the order remains active: * DAY: The order will automatically expire if not executed by midnight in the time zone of the instrument's exchange. * GOOD_TILL_CANCEL: The order remains active indefinitely until it is either filled or explicitly cancelled by you.
const ( DAY TimeValidity = "DAY" GOODTILLCANCEL TimeValidity = "GOOD_TILL_CANCEL" )
Defines values for TimeValidity.
func (TimeValidity) Valid ¶
func (e TimeValidity) Valid() bool
Valid indicates whether the value is a known member of the TimeValidity enum.
type TradableInstrument ¶
type TradableInstrument struct {
// AddedOn On the platform since
AddedOn *time.Time `json:"addedOn,omitempty"`
// CurrencyCode ISO 4217
CurrencyCode *string `json:"currencyCode,omitempty"`
ExtendedHours *bool `json:"extendedHours,omitempty"`
Isin *string `json:"isin,omitempty"`
MaxOpenQuantity *float32 `json:"maxOpenQuantity,omitempty"`
Name *string `json:"name,omitempty"`
ShortName *string `json:"shortName,omitempty"`
// Ticker Unique identifier
Ticker *string `json:"ticker,omitempty"`
Type *TradableInstrumentType `json:"type,omitempty"`
// WorkingScheduleId Get items in the /exchanges endpoint
WorkingScheduleId *int64 `json:"workingScheduleId,omitempty"`
}
TradableInstrument defines model for TradableInstrument.
type TradableInstrumentType ¶
type TradableInstrumentType string
TradableInstrumentType defines model for TradableInstrument.Type.
const ( CORPACT TradableInstrumentType = "CORPACT" CRYPTO TradableInstrumentType = "CRYPTO" CRYPTOCURRENCY TradableInstrumentType = "CRYPTOCURRENCY" CVR TradableInstrumentType = "CVR" ETF TradableInstrumentType = "ETF" FOREX TradableInstrumentType = "FOREX" FUTURES TradableInstrumentType = "FUTURES" INDEX TradableInstrumentType = "INDEX" STOCK TradableInstrumentType = "STOCK" WARRANT TradableInstrumentType = "WARRANT" )
Defines values for TradableInstrumentType.
func (TradableInstrumentType) Valid ¶
func (e TradableInstrumentType) Valid() bool
Valid indicates whether the value is a known member of the TradableInstrumentType enum.
type TransactionsParams ¶
type TransactionsParams struct {
// Cursor Pagination cursor
Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"`
// Time Retrieve transactions starting from the specified time
Time *time.Time `form:"time,omitempty" json:"time,omitempty"`
// Limit Max items: 50
Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"`
}
TransactionsParams defines parameters for Transactions.
type UpdateJSONRequestBody ¶
type UpdateJSONRequestBody = PieRequest
UpdateJSONRequestBody defines body for Update for application/json ContentType.
type WorkingSchedule ¶
type WorkingSchedule struct {
Id *int64 `json:"id,omitempty"`
TimeEvents *[]TimeEvent `json:"timeEvents,omitempty"`
}
WorkingSchedule defines model for WorkingSchedule.