ofx4js
Version:
A javascript OFX library, ported from OFX4J
138 lines (137 loc) • 5.12 kB
TypeScript
import { BaseOtherInvestmentTransaction } from "./BaseOtherInvestmentTransaction";
import { TransactionWithSecurity } from "./TransactionWithSecurity";
import { SecurityId } from "../../seclist/SecurityId";
import { CloseOptionAction } from "./CloseOptionAction";
import { SubAccountType } from "../accounts/SubAccountType";
/**
* Transaction for closing an option position due to expiration, exercise, or assignment.
* @see "Section 13.9.2.4.4, OFX Spec"
*/
export declare class CloseOptionTransaction extends BaseOtherInvestmentTransaction implements TransactionWithSecurity {
private securityId;
private optionAction;
private units;
private sharesPerContact;
private subAccountSecurity;
private relatedTransactionId;
private gain;
constructor();
/**
* Gets the security id of the option.
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @return the security id of the option
*/
getSecurityId(): SecurityId;
/**
* Sets the security id of the option.
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @param securityId the security id of the option
*/
setSecurityId(securityId: SecurityId): void;
/**
* Gets the action being performed (i.e. "EXERCISE", "ASSIGN", "EXPIRE" This is a required field
* according to the OFX spec.
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @return the option action
*/
getOptionAction(): string;
/**
* Sets the action being performed (i.e. "EXERCISE", "ASSIGN", "EXPIRE" This is a required field
* according to the OFX spec.
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @param optionAction the option action
*/
setOptionAction(optionAction: string): void;
/**
* Gets the action as one of the well-known types.
*
* @return the type of close or null if it's not a well-known type
*/
getOptionActionEnum(): CloseOptionAction;
/**
* Gets the number of units of the option that were closed. This is a required field according
* to the OFX spec.
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @return the number of units closed
*/
getUnits(): number;
/**
* Sets the number of units of the option that were closed. This is a required field according
* to the OFX spec.
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @param units the number of units closed
*/
setUnits(units: number): void;
/**
* Gets the number of shares per contact. This is a required field according to the OFX spec.
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @return the number of shares per contact
*/
getSharesPerContact(): number;
/**
* Sets the number of shares per contact. This is a required field according to the OFX spec.
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @param sharesPerContact the number of shares per contact
*/
setSharesPerContact(sharesPerContact: number): void;
/**
* Gets the sub account type for the security (e.g. CASH, MARGIN, SHORT, OTHER).
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @return the sub account type
*/
getSubAccountSecurity(): string;
/**
* Sets the sub account type for the security (e.g. CASH, MARGIN, SHORT, OTHER).
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @param subAccountSecurity the sub account type
*/
setSubAccountSecurity(subAccountSecurity: string): void;
/**
* Gets the result of getSubAccountFund as one of the well-known types.
*
* @return the type of null if it wasn't one of the well known types
*/
getSubAccountSecurityEnum(): SubAccountType;
/**
* Gets the related transaction id for the related buy or sell corresponding to the
* EXERCISE or ASSIGN action. This is a required field according to the OFX spec if the
* action or EXERCISE or ASSIGN.
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @return the related transaction id
*/
getRelatedTransactionId(): string;
/**
* Sets the related transaction id for the related buy or sell corresponding to the
* EXERCISE or ASSIGN action. This is a required field according to the OFX spec if the
* action or EXERCISE or ASSIGN.
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @param relatedTransactionId the related transaction id
*/
setRelatedTransactionId(relatedTransactionId: string): void;
/**
* Gets the gain related to the transaction. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @return the gain related to the transaction
*/
getGain(): number;
/**
* Sets the gain related to the transaction. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.4, OFX Spec"
*
* @param gain the gain related to the transaction
*/
setGain(gain: number): void;
}