/** The reserve module holds the coins of a certain type for a given lending market. */
import type { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client';
import { PriceIdentifier } from '../../_dependencies/pyth-2/price-identifier/structs';
import { TypeName } from '../../_dependencies/std/type-name/structs';
import { Balance, Supply } from '../../_dependencies/sui/balance/structs';
import { ID, UID } from '../../_dependencies/sui/object/structs';
import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToJSON, ToPhantomTypeArgument, ToTypeStr, ToTypeStr as ToPhantom } from '../../_framework/reified';
import { FieldsWithTypes } from '../../_framework/util';
import { Cell } from '../cell/structs';
import { Decimal } from '../decimal/structs';
import { PoolRewardManager } from '../liquidity-mining/structs';
import { ReserveConfig } from '../reserve-config/structs';
export declare function isReserve(type: string): boolean;
export interface ReserveFields
{
id: ToField;
lendingMarketId: ToField;
arrayIndex: ToField<'u64'>;
coinType: ToField;
config: ToField| >;
mintDecimals: ToField<'u8'>;
priceIdentifier: ToField;
price: ToField;
smoothedPrice: ToField;
priceLastUpdateTimestampS: ToField<'u64'>;
availableAmount: ToField<'u64'>;
ctokenSupply: ToField<'u64'>;
borrowedAmount: ToField;
cumulativeBorrowRate: ToField;
interestLastUpdateTimestampS: ToField<'u64'>;
unclaimedSpreadFees: ToField;
/** unused */
attributedBorrowValue: ToField;
depositsPoolRewardManager: ToField;
borrowsPoolRewardManager: ToField;
}
export type ReserveReified = Reified, ReserveFields>;
export type ReserveJSONField = {
id: string;
lendingMarketId: string;
arrayIndex: string;
coinType: string;
config: ToJSON| >;
mintDecimals: number;
priceIdentifier: ToJSON;
price: ToJSON;
smoothedPrice: ToJSON;
priceLastUpdateTimestampS: string;
availableAmount: string;
ctokenSupply: string;
borrowedAmount: ToJSON;
cumulativeBorrowRate: ToJSON;
interestLastUpdateTimestampS: string;
unclaimedSpreadFees: ToJSON;
attributedBorrowValue: ToJSON;
depositsPoolRewardManager: ToJSON;
borrowsPoolRewardManager: ToJSON;
};
export type ReserveJSON = {
$typeName: typeof Reserve.$typeName;
$typeArgs: [PhantomToTypeStr ];
} & ReserveJSONField ;
export declare class Reserve implements StructClass {
__StructClass: true;
static get $typeName(): `${string}::reserve::Reserve`;
static readonly $numTypeParams = 1;
static readonly $isPhantom: readonly [true];
readonly $typeName: typeof Reserve.$typeName;
readonly $fullTypeName: `${string}::reserve::Reserve<${PhantomToTypeStr }>`;
readonly $typeArgs: [PhantomToTypeStr ];
readonly $isPhantom: typeof Reserve.$isPhantom;
readonly id: ToField;
readonly lendingMarketId: ToField;
readonly arrayIndex: ToField<'u64'>;
readonly coinType: ToField;
readonly config: ToField| >;
readonly mintDecimals: ToField<'u8'>;
readonly priceIdentifier: ToField;
readonly price: ToField;
readonly smoothedPrice: ToField;
readonly priceLastUpdateTimestampS: ToField<'u64'>;
readonly availableAmount: ToField<'u64'>;
readonly ctokenSupply: ToField<'u64'>;
readonly borrowedAmount: ToField;
readonly cumulativeBorrowRate: ToField;
readonly interestLastUpdateTimestampS: ToField<'u64'>;
readonly unclaimedSpreadFees: ToField;
/** unused */
readonly attributedBorrowValue: ToField;
readonly depositsPoolRewardManager: ToField;
readonly borrowsPoolRewardManager: ToField;
private constructor();
static reified >(P: P): ReserveReified>;
static get r(): typeof Reserve.reified;
static phantom>(P: P): PhantomReified>>>;
static get p(): typeof Reserve.phantom;
private static instantiateBcs;
private static cachedBcs;
static get bcs(): ReturnType;
static fromFields>(typeArg: P, fields: Record): Reserve>;
static fromFieldsWithTypes>(typeArg: P, item: FieldsWithTypes): Reserve>;
static fromBcs>(typeArg: P, data: Uint8Array): Reserve>;
toJSONField(): ReserveJSONField;
toJSON(): ReserveJSON ;
static fromJSONField >(typeArg: P, field: any): Reserve>;
static fromJSON>(typeArg: P, json: Record): Reserve>;
static fromCoreObject>(typeArg: P, obj: SuiClientTypes.Object<{
content: true;
}>): Reserve>;
static fetch>(client: ClientWithCoreApi, typeArg: P, id: string): Promise>>;
}
export declare function isCToken(type: string): boolean;
export interface CTokenFields {
dummyField: ToField<'bool'>;
}
export type CTokenReified = Reified, CTokenFields>;
export type CTokenJSONField = {
dummyField: boolean;
};
export type CTokenJSON = {
$typeName: typeof CToken.$typeName;
$typeArgs: [PhantomToTypeStr , PhantomToTypeStr];
} & CTokenJSONField;
/**
* Interest bearing token on the underlying Coin. The ctoken can be redeemed for
* the underlying token + any interest earned.
*/
export declare class CToken implements StructClass {
__StructClass: true;
static get $typeName(): `${string}::reserve::CToken`;
static readonly $numTypeParams = 2;
static readonly $isPhantom: readonly [true, true];
readonly $typeName: typeof CToken.$typeName;
readonly $fullTypeName: `${string}::reserve::CToken<${PhantomToTypeStr }, ${PhantomToTypeStr}>`;
readonly $typeArgs: [PhantomToTypeStr, PhantomToTypeStr];
readonly $isPhantom: typeof CToken.$isPhantom;
readonly dummyField: ToField<'bool'>;
private constructor();
static reified, T extends PhantomReified>(P: P, T: T): CTokenReified, ToPhantomTypeArgument>;
static get r(): typeof CToken.reified;
static phantom, T extends PhantomReified>(P: P, T: T): PhantomReified, ToPhantomTypeArgument>>>;
static get p(): typeof CToken.phantom;
private static instantiateBcs;
private static cachedBcs;
static get bcs(): ReturnType;
static fromFields, T extends PhantomReified>(typeArgs: [P, T], fields: Record): CToken, ToPhantomTypeArgument>;
static fromFieldsWithTypes, T extends PhantomReified>(typeArgs: [P, T], item: FieldsWithTypes): CToken, ToPhantomTypeArgument>;
static fromBcs, T extends PhantomReified>(typeArgs: [P, T], data: Uint8Array): CToken, ToPhantomTypeArgument>;
toJSONField(): CTokenJSONField;
toJSON(): CTokenJSON ;
static fromJSONField , T extends PhantomReified>(typeArgs: [P, T], field: any): CToken, ToPhantomTypeArgument>;
static fromJSON, T extends PhantomReified>(typeArgs: [P, T], json: Record): CToken, ToPhantomTypeArgument>;
static fromCoreObject, T extends PhantomReified>(typeArgs: [P, T], obj: SuiClientTypes.Object<{
content: true;
}>): CToken, ToPhantomTypeArgument>;
static fetch, T extends PhantomReified>(client: ClientWithCoreApi, typeArgs: [P, T], id: string): Promise, ToPhantomTypeArgument>>;
}
export declare function isLiquidityRequest(type: string): boolean;
export interface LiquidityRequestFields {
amount: ToField<'u64'>;
fee: ToField<'u64'>;
}
export type LiquidityRequestReified = Reified, LiquidityRequestFields>;
export type LiquidityRequestJSONField = {
amount: string;
fee: string;
};
export type LiquidityRequestJSON = {
$typeName: typeof LiquidityRequest.$typeName;
$typeArgs: [PhantomToTypeStr , PhantomToTypeStr];
} & LiquidityRequestJSONField;
/** A request to withdraw liquidity from the reserve. This is a hot potato object. */
export declare class LiquidityRequest implements StructClass {
__StructClass: true;
static get $typeName(): `${string}::reserve::LiquidityRequest`;
static readonly $numTypeParams = 2;
static readonly $isPhantom: readonly [true, true];
readonly $typeName: typeof LiquidityRequest.$typeName;
readonly $fullTypeName: `${string}::reserve::LiquidityRequest<${PhantomToTypeStr }, ${PhantomToTypeStr}>`;
readonly $typeArgs: [PhantomToTypeStr, PhantomToTypeStr];
readonly $isPhantom: typeof LiquidityRequest.$isPhantom;
readonly amount: ToField<'u64'>;
readonly fee: ToField<'u64'>;
private constructor();
static reified, T extends PhantomReified>(P: P, T: T): LiquidityRequestReified, ToPhantomTypeArgument>;
static get r(): typeof LiquidityRequest.reified;
static phantom, T extends PhantomReified>(P: P, T: T): PhantomReified, ToPhantomTypeArgument>>>;
static get p(): typeof LiquidityRequest.phantom;
private static instantiateBcs;
private static cachedBcs;
static get bcs(): ReturnType;
static fromFields, T extends PhantomReified>(typeArgs: [P, T], fields: Record): LiquidityRequest, ToPhantomTypeArgument>;
static fromFieldsWithTypes, T extends PhantomReified>(typeArgs: [P, T], item: FieldsWithTypes): LiquidityRequest, ToPhantomTypeArgument>;
static fromBcs, T extends PhantomReified>(typeArgs: [P, T], data: Uint8Array): LiquidityRequest, ToPhantomTypeArgument>;
toJSONField(): LiquidityRequestJSONField;
toJSON(): LiquidityRequestJSON ;
static fromJSONField , T extends PhantomReified>(typeArgs: [P, T], field: any): LiquidityRequest, ToPhantomTypeArgument>;
static fromJSON, T extends PhantomReified>(typeArgs: [P, T], json: Record): LiquidityRequest, ToPhantomTypeArgument>;
static fromCoreObject, T extends PhantomReified>(typeArgs: [P, T], obj: SuiClientTypes.Object<{
content: true;
}>): LiquidityRequest, ToPhantomTypeArgument>;
static fetch, T extends PhantomReified>(client: ClientWithCoreApi, typeArgs: [P, T], id: string): Promise, ToPhantomTypeArgument>>;
}
export declare function isBalanceKey(type: string): boolean;
export interface BalanceKeyFields {
dummyField: ToField<'bool'>;
}
export type BalanceKeyReified = Reified;
export type BalanceKeyJSONField = {
dummyField: boolean;
};
export type BalanceKeyJSON = {
$typeName: typeof BalanceKey.$typeName;
$typeArgs: [];
} & BalanceKeyJSONField;
export declare class BalanceKey implements StructClass {
__StructClass: true;
static get $typeName(): `${string}::reserve::BalanceKey`;
static readonly $numTypeParams = 0;
static readonly $isPhantom: readonly [];
readonly $typeName: typeof BalanceKey.$typeName;
readonly $fullTypeName: `${string}::reserve::BalanceKey`;
readonly $typeArgs: [];
readonly $isPhantom: typeof BalanceKey.$isPhantom;
readonly dummyField: ToField<'bool'>;
private constructor();
static reified(): BalanceKeyReified;
static get r(): BalanceKeyReified;
static phantom(): PhantomReified>;
static get p(): PhantomReified>;
private static instantiateBcs;
private static cachedBcs;
static get bcs(): ReturnType;
static fromFields(fields: Record): BalanceKey;
static fromFieldsWithTypes(item: FieldsWithTypes): BalanceKey;
static fromBcs(data: Uint8Array): BalanceKey;
toJSONField(): BalanceKeyJSONField;
toJSON(): BalanceKeyJSON;
static fromJSONField(field: any): BalanceKey;
static fromJSON(json: Record): BalanceKey;
static fromCoreObject(obj: SuiClientTypes.Object<{
content: true;
}>): BalanceKey;
static fetch(client: ClientWithCoreApi, id: string): Promise;
}
export declare function isStakerKey(type: string): boolean;
export interface StakerKeyFields {
dummyField: ToField<'bool'>;
}
export type StakerKeyReified = Reified;
export type StakerKeyJSONField = {
dummyField: boolean;
};
export type StakerKeyJSON = {
$typeName: typeof StakerKey.$typeName;
$typeArgs: [];
} & StakerKeyJSONField;
export declare class StakerKey implements StructClass {
__StructClass: true;
static get $typeName(): `${string}::reserve::StakerKey`;
static readonly $numTypeParams = 0;
static readonly $isPhantom: readonly [];
readonly $typeName: typeof StakerKey.$typeName;
readonly $fullTypeName: `${string}::reserve::StakerKey`;
readonly $typeArgs: [];
readonly $isPhantom: typeof StakerKey.$isPhantom;
readonly dummyField: ToField<'bool'>;
private constructor();
static reified(): StakerKeyReified;
static get r(): StakerKeyReified;
static phantom(): PhantomReified>;
static get p(): PhantomReified>;
private static instantiateBcs;
private static cachedBcs;
static get bcs(): ReturnType;
static fromFields(fields: Record): StakerKey;
static fromFieldsWithTypes(item: FieldsWithTypes): StakerKey;
static fromBcs(data: Uint8Array): StakerKey;
toJSONField(): StakerKeyJSONField;
toJSON(): StakerKeyJSON;
static fromJSONField(field: any): StakerKey;
static fromJSON(json: Record): StakerKey;
static fromCoreObject(obj: SuiClientTypes.Object<{
content: true;
}>): StakerKey;
static fetch(client: ClientWithCoreApi, id: string): Promise;
}
export declare function isReservePauseKey(type: string): boolean;
export interface ReservePauseKeyFields {
dummyField: ToField<'bool'>;
}
export type ReservePauseKeyReified = Reified;
export type ReservePauseKeyJSONField = {
dummyField: boolean;
};
export type ReservePauseKeyJSON = {
$typeName: typeof ReservePauseKey.$typeName;
$typeArgs: [];
} & ReservePauseKeyJSONField;
export declare class ReservePauseKey implements StructClass {
__StructClass: true;
static get $typeName(): `${string}::reserve::ReservePauseKey`;
static readonly $numTypeParams = 0;
static readonly $isPhantom: readonly [];
readonly $typeName: typeof ReservePauseKey.$typeName;
readonly $fullTypeName: `${string}::reserve::ReservePauseKey`;
readonly $typeArgs: [];
readonly $isPhantom: typeof ReservePauseKey.$isPhantom;
readonly dummyField: ToField<'bool'>;
private constructor();
static reified(): ReservePauseKeyReified;
static get r(): ReservePauseKeyReified;
static phantom(): PhantomReified>;
static get p(): PhantomReified>;
private static instantiateBcs;
private static cachedBcs;
static get bcs(): ReturnType;
static fromFields(fields: Record): ReservePauseKey;
static fromFieldsWithTypes(item: FieldsWithTypes): ReservePauseKey;
static fromBcs(data: Uint8Array): ReservePauseKey;
toJSONField(): ReservePauseKeyJSONField;
toJSON(): ReservePauseKeyJSON;
static fromJSONField(field: any): ReservePauseKey;
static fromJSON(json: Record): ReservePauseKey;
static fromCoreObject(obj: SuiClientTypes.Object<{
content: true;
}>): ReservePauseKey;
static fetch(client: ClientWithCoreApi, id: string): Promise;
}
export declare function isPriceGuardKey(type: string): boolean;
export interface PriceGuardKeyFields {
dummyField: ToField<'bool'>;
}
export type PriceGuardKeyReified = Reified;
export type PriceGuardKeyJSONField = {
dummyField: boolean;
};
export type PriceGuardKeyJSON = {
$typeName: typeof PriceGuardKey.$typeName;
$typeArgs: [];
} & PriceGuardKeyJSONField;
export declare class PriceGuardKey implements StructClass {
__StructClass: true;
static get $typeName(): `${string}::reserve::PriceGuardKey`;
static readonly $numTypeParams = 0;
static readonly $isPhantom: readonly [];
readonly $typeName: typeof PriceGuardKey.$typeName;
readonly $fullTypeName: `${string}::reserve::PriceGuardKey`;
readonly $typeArgs: [];
readonly $isPhantom: typeof PriceGuardKey.$isPhantom;
readonly dummyField: ToField<'bool'>;
private constructor();
static reified(): PriceGuardKeyReified;
static get r(): PriceGuardKeyReified;
static phantom(): PhantomReified>;
static get p(): PhantomReified>;
private static instantiateBcs;
private static cachedBcs;
static get bcs(): ReturnType;
static fromFields(fields: Record): PriceGuardKey;
static fromFieldsWithTypes(item: FieldsWithTypes): PriceGuardKey;
static fromBcs(data: Uint8Array): PriceGuardKey;
toJSONField(): PriceGuardKeyJSONField;
toJSON(): PriceGuardKeyJSON;
static fromJSONField(field: any): PriceGuardKey;
static fromJSON(json: Record): PriceGuardKey;
static fromCoreObject(obj: SuiClientTypes.Object<{
content: true;
}>): PriceGuardKey;
static fetch(client: ClientWithCoreApi, id: string): Promise;
}
export declare function isConfidenceKey(type: string): boolean;
export interface ConfidenceKeyFields {
dummyField: ToField<'bool'>;
}
export type ConfidenceKeyReified = Reified;
export type ConfidenceKeyJSONField = {
dummyField: boolean;
};
export type ConfidenceKeyJSON = {
$typeName: typeof ConfidenceKey.$typeName;
$typeArgs: [];
} & ConfidenceKeyJSONField;
export declare class ConfidenceKey implements StructClass {
__StructClass: true;
static get $typeName(): `${string}::reserve::ConfidenceKey`;
static readonly $numTypeParams = 0;
static readonly $isPhantom: readonly [];
readonly $typeName: typeof ConfidenceKey.$typeName;
readonly $fullTypeName: `${string}::reserve::ConfidenceKey`;
readonly $typeArgs: [];
readonly $isPhantom: typeof ConfidenceKey.$isPhantom;
readonly dummyField: ToField<'bool'>;
private constructor();
static reified(): ConfidenceKeyReified;
static get r(): ConfidenceKeyReified;
static phantom(): PhantomReified>;
static get p(): PhantomReified>;
private static instantiateBcs;
private static cachedBcs;
static get bcs(): ReturnType;
static fromFields(fields: Record): ConfidenceKey;
static fromFieldsWithTypes(item: FieldsWithTypes): ConfidenceKey;
static fromBcs(data: Uint8Array): ConfidenceKey;
toJSONField(): ConfidenceKeyJSONField;
toJSON(): ConfidenceKeyJSON;
static fromJSONField(field: any): ConfidenceKey;
static fromJSON(json: Record): ConfidenceKey;
static fromCoreObject(obj: SuiClientTypes.Object<{
content: true;
}>): ConfidenceKey;
static fetch(client: ClientWithCoreApi, id: string): Promise;
}
export declare function isPriceGuard(type: string): boolean;
export interface PriceGuardFields {
maxPriceChangeBps: ToField<'u64'>;
minUpdateIntervalS: ToField<'u64'>;
priceAnchor: ToField;
smoothedPriceAnchor: ToField;
anchorTimestampS: ToField<'u64'>;
}
export type PriceGuardReified = Reified;
export type PriceGuardJSONField = {
maxPriceChangeBps: string;
minUpdateIntervalS: string;
priceAnchor: ToJSON;
smoothedPriceAnchor: ToJSON;
anchorTimestampS: string;
};
export type PriceGuardJSON = {
$typeName: typeof PriceGuard.$typeName;
$typeArgs: [];
} & PriceGuardJSONField;
/**
* Bounds how far `price` and `smoothed_price` may move per
* `min_update_interval_s`. Each anchor moves at most one band per interval and is
* advanced to the clamped value, so repeating a refresh inside one PTB cannot walk
* either price further than a single band.
*/
export declare class PriceGuard implements StructClass {
__StructClass: true;
static get $typeName(): `${string}::reserve::PriceGuard`;
static readonly $numTypeParams = 0;
static readonly $isPhantom: readonly [];
readonly $typeName: typeof PriceGuard.$typeName;
readonly $fullTypeName: `${string}::reserve::PriceGuard`;
readonly $typeArgs: [];
readonly $isPhantom: typeof PriceGuard.$isPhantom;
readonly maxPriceChangeBps: ToField<'u64'>;
readonly minUpdateIntervalS: ToField<'u64'>;
readonly priceAnchor: ToField;
readonly smoothedPriceAnchor: ToField;
readonly anchorTimestampS: ToField<'u64'>;
private constructor();
static reified(): PriceGuardReified;
static get r(): PriceGuardReified;
static phantom(): PhantomReified>;
static get p(): PhantomReified>;
private static instantiateBcs;
private static cachedBcs;
static get bcs(): ReturnType;
static fromFields(fields: Record): PriceGuard;
static fromFieldsWithTypes(item: FieldsWithTypes): PriceGuard;
static fromBcs(data: Uint8Array): PriceGuard;
toJSONField(): PriceGuardJSONField;
toJSON(): PriceGuardJSON;
static fromJSONField(field: any): PriceGuard;
static fromJSON(json: Record): PriceGuard;
static fromCoreObject(obj: SuiClientTypes.Object<{
content: true;
}>): PriceGuard;
static fetch(client: ClientWithCoreApi, id: string): Promise;
}
export declare function isBalances(type: string): boolean;
export interface BalancesFields {
availableAmount: ToField>;
ctokenSupply: ToField>>>;
fees: ToField>;
ctokenFees: ToField>>>;
depositedCtokens: ToField>>>;
}
export type BalancesReified = Reified, BalancesFields>;
export type BalancesJSONField = {
availableAmount: ToJSON>;
ctokenSupply: ToJSON>>>;
fees: ToJSON>;
ctokenFees: ToJSON>>>;
depositedCtokens: ToJSON>>>;
};
export type BalancesJSON = {
$typeName: typeof Balances.$typeName;
$typeArgs: [PhantomToTypeStr , PhantomToTypeStr];
} & BalancesJSONField;
/** Balances are stored in a dynamic field to avoid typing the Reserve with CoinType */
export declare class Balances implements StructClass {
__StructClass: true;
static get $typeName(): `${string}::reserve::Balances`;
static readonly $numTypeParams = 2;
static readonly $isPhantom: readonly [true, true];
readonly $typeName: typeof Balances.$typeName;
readonly $fullTypeName: `${string}::reserve::Balances<${PhantomToTypeStr }, ${PhantomToTypeStr}>`;
readonly $typeArgs: [PhantomToTypeStr, PhantomToTypeStr];
readonly $isPhantom: typeof Balances.$isPhantom;
readonly availableAmount: ToField>;
readonly ctokenSupply: ToField>>>;
readonly fees: ToField>;
readonly ctokenFees: ToField>>>;
readonly depositedCtokens: ToField>>>;
private constructor();
static reified, T extends PhantomReified>(P: P, T: T): BalancesReified, ToPhantomTypeArgument>;
static get r(): typeof Balances.reified;
static phantom, T extends PhantomReified>(P: P, T: T): PhantomReified, ToPhantomTypeArgument>>>;
static get p(): typeof Balances.phantom;
private static instantiateBcs;
private static cachedBcs;
static get bcs(): ReturnType;
static fromFields, T extends PhantomReified>(typeArgs: [P, T], fields: Record): Balances, ToPhantomTypeArgument>;
static fromFieldsWithTypes, T extends PhantomReified>(typeArgs: [P, T], item: FieldsWithTypes): Balances, ToPhantomTypeArgument>;
static fromBcs, T extends PhantomReified>(typeArgs: [P, T], data: Uint8Array): Balances, ToPhantomTypeArgument>;
toJSONField(): BalancesJSONField | | |