import type { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client'; import { TypeName } from '../../_dependencies/std/type-name/structs'; import { ID, UID } from '../../_dependencies/sui/object/structs'; import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToJSON, ToPhantomTypeArgument, ToTypeStr } from '../../_framework/reified'; import { FieldsWithTypes } from '../../_framework/util'; import { Vector } from '../../_framework/vector'; import { Decimal } from '../decimal/structs'; import { UserRewardManager } from '../liquidity-mining/structs'; export declare function isObligation(type: string): boolean; export interface ObligationFields

{ id: ToField; lendingMarketId: ToField; /** * all deposits in the obligation. there is at most one deposit per coin type * There should never be a deposit object with a zeroed amount */ deposits: ToField>; /** * all borrows in the obligation. there is at most one deposit per coin type * There should never be a borrow object with a zeroed amount */ borrows: ToField>; /** value of all deposits in USD */ depositedValueUsd: ToField; /** * sum(deposit value * open ltv) for all deposits. * if weighted_borrowed_value_usd > allowed_borrow_value_usd, * the obligation is not healthy */ allowedBorrowValueUsd: ToField; /** * sum(deposit value * close ltv) for all deposits * if weighted_borrowed_value_usd > unhealthy_borrow_value_usd, * the obligation is unhealthy and can be liquidated */ unhealthyBorrowValueUsd: ToField; superUnhealthyBorrowValueUsd: ToField; /** value of all borrows in USD */ unweightedBorrowedValueUsd: ToField; /** weighted value of all borrows in USD. used when checking if an obligation is liquidatable */ weightedBorrowedValueUsd: ToField; /** * weighted value of all borrows in USD, but using the upper bound of the market value * used to limit borrows and withdraws */ weightedBorrowedValueUpperBoundUsd: ToField; borrowingIsolatedAsset: ToField<'bool'>; userRewardManagers: ToField>; /** unused */ badDebtUsd: ToField; /** unused */ closable: ToField<'bool'>; } export type ObligationReified

= Reified, ObligationFields

>; export type ObligationJSONField

= { id: string; lendingMarketId: string; deposits: ToJSON[]; borrows: ToJSON[]; depositedValueUsd: ToJSON; allowedBorrowValueUsd: ToJSON; unhealthyBorrowValueUsd: ToJSON; superUnhealthyBorrowValueUsd: ToJSON; unweightedBorrowedValueUsd: ToJSON; weightedBorrowedValueUsd: ToJSON; weightedBorrowedValueUpperBoundUsd: ToJSON; borrowingIsolatedAsset: boolean; userRewardManagers: ToJSON[]; badDebtUsd: ToJSON; closable: boolean; }; export type ObligationJSON

= { $typeName: typeof Obligation.$typeName; $typeArgs: [PhantomToTypeStr

]; } & ObligationJSONField

; export declare class Obligation

implements StructClass { __StructClass: true; static get $typeName(): `${string}::obligation::Obligation`; static readonly $numTypeParams = 1; static readonly $isPhantom: readonly [true]; readonly $typeName: typeof Obligation.$typeName; readonly $fullTypeName: `${string}::obligation::Obligation<${PhantomToTypeStr

}>`; readonly $typeArgs: [PhantomToTypeStr

]; readonly $isPhantom: typeof Obligation.$isPhantom; readonly id: ToField; readonly lendingMarketId: ToField; /** * all deposits in the obligation. there is at most one deposit per coin type * There should never be a deposit object with a zeroed amount */ readonly deposits: ToField>; /** * all borrows in the obligation. there is at most one deposit per coin type * There should never be a borrow object with a zeroed amount */ readonly borrows: ToField>; /** value of all deposits in USD */ readonly depositedValueUsd: ToField; /** * sum(deposit value * open ltv) for all deposits. * if weighted_borrowed_value_usd > allowed_borrow_value_usd, * the obligation is not healthy */ readonly allowedBorrowValueUsd: ToField; /** * sum(deposit value * close ltv) for all deposits * if weighted_borrowed_value_usd > unhealthy_borrow_value_usd, * the obligation is unhealthy and can be liquidated */ readonly unhealthyBorrowValueUsd: ToField; readonly superUnhealthyBorrowValueUsd: ToField; /** value of all borrows in USD */ readonly unweightedBorrowedValueUsd: ToField; /** weighted value of all borrows in USD. used when checking if an obligation is liquidatable */ readonly weightedBorrowedValueUsd: ToField; /** * weighted value of all borrows in USD, but using the upper bound of the market value * used to limit borrows and withdraws */ readonly weightedBorrowedValueUpperBoundUsd: ToField; readonly borrowingIsolatedAsset: ToField<'bool'>; readonly userRewardManagers: ToField>; /** unused */ readonly badDebtUsd: ToField; /** unused */ readonly closable: ToField<'bool'>; private constructor(); static reified

>(P: P): ObligationReified>; static get r(): typeof Obligation.reified; static phantom

>(P: P): PhantomReified>>>; static get p(): typeof Obligation.phantom; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields

>(typeArg: P, fields: Record): Obligation>; static fromFieldsWithTypes

>(typeArg: P, item: FieldsWithTypes): Obligation>; static fromBcs

>(typeArg: P, data: Uint8Array): Obligation>; toJSONField(): ObligationJSONField

; toJSON(): ObligationJSON

; static fromJSONField

>(typeArg: P, field: any): Obligation>; static fromJSON

>(typeArg: P, json: Record): Obligation>; static fromCoreObject

>(typeArg: P, obj: SuiClientTypes.Object<{ content: true; }>): Obligation>; static fetch

>(client: ClientWithCoreApi, typeArg: P, id: string): Promise>>; } export declare function isDeposit(type: string): boolean; export interface DepositFields { coinType: ToField; reserveArrayIndex: ToField<'u64'>; depositedCtokenAmount: ToField<'u64'>; marketValue: ToField; userRewardManagerIndex: ToField<'u64'>; /** unused */ attributedBorrowValue: ToField; } export type DepositReified = Reified; export type DepositJSONField = { coinType: string; reserveArrayIndex: string; depositedCtokenAmount: string; marketValue: ToJSON; userRewardManagerIndex: string; attributedBorrowValue: ToJSON; }; export type DepositJSON = { $typeName: typeof Deposit.$typeName; $typeArgs: []; } & DepositJSONField; export declare class Deposit implements StructClass { __StructClass: true; static get $typeName(): `${string}::obligation::Deposit`; static readonly $numTypeParams = 0; static readonly $isPhantom: readonly []; readonly $typeName: typeof Deposit.$typeName; readonly $fullTypeName: `${string}::obligation::Deposit`; readonly $typeArgs: []; readonly $isPhantom: typeof Deposit.$isPhantom; readonly coinType: ToField; readonly reserveArrayIndex: ToField<'u64'>; readonly depositedCtokenAmount: ToField<'u64'>; readonly marketValue: ToField; readonly userRewardManagerIndex: ToField<'u64'>; /** unused */ readonly attributedBorrowValue: ToField; private constructor(); static reified(): DepositReified; static get r(): DepositReified; static phantom(): PhantomReified>; static get p(): PhantomReified>; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields(fields: Record): Deposit; static fromFieldsWithTypes(item: FieldsWithTypes): Deposit; static fromBcs(data: Uint8Array): Deposit; toJSONField(): DepositJSONField; toJSON(): DepositJSON; static fromJSONField(field: any): Deposit; static fromJSON(json: Record): Deposit; static fromCoreObject(obj: SuiClientTypes.Object<{ content: true; }>): Deposit; static fetch(client: ClientWithCoreApi, id: string): Promise; } export declare function isBorrow(type: string): boolean; export interface BorrowFields { coinType: ToField; reserveArrayIndex: ToField<'u64'>; borrowedAmount: ToField; cumulativeBorrowRate: ToField; marketValue: ToField; userRewardManagerIndex: ToField<'u64'>; } export type BorrowReified = Reified; export type BorrowJSONField = { coinType: string; reserveArrayIndex: string; borrowedAmount: ToJSON; cumulativeBorrowRate: ToJSON; marketValue: ToJSON; userRewardManagerIndex: string; }; export type BorrowJSON = { $typeName: typeof Borrow.$typeName; $typeArgs: []; } & BorrowJSONField; export declare class Borrow implements StructClass { __StructClass: true; static get $typeName(): `${string}::obligation::Borrow`; static readonly $numTypeParams = 0; static readonly $isPhantom: readonly []; readonly $typeName: typeof Borrow.$typeName; readonly $fullTypeName: `${string}::obligation::Borrow`; readonly $typeArgs: []; readonly $isPhantom: typeof Borrow.$isPhantom; readonly coinType: ToField; readonly reserveArrayIndex: ToField<'u64'>; readonly borrowedAmount: ToField; readonly cumulativeBorrowRate: ToField; readonly marketValue: ToField; readonly userRewardManagerIndex: ToField<'u64'>; private constructor(); static reified(): BorrowReified; static get r(): BorrowReified; static phantom(): PhantomReified>; static get p(): PhantomReified>; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields(fields: Record): Borrow; static fromFieldsWithTypes(item: FieldsWithTypes): Borrow; static fromBcs(data: Uint8Array): Borrow; toJSONField(): BorrowJSONField; toJSON(): BorrowJSON; static fromJSONField(field: any): Borrow; static fromJSON(json: Record): Borrow; static fromCoreObject(obj: SuiClientTypes.Object<{ content: true; }>): Borrow; static fetch(client: ClientWithCoreApi, id: string): Promise; } export declare function isExistStaleOracles(type: string): boolean; export interface ExistStaleOraclesFields { dummyField: ToField<'bool'>; } export type ExistStaleOraclesReified = Reified; export type ExistStaleOraclesJSONField = { dummyField: boolean; }; export type ExistStaleOraclesJSON = { $typeName: typeof ExistStaleOracles.$typeName; $typeArgs: []; } & ExistStaleOraclesJSONField; export declare class ExistStaleOracles implements StructClass { __StructClass: true; static get $typeName(): `${string}::obligation::ExistStaleOracles`; static readonly $numTypeParams = 0; static readonly $isPhantom: readonly []; readonly $typeName: typeof ExistStaleOracles.$typeName; readonly $fullTypeName: `${string}::obligation::ExistStaleOracles`; readonly $typeArgs: []; readonly $isPhantom: typeof ExistStaleOracles.$isPhantom; readonly dummyField: ToField<'bool'>; private constructor(); static reified(): ExistStaleOraclesReified; static get r(): ExistStaleOraclesReified; static phantom(): PhantomReified>; static get p(): PhantomReified>; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields(fields: Record): ExistStaleOracles; static fromFieldsWithTypes(item: FieldsWithTypes): ExistStaleOracles; static fromBcs(data: Uint8Array): ExistStaleOracles; toJSONField(): ExistStaleOraclesJSONField; toJSON(): ExistStaleOraclesJSON; static fromJSONField(field: any): ExistStaleOracles; static fromJSON(json: Record): ExistStaleOracles; static fromCoreObject(obj: SuiClientTypes.Object<{ content: true; }>): ExistStaleOracles; static fetch(client: ClientWithCoreApi, id: string): Promise; } export declare function isObligationDataEvent(type: string): boolean; export interface ObligationDataEventFields { lendingMarketId: ToField<'address'>; obligationId: ToField<'address'>; deposits: ToField>; borrows: ToField>; depositedValueUsd: ToField; allowedBorrowValueUsd: ToField; unhealthyBorrowValueUsd: ToField; superUnhealthyBorrowValueUsd: ToField; unweightedBorrowedValueUsd: ToField; weightedBorrowedValueUsd: ToField; weightedBorrowedValueUpperBoundUsd: ToField; borrowingIsolatedAsset: ToField<'bool'>; badDebtUsd: ToField; closable: ToField<'bool'>; } export type ObligationDataEventReified = Reified; export type ObligationDataEventJSONField = { lendingMarketId: string; obligationId: string; deposits: ToJSON[]; borrows: ToJSON[]; depositedValueUsd: ToJSON; allowedBorrowValueUsd: ToJSON; unhealthyBorrowValueUsd: ToJSON; superUnhealthyBorrowValueUsd: ToJSON; unweightedBorrowedValueUsd: ToJSON; weightedBorrowedValueUsd: ToJSON; weightedBorrowedValueUpperBoundUsd: ToJSON; borrowingIsolatedAsset: boolean; badDebtUsd: ToJSON; closable: boolean; }; export type ObligationDataEventJSON = { $typeName: typeof ObligationDataEvent.$typeName; $typeArgs: []; } & ObligationDataEventJSONField; export declare class ObligationDataEvent implements StructClass { __StructClass: true; static get $typeName(): `${string}::obligation::ObligationDataEvent`; static readonly $numTypeParams = 0; static readonly $isPhantom: readonly []; readonly $typeName: typeof ObligationDataEvent.$typeName; readonly $fullTypeName: `${string}::obligation::ObligationDataEvent`; readonly $typeArgs: []; readonly $isPhantom: typeof ObligationDataEvent.$isPhantom; readonly lendingMarketId: ToField<'address'>; readonly obligationId: ToField<'address'>; readonly deposits: ToField>; readonly borrows: ToField>; readonly depositedValueUsd: ToField; readonly allowedBorrowValueUsd: ToField; readonly unhealthyBorrowValueUsd: ToField; readonly superUnhealthyBorrowValueUsd: ToField; readonly unweightedBorrowedValueUsd: ToField; readonly weightedBorrowedValueUsd: ToField; readonly weightedBorrowedValueUpperBoundUsd: ToField; readonly borrowingIsolatedAsset: ToField<'bool'>; readonly badDebtUsd: ToField; readonly closable: ToField<'bool'>; private constructor(); static reified(): ObligationDataEventReified; static get r(): ObligationDataEventReified; static phantom(): PhantomReified>; static get p(): PhantomReified>; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields(fields: Record): ObligationDataEvent; static fromFieldsWithTypes(item: FieldsWithTypes): ObligationDataEvent; static fromBcs(data: Uint8Array): ObligationDataEvent; toJSONField(): ObligationDataEventJSONField; toJSON(): ObligationDataEventJSON; static fromJSONField(field: any): ObligationDataEvent; static fromJSON(json: Record): ObligationDataEvent; static fromCoreObject(obj: SuiClientTypes.Object<{ content: true; }>): ObligationDataEvent; static fetch(client: ClientWithCoreApi, id: string): Promise; } export declare function isDepositRecord(type: string): boolean; export interface DepositRecordFields { coinType: ToField; reserveArrayIndex: ToField<'u64'>; depositedCtokenAmount: ToField<'u64'>; marketValue: ToField; userRewardManagerIndex: ToField<'u64'>; /** unused */ attributedBorrowValue: ToField; } export type DepositRecordReified = Reified; export type DepositRecordJSONField = { coinType: string; reserveArrayIndex: string; depositedCtokenAmount: string; marketValue: ToJSON; userRewardManagerIndex: string; attributedBorrowValue: ToJSON; }; export type DepositRecordJSON = { $typeName: typeof DepositRecord.$typeName; $typeArgs: []; } & DepositRecordJSONField; export declare class DepositRecord implements StructClass { __StructClass: true; static get $typeName(): `${string}::obligation::DepositRecord`; static readonly $numTypeParams = 0; static readonly $isPhantom: readonly []; readonly $typeName: typeof DepositRecord.$typeName; readonly $fullTypeName: `${string}::obligation::DepositRecord`; readonly $typeArgs: []; readonly $isPhantom: typeof DepositRecord.$isPhantom; readonly coinType: ToField; readonly reserveArrayIndex: ToField<'u64'>; readonly depositedCtokenAmount: ToField<'u64'>; readonly marketValue: ToField; readonly userRewardManagerIndex: ToField<'u64'>; /** unused */ readonly attributedBorrowValue: ToField; private constructor(); static reified(): DepositRecordReified; static get r(): DepositRecordReified; static phantom(): PhantomReified>; static get p(): PhantomReified>; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields(fields: Record): DepositRecord; static fromFieldsWithTypes(item: FieldsWithTypes): DepositRecord; static fromBcs(data: Uint8Array): DepositRecord; toJSONField(): DepositRecordJSONField; toJSON(): DepositRecordJSON; static fromJSONField(field: any): DepositRecord; static fromJSON(json: Record): DepositRecord; static fromCoreObject(obj: SuiClientTypes.Object<{ content: true; }>): DepositRecord; static fetch(client: ClientWithCoreApi, id: string): Promise; } export declare function isBorrowRecord(type: string): boolean; export interface BorrowRecordFields { coinType: ToField; reserveArrayIndex: ToField<'u64'>; borrowedAmount: ToField; cumulativeBorrowRate: ToField; marketValue: ToField; userRewardManagerIndex: ToField<'u64'>; } export type BorrowRecordReified = Reified; export type BorrowRecordJSONField = { coinType: string; reserveArrayIndex: string; borrowedAmount: ToJSON; cumulativeBorrowRate: ToJSON; marketValue: ToJSON; userRewardManagerIndex: string; }; export type BorrowRecordJSON = { $typeName: typeof BorrowRecord.$typeName; $typeArgs: []; } & BorrowRecordJSONField; export declare class BorrowRecord implements StructClass { __StructClass: true; static get $typeName(): `${string}::obligation::BorrowRecord`; static readonly $numTypeParams = 0; static readonly $isPhantom: readonly []; readonly $typeName: typeof BorrowRecord.$typeName; readonly $fullTypeName: `${string}::obligation::BorrowRecord`; readonly $typeArgs: []; readonly $isPhantom: typeof BorrowRecord.$isPhantom; readonly coinType: ToField; readonly reserveArrayIndex: ToField<'u64'>; readonly borrowedAmount: ToField; readonly cumulativeBorrowRate: ToField; readonly marketValue: ToField; readonly userRewardManagerIndex: ToField<'u64'>; private constructor(); static reified(): BorrowRecordReified; static get r(): BorrowRecordReified; static phantom(): PhantomReified>; static get p(): PhantomReified>; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields(fields: Record): BorrowRecord; static fromFieldsWithTypes(item: FieldsWithTypes): BorrowRecord; static fromBcs(data: Uint8Array): BorrowRecord; toJSONField(): BorrowRecordJSONField; toJSON(): BorrowRecordJSON; static fromJSONField(field: any): BorrowRecord; static fromJSON(json: Record): BorrowRecord; static fromCoreObject(obj: SuiClientTypes.Object<{ content: true; }>): BorrowRecord; static fetch(client: ClientWithCoreApi, id: string): Promise; }