ofx4js
Version:
A javascript OFX library, ported from OFX4J
129 lines (128 loc) • 4.83 kB
TypeScript
import { InvestmentPosition } from "./InvestmentPosition";
import { SecurityId } from "../../seclist/SecurityId";
import { SubAccountType } from "../accounts/SubAccountType";
import { PositionType } from "./PositionType";
import { Inv401KSource } from "./Inv401KSource";
/**
* Base class for the various types of positions.
* <br>
* This class exposes a read-only view of the flattened aggregates that are
* common to all positions as a convenience to application
* developers who may not find the ofx aggregation model intuitive.
*/
export declare class BasePosition {
private investmentPosition;
/**
* Gets the investment position child aggregate.
*
* @return the investment position child aggregate
*/
getInvestmentPosition(): InvestmentPosition;
/**
* Sets the investment position child aggregate.
*
* @param investmentPosition the investment position child aggregate
*/
setInvestmentPosition(investmentPosition: InvestmentPosition): void;
/**
* Gets the security id for the position. This is a required field according to the OFX spec.
* @see "Section 13.9.2.6.1, OFX Spec"
*
* @return the security id for the position
*/
getSecurityId(): SecurityId;
/**
* Gets the sub-account type. One of "CASH", "MARGIN", "SHORT", "OTHER". This is a required field
* according to the OFX spec.
* @see "Section 13.9.2.6.1, OFX Spec"
*
* @return the sub-account type
*/
getHeldInAccount(): string;
/**
* Gets the sub-account type as one of the well-known types.
* @see "Section 13.9.2.6.1, OFX Spec"
*
* @return the sub-account type or null if it's not one of the well-known types
*/
getHeldInAccountEnum(): SubAccountType;
/**
* Gets the position type. One of SHORT or LONG. This is a required field according to the OFX
* spec.
* @see "Section 13.9.2.6.1, OFX Spec"
*
* @return the position type
*/
getPositionType(): string;
/**
* Gets the position type as one of the well-known types.
* @see "Section 13.9.2.6.1, OFX Spec"
*
* @return the position type or null if it's not one of the well-known types
*/
getPositionTypeEnum(): PositionType;
/**
* Gets the number of units in the position. For stocks, mutual funds, and others, this
* is the number of shares. For bonds, this is the face value. For options, this is the number of
* contacts. This is a required field according to the OFX spec.
* @see "Section 13.9.2.6.1, OFX Spec"
*
* @return the number of units in the position
*/
getUnits(): number;
/**
* Gets the price per commonly-quoted unit. For stocks, mutual funds, and others, this is the
* share price. For bonds, this is the percentage of par. For options, this is the per share (not
* per contact) price. This is a required field according to the OFX spec.
* @see "Section 13.9.2.6.1, OFX Spec"
*
* @return the per unit price
*/
getUnitPrice(): number;
/**
* Gets the market value of this position. This is a required field according to the OFX spec.
* @see "Section 13.9.2.6.1, OFX Spec"
*
* @return the market value of the position
*/
getMarketValue(): number;
/**
* Gets the date and time of the unit price and market value. This is a required field according
* to the OFX spec.
* @see "Section 13.9.2.6.1, OFX Spec"
*
* @return the market value date
*/
getMarketValueDate(): Date;
/**
* Gets the currency code of the position. This is an optional field according to the OFX spec.
* If not present, it's the default currency of the account.
* @see "Section 13.9.2.6.1, OFX Spec"
*
* @return the currency code of the position or null for the default currency
*/
getCurrencyCode(): string;
/**
* Gets the memo associated with the position. This is an optional field according to the OFX
* spec.
* @see "Section 13.9.2.6.1, OFX Spec"
*
* @return the memo
*/
getMemo(): string;
/**
* Gets the 401K source for the sale. Should be one of "PRETAX", "AFTERTAX", "MATCH",
* "PROFITSHARING", "ROLLOVER", "OTHERVEST", "OTHERNONVEST". This is an optional field
* according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the 401k source
*/
get401kSource(): string;
/**
* Gets the 401k source as one of the well-known types.
*
* @return the 401k source or null if it's not one of the well-known types
*/
get401kSourceEnum(): Inv401KSource;
}