///
import { PublicKey } from "@solana/web3.js";
import { AdjustRepaymentScheduleConfig, DistributionWaterfall, RepaymentScheduleConfig, TrancheConfig, UpdateArrangementFeeConfig } from "../config";
import { ClaimsConfig } from "../config";
import { Deal as ProgramDeal } from "../idl/idl.types";
import { Base } from "../rpc/Base";
import { CredixClient, SolanaContext } from "../rpc/CredixClient";
import { DealClaims } from "./DealClaims";
import { Fraction } from "./Fraction";
import { Market } from "./Market";
import { RepaymentSchedule } from "./RepaymentSchedule";
import { Tranches } from "./Tranches";
export declare enum DealStatus {
STRUCTURING = 0,
CLOSED = 1,
IN_PROGRESS = 2,
OPEN_FOR_FUNDING = 3,
PENDING = 4,
DEFAULTED = 5
}
export declare class Deal extends Base {
address: PublicKey;
market: Market;
constructor(address: PublicKey, market: Market, deal: ProgramDeal, client: CredixClient, solanaContext: SolanaContext);
status(tranches?: Tranches | null, schedule?: RepaymentSchedule | null): Promise;
static generatePDA(borrower: PublicKey, dealNumber: number, market: Market): [PublicKey, number];
get name(): string;
get borrower(): PublicKey;
get amountWithdrawn(): import("@solana/web3.js").TokenAmount;
get offRampTokenAccount(): PublicKey | null;
get collectionTokenAccount(): PublicKey | null;
get collectionTokenAuthority(): PublicKey | null;
get arrangementFeeCollectionAuthority(): PublicKey | null;
arrangementFeeCollectionTokenAccount(): PublicKey | null;
get goLiveAt(): number | null;
get createdAt(): number;
get maxfundingDuration(): number;
get number(): number;
get outstandingArrangementFees(): import("@solana/web3.js").TokenAmount;
get arrangementFees(): import("@solana/web3.js").TokenAmount;
get arrangementFeesRepaid(): import("@solana/web3.js").TokenAmount;
get timeLatestArrangementFeesCharged(): number;
get migrated(): boolean;
get openedAt(): number | null;
get arrangementFeePercentage(): Fraction;
arrangementFeesDueAt(): number;
private updateBuilder;
update(updateConfig: UpdateArrangementFeeConfig): Promise;
updateIx(updateConfig: UpdateArrangementFeeConfig, owner?: PublicKey): Promise;
baseTokenAccount(): [PublicKey, number];
generateArrangementFeeCollectionAuthorityAccountPDA(): [PublicKey, number];
tokenAccountBalance(): Promise;
setRepaymentSchedule(repaymentScheduleConfig: RepaymentScheduleConfig): Promise;
private adjustRepaymentScheduleBuilder;
adjustRepaymentSchedule(config: AdjustRepaymentScheduleConfig): Promise;
adjustRepaymentScheduleIx(config: AdjustRepaymentScheduleConfig, owner?: PublicKey): Promise;
private activateBuilder;
activateIx(owner?: PublicKey): Promise;
activate(): Promise;
private activateMigratedBuilder;
activateMigratedIx(claims: ClaimsConfig, owner?: PublicKey): Promise;
activateMigrated(claims: ClaimsConfig): Promise;
private openForFundingBuilder;
openForFundingIx(owner?: PublicKey): Promise;
openForFunding(): Promise;
withdraw(amount: number): Promise;
repay(amount: number, tranches?: Tranches | null): Promise;
get lastUpdateTimestamp(): number | null;
fetchTranches(): Promise;
fetchRepaymentSchedule(): Promise;
setTranches(trancheConfigs: TrancheConfig[]): Promise;
private repayArrangementFeesBuilder;
repayArrangementFeesIx(amount: number, signer?: PublicKey): Promise;
repayArrangementFees(amount: number): Promise;
isPending(tranches?: Tranches, schedule?: RepaymentSchedule | null): Promise;
isOpenForFunding(tranches?: Tranches, schedule?: RepaymentSchedule | null): Promise;
isClosed(tranches?: Tranches, schedule?: RepaymentSchedule | null): Promise;
isInProgress(tranches?: Tranches, schedule?: RepaymentSchedule | null): Promise;
isStructuring(tranches?: Tranches, schedule?: RepaymentSchedule | null): Promise;
fetchDealClaims(): Promise;
isFullyFunded(tranches?: Tranches | null): Promise;
reload(): Promise;
updateTranchesAmountsDueBuilder(tranches?: Tranches | null, owner?: PublicKey): Promise>;
updateTranchesAmountsDueIx(tranches?: Tranches | null, owner?: PublicKey): Promise;
updateTranchesAmountsDue(tranches?: Tranches | null, owner?: PublicKey): Promise;
private addRepaymentWaterfallBuilder;
addRepaymentWaterfallIx(waterfallDefinitions: DistributionWaterfall[]): Promise;
addRepaymentWaterfall(waterfallDefinitions: DistributionWaterfall[]): Promise;
private setCollectionAndOffRampTokenAccountsBuilder;
setCollectionAndOffRampTokenAccountsIx(offRampTokenAccount: PublicKey, owner?: PublicKey): Promise;
setCollectionAndOffRampTokenAccounts(offRampTokenAccount: PublicKey, owner?: PublicKey): Promise;
private returnFundsToBorrowerBuilder;
returnFundsToBorrowerIx(owner?: PublicKey): Promise;
returnFundsToBorrower(): Promise;
isOutOfDate(repaymentSchedule: RepaymentSchedule | null | undefined, tranches: Tranches | null | undefined, date: Date | undefined): Promise;
private setAmountDueToZero;
setAmountsDueToZeroIx(owner?: PublicKey): Promise;
setAmountsDueToZero(): Promise;
private checkIsOutOfDate;
}
//# sourceMappingURL=Deal.d.ts.map