import { Rtbs } from '.'; import { AccountClassification, AccountStatus, AccountType, BankAccountType, BankLinkStatus, CashTransferStatus, OrderStatus, OrderType, OverExposedType, QuoteType } from '../constants/lookups'; import { Portfolio } from './Portfolio.type'; import { Quote } from './Quote.type'; export interface Account { accountId: number; accountNumber: string; fullName: string; firstName: string; lastName: string; middleName: string; accountType: AccountType; accountClassification: AccountClassification; quoteType: QuoteType; optionLevel: number; allowNakedPuts: boolean; allowNakedCalls: boolean; allowShortSpreads: boolean; allowMutualFunds: boolean; cryptoEnabled: boolean; tradingHalted: boolean; street1: string; street2: string; address: string; phone1: string; phone2: string; status: AccountStatus; } export declare type AccountWithExtraInfo = Account & Rtbs; export interface AccountWithPositionInfo extends AccountWithExtraInfo { portfolio: Portfolio; availableCash: number; positionValue: number; positionWeight: number; positionShares: number; } export interface PositionAccount { accountId: number; symbol: string; quantity: number; type: AccountType; quote: Quote; } export interface PositionAccountWithExtraInfo extends PositionAccount { accountNumber: string; fullName: string; positionValue: number; positionWeight: number; inventory: boolean; } export interface OverExposedAccount { overExposedType: OverExposedType; accountId: number; accountNumber: string; fullName: string; exposure: number; positionType?: string; symbol?: string; sector?: string; } export interface OverExposedEntry { accountId: number; concentration: number; quote: Quote & { securityType: string; }; industryByType?: { industryType: string; levelCode: number; industryName: string; description: string; activeSymbol: string; size: number; }; } export interface AccountHistory { acatActivity: boolean; addition: boolean; cashActivity: boolean; cashUpdateEntry: boolean; change: boolean; combinedFees: number; commission: number; currency: string; date: string; dividendPayment: boolean; legRef: number; newSymbol: string; occFee: number; option: boolean; optionExerciseOrAssignmentActivity: boolean; optionFlag: number; orderRef: string; orfFee: number; pefFee: number; price: number; priceOfTrade: number; profitLoss: number; quantity: number; secFee: number; split: boolean; stockActivity: boolean; stockCredit: boolean; strikePrice: number; symbol: string; tafFee: number; tradeEntry: boolean; transferActivity: boolean; type: string; underlyingQuantity: number; value: number; } export interface AccountHistoryWithExtraInfo extends AccountHistory { activity: string; } export interface BalanceHistory { balance: number; date: string; } export interface CryptoOrderHistory { activationPrice: number; amount: number; commission: number; commissionCurrency: string; createdAt: string; createdBy: string; executionPrice: number; instrument: string; isLimit: boolean; isPending: boolean; orderId: string; orderType: OrderType; price: number; remaining: number; requestedQuoteAmount: number; side: number; status: OrderStatus; stopPrice: number; timeInForce: number; total: number; tradedAmount: number; trades: []; type: string; unitsFilled: number; updatedAt: string; rejectDetails: string; cancelReason: string; requestId: string; messages: string[]; } export interface CryptoOrderHistoryWithExtraInfo extends CryptoOrderHistory { symbol: string; nameWithIcon: string; } export interface CryptoTradingHistory { amount: number; comission: number; executionPrice: number; instrument: string; quoteAmount: number; remaining: number; side: number; tradeSeq: number; tradeTime: string; transactionId: number; } export interface CryptoTradingHistoryWithExtraInfo extends CryptoTradingHistory { symbol: string; nameWithIcon: string; } export interface CryptoStablecoinTransferStatus { accountNumber: string; amount: number; asset: string; comment: string; fee: number; fromBankToBrokerage: boolean; requestId: string; sequence: number; status: string; subNo: string; timestamp: string; useDefaultTransferFee: boolean; } export interface CryptoStablecoinTransferStatusWithExtraInfo extends CryptoStablecoinTransferStatus { symbol: string; } export interface Name { givenName: string; middleInitial: string; familyName: string; } export interface PhysicalAddress { streetLine1: string; city: string; stateOrProvince: string; postalCode: string; country: string; addressType: string; } export interface MailingAddress { streetLine1: string; city: string; stateOrProvince: string; postalCode: string; country: string; addressType: string; } export interface Contact { phone: string; phoneType: string; physicalAddress: PhysicalAddress; mailingAddress: MailingAddress; } export interface Id { idType: string; idNumber: string; state: string; issueDate: string; expirationDate: string; } export interface Employment { employmentStatus: string; occupation: string; } export interface TinCertification { documentRevision: string; holderESignature: string; } export interface PersonalDepositAccountAgreement { documentRevision: string; holderESignature: string; } export interface PrivacyPolicy { documentRevision: string; holderESignature: string; } export interface PaperlessESign { documentRevision: string; holderESignature: string; } export interface FairCreditReportingActNotice { documentRevision: string; holderESignature: string; } export interface CryptoTradingAgreement { documentRevision: string; holderESignature: string; } export interface RiskDisclosure { documentRevision: string; holderESignature: string; } export interface IndividualHolder { name: Name; email: string; emailType: string; birthDate: string; ssn: string; taxIdFormat: string; contact: Contact; id: Id; employment: Employment; maritalStatus: string; tinCertification: TinCertification; personalDepositAccountAgreement: PersonalDepositAccountAgreement; privacyPolicy: PrivacyPolicy; paperlessESign: PaperlessESign; fairCreditReportingActNotice: FairCreditReportingActNotice; cryptoTradingAgreement: CryptoTradingAgreement; riskDisclosure: RiskDisclosure; } export interface FundingFeatures { fundingSource: string; } export interface W9 { exemptPayee: string; factaCode: string; } export interface AchInstructions { bankAccountNumber: string; bankRoutingNumber: string; bankAccountOwnersName: string; bankAccountType: string; verified: boolean; } export interface CryptoAccountInfo { accountType: string; accountNumber: string; individualHolder: IndividualHolder; fundingFeatures: FundingFeatures; trustedContactOptIn: boolean; w9: W9; promoCode: string; securityWord: string; securityWordHint: string; achInstructions: AchInstructions; version: string; subNo: string; requestId: string; sequence: number; status: string; openedDate: string; } declare type Cancellation = { reason: string; cancellationTime: string; comment: string; }; declare type ApprovalInfo = { userEntity: string; userClass: string; userName: string; }; declare type Approval = { approvedBy: ApprovalInfo; approvalTime: string; }; export interface BankLink { id: string; entryId: number; creationTime: string; status: BankLinkStatus; bankAccount: string; bankAccountType: BankAccountType; bankRoutingNumber: string; nickname: string; account: string; maskedBankRoutingNumber: string; maskedBankAccount: string; relationshipType: string; approvalMethod?: string; bankAccountOwnerName?: string; cancellation?: Cancellation; approval?: Approval; } export interface ApprovedBy { userEntity: string; userClass: string; userName: string; } export declare type CashTransfer = { achRelationshipId: string; transferId: string; accountId: number; amount: number; cancelable: boolean; createdOn: string; direction: string; externalTransferId: string; mechanism: string; requestedAmount: number; source: string; state: CashTransferStatus; updatedOn: string; transferTime?: string; relationship?: Relationship; containsRedirectUrl?: boolean; redirectUrl?: string; accountNumber?: string; }; declare type Relationship = { bankAccount: string; bankRoutingNumber: string; nickname: string; creationTime: string; entryId: number; maskedBankAccount: string; maskedBankRoutingNumber: string; status: CashTransferStatus; }; export declare type DepositWithdraw = { amount: number; fees: number; transferId: string; transferTime: string; }; export declare type CancelTransaction = { amount: number; fees: number; requestedAmount: number; state: string; transferId: string; transferTime: string; }; export declare type CryptoTradePreview = { expectedQty: number; expectedPx: number; warnings: string[]; orderFeesCharges: number; }; export {};