import { Address, Hash, Hex, PublicClient } from 'viem'; import { LoanV4, OfferV4, RenegotiationV4 } from '../../blockchain'; import { Wallet } from '../../clients/contracts'; import { multiSourceLoanABI as multiSourceLoanABIV4 } from '../../generated/blockchain/v4'; import { EmitLoanArgs } from '../../gondi'; import { BaseContract } from './BaseContract'; import { MslV5 } from './MslV5'; import { MslV6 } from './MslV6'; export declare class MslV4 extends BaseContract { version: "1"; constructor({ walletClient, address, publicClient, }: { walletClient: Wallet; address: Address; publicClient?: PublicClient; }); private getDomain; signOffer({ structToSign }: { structToSign: OfferV4; }): Promise<`0x${string}`>; signRenegotiationOffer({ structToSign }: { structToSign: RenegotiationV4; }): Promise<`0x${string}`>; cancelOffer({ id }: { id: bigint; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; lender: `0x${string}`; offerId: bigint; }>; }>; cancelOffers(_: { ids: bigint[]; }): Promise; cancelAllOffers({ minId }: { minId: bigint; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; lender: `0x${string}`; minOfferId: bigint; }>; }>; cancelRefinanceOffer({ id }: { id: bigint; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; lender: `0x${string}`; renegotiationId: bigint; }>; }>; cancelAllRenegotiations({ minId }: { minId: bigint; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; lender: `0x${string}`; minRenegotiationId: bigint; }>; }>; private mapEmitLoanToMslEmitLoanArgs; emitLoan(emitArgs: EmitLoanArgs): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; source: readonly { loanId: bigint; lender: `0x${string}`; principalAmount: bigint; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; id: string; }; loanId: bigint; offerId: string; }>; }>; repayLoan({ loan, nftReceiver, loanId, }: { loan: LoanV4; loanId: bigint; nftReceiver?: Address; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loanId: bigint; totalRepayment: bigint; fee: bigint; }>; }>; getRemainingLockupSeconds(): number; isEndLockedUp(): boolean; refinanceBatch({ renegotiationId, refinancings, }: { renegotiationId: bigint; refinancings: { loan: LoanV4; newAprBps: bigint; sources: { source: LoanV4['source'][number]; refinancingPrincipal: bigint; }[]; }[]; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; results: { renegotiationId: bigint; oldLoanId: bigint; newLoanId: bigint; loan: { borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; source: readonly { loanId: bigint; lender: `0x${string}`; principalAmount: bigint; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; }; fee: bigint; }[]; }>; }>; refinanceFullLoan({ offer, signature, loan, }: { offer: RenegotiationV4; signature: Hash; loan: LoanV4; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; source: readonly { loanId: bigint; lender: `0x${string}`; principalAmount: bigint; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; id: string; }; loanId: bigint; renegotiationId: string; }>; }>; refinancePartialLoan({ offer, loan }: { offer: RenegotiationV4; loan: LoanV4; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; source: readonly { loanId: bigint; lender: `0x${string}`; principalAmount: bigint; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; id: string; }; loanId: bigint; renegotiationId: string; }>; }>; private executeRenegotiation; addTranche(): ReturnType; refinanceFromOffers(): ReturnType; delegateMulticall(): ReturnType; delegate(): ReturnType; revokeDelegate(): ReturnType; revokeDelegationsAndEmitLoan(): ReturnType; liquidateLoan({ loan, loanId }: { loan: LoanV4; loanId: bigint; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loanId: bigint; }>; }>; decodeRepaymentCalldata(calldata: Hex): `0x${string}`; getProtocolFee(): ReturnType; }