@kamino-finance/klend-sdk 2.10.21 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classes/action.d.ts +1 -0
- package/dist/classes/action.js +55 -38
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/obligation.js +21 -0
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/reserve.d.ts +30 -0
- package/dist/classes/reserve.js +66 -6
- package/dist/classes/reserve.js.map +1 -1
- package/dist/idl.json +156 -72
- package/dist/idl_codegen/accounts/LendingMarket.d.ts +3 -3
- package/dist/idl_codegen/accounts/LendingMarket.js +7 -1
- package/dist/idl_codegen/accounts/LendingMarket.js.map +1 -1
- package/dist/idl_codegen/accounts/Obligation.d.ts +6 -3
- package/dist/idl_codegen/accounts/Obligation.js +12 -6
- package/dist/idl_codegen/accounts/Obligation.js.map +1 -1
- package/dist/idl_codegen/accounts/Reserve.d.ts +18 -0
- package/dist/idl_codegen/accounts/Reserve.js +14 -2
- package/dist/idl_codegen/accounts/Reserve.js.map +1 -1
- package/dist/idl_codegen/errors/custom.d.ts +76 -4
- package/dist/idl_codegen/errors/custom.js +126 -8
- package/dist/idl_codegen/errors/custom.js.map +1 -1
- package/dist/idl_codegen/instructions/index.d.ts +2 -4
- package/dist/idl_codegen/instructions/index.js +3 -5
- package/dist/idl_codegen/instructions/index.js.map +1 -1
- package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.d.ts +1 -1
- package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.js +2 -2
- package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.js.map +1 -1
- package/dist/idl_codegen/instructions/updateReserveConfig.d.ts +2 -1
- package/dist/idl_codegen/instructions/updateReserveConfig.js +4 -2
- package/dist/idl_codegen/instructions/updateReserveConfig.js.map +1 -1
- package/dist/idl_codegen/instructions/withdrawObligationCollateral.js +1 -1
- package/dist/idl_codegen/instructions/withdrawObligationCollateral.js.map +1 -1
- package/dist/idl_codegen/types/ElevationGroup.d.ts +24 -10
- package/dist/idl_codegen/types/ElevationGroup.js +25 -12
- package/dist/idl_codegen/types/ElevationGroup.js.map +1 -1
- package/dist/idl_codegen/types/ObligationCollateral.d.ts +23 -0
- package/dist/idl_codegen/types/ObligationCollateral.js +8 -1
- package/dist/idl_codegen/types/ObligationCollateral.js.map +1 -1
- package/dist/idl_codegen/types/ObligationLiquidity.d.ts +8 -0
- package/dist/idl_codegen/types/ObligationLiquidity.js +8 -1
- package/dist/idl_codegen/types/ObligationLiquidity.js.map +1 -1
- package/dist/idl_codegen/types/ReserveConfig.d.ts +55 -9
- package/dist/idl_codegen/types/ReserveConfig.js +20 -6
- package/dist/idl_codegen/types/ReserveConfig.js.map +1 -1
- package/dist/idl_codegen/types/UpdateConfigMode.d.ts +39 -0
- package/dist/idl_codegen/types/UpdateConfigMode.js +79 -1
- package/dist/idl_codegen/types/UpdateConfigMode.js.map +1 -1
- package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.d.ts +4 -2
- package/dist/idl_codegen/types/UpdateLendingMarketMode.d.ts +13 -0
- package/dist/idl_codegen/types/UpdateLendingMarketMode.js +27 -1
- package/dist/idl_codegen/types/UpdateLendingMarketMode.js.map +1 -1
- package/dist/idl_codegen/types/index.d.ts +4 -4
- package/dist/idl_codegen/types/index.js.map +1 -1
- package/dist/idl_codegen/zero_padding/ObligationZP.d.ts +3 -2
- package/dist/idl_codegen/zero_padding/ObligationZP.js +8 -3
- package/dist/idl_codegen/zero_padding/ObligationZP.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdrawObligationCollateral.js","sourceRoot":"","sources":["../../../src/idl_codegen/instructions/withdrawObligationCollateral.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,4CAAyC;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AC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAClE,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC;AA3CD,oEA2CC","sourcesContent":["import { TransactionInstruction, PublicKey, AccountMeta } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport { PROGRAM_ID } from \"../programId\"\n\nexport interface WithdrawObligationCollateralArgs {\n collateralAmount: BN\n}\n\nexport interface WithdrawObligationCollateralAccounts {\n owner: PublicKey\n obligation: PublicKey\n lendingMarket: PublicKey\n lendingMarketAuthority: PublicKey\n withdrawReserve: PublicKey\n reserveSourceCollateral: PublicKey\n userDestinationCollateral: PublicKey\n tokenProgram: PublicKey\n instructionSysvarAccount: PublicKey\n}\n\nexport const layout = borsh.struct([borsh.u64(\"collateralAmount\")])\n\nexport function withdrawObligationCollateral(\n args: WithdrawObligationCollateralArgs,\n accounts: WithdrawObligationCollateralAccounts,\n programId: PublicKey = PROGRAM_ID\n) {\n const keys: Array<AccountMeta> = [\n { pubkey: accounts.owner, isSigner: true, isWritable: false },\n { pubkey: accounts.obligation, isSigner: false, isWritable: true },\n { pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },\n {\n pubkey: accounts.lendingMarketAuthority,\n isSigner: false,\n isWritable: false,\n },\n { pubkey: accounts.withdrawReserve, isSigner: false, isWritable: true },\n {\n pubkey: accounts.reserveSourceCollateral,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: accounts.userDestinationCollateral,\n isSigner: false,\n isWritable: true,\n },\n { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },\n {\n pubkey: accounts.instructionSysvarAccount,\n isSigner: false,\n isWritable: false,\n },\n ]\n const identifier = Buffer.from([37, 116, 205, 103, 243, 192, 92, 198])\n const buffer = Buffer.alloc(1000)\n const len = layout.encode(\n {\n collateralAmount: args.collateralAmount,\n },\n buffer\n )\n const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)\n const ix = new TransactionInstruction({ keys, programId, data })\n return ix\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
|
1
2
|
import BN from "bn.js";
|
|
2
3
|
import * as types from "../types";
|
|
3
4
|
export interface ElevationGroupFields {
|
|
@@ -6,8 +7,11 @@ export interface ElevationGroupFields {
|
|
|
6
7
|
ltvPct: number;
|
|
7
8
|
liquidationThresholdPct: number;
|
|
8
9
|
allowNewLoans: number;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
maxReservesAsCollateral: number;
|
|
11
|
+
padding0: number;
|
|
12
|
+
/** Mandatory debt reserve for this elevation group */
|
|
13
|
+
debtReserve: PublicKey;
|
|
14
|
+
padding1: Array<BN>;
|
|
11
15
|
}
|
|
12
16
|
export interface ElevationGroupJSON {
|
|
13
17
|
maxLiquidationBonusBps: number;
|
|
@@ -15,8 +19,11 @@ export interface ElevationGroupJSON {
|
|
|
15
19
|
ltvPct: number;
|
|
16
20
|
liquidationThresholdPct: number;
|
|
17
21
|
allowNewLoans: number;
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
maxReservesAsCollateral: number;
|
|
23
|
+
padding0: number;
|
|
24
|
+
/** Mandatory debt reserve for this elevation group */
|
|
25
|
+
debtReserve: string;
|
|
26
|
+
padding1: Array<string>;
|
|
20
27
|
}
|
|
21
28
|
export declare class ElevationGroup {
|
|
22
29
|
readonly maxLiquidationBonusBps: number;
|
|
@@ -24,8 +31,11 @@ export declare class ElevationGroup {
|
|
|
24
31
|
readonly ltvPct: number;
|
|
25
32
|
readonly liquidationThresholdPct: number;
|
|
26
33
|
readonly allowNewLoans: number;
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
34
|
+
readonly maxReservesAsCollateral: number;
|
|
35
|
+
readonly padding0: number;
|
|
36
|
+
/** Mandatory debt reserve for this elevation group */
|
|
37
|
+
readonly debtReserve: PublicKey;
|
|
38
|
+
readonly padding1: Array<BN>;
|
|
29
39
|
constructor(fields: ElevationGroupFields);
|
|
30
40
|
static layout(property?: string): any;
|
|
31
41
|
static fromDecoded(obj: any): types.ElevationGroup;
|
|
@@ -35,8 +45,10 @@ export declare class ElevationGroup {
|
|
|
35
45
|
ltvPct: number;
|
|
36
46
|
liquidationThresholdPct: number;
|
|
37
47
|
allowNewLoans: number;
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
maxReservesAsCollateral: number;
|
|
49
|
+
padding0: number;
|
|
50
|
+
debtReserve: PublicKey;
|
|
51
|
+
padding1: BN[];
|
|
40
52
|
};
|
|
41
53
|
toJSON(): ElevationGroupJSON;
|
|
42
54
|
static fromJSON(obj: ElevationGroupJSON): ElevationGroup;
|
|
@@ -46,7 +58,9 @@ export declare class ElevationGroup {
|
|
|
46
58
|
ltvPct: number;
|
|
47
59
|
liquidationThresholdPct: number;
|
|
48
60
|
allowNewLoans: number;
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
maxReservesAsCollateral: number;
|
|
62
|
+
padding0: number;
|
|
63
|
+
debtReserve: PublicKey;
|
|
64
|
+
padding1: BN[];
|
|
51
65
|
};
|
|
52
66
|
}
|
|
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.ElevationGroup = void 0;
|
|
30
|
+
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
30
31
|
const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
31
32
|
const borsh = __importStar(require("@coral-xyz/borsh"));
|
|
32
33
|
class ElevationGroup {
|
|
@@ -36,8 +37,10 @@ class ElevationGroup {
|
|
|
36
37
|
this.ltvPct = fields.ltvPct;
|
|
37
38
|
this.liquidationThresholdPct = fields.liquidationThresholdPct;
|
|
38
39
|
this.allowNewLoans = fields.allowNewLoans;
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
40
|
+
this.maxReservesAsCollateral = fields.maxReservesAsCollateral;
|
|
41
|
+
this.padding0 = fields.padding0;
|
|
42
|
+
this.debtReserve = fields.debtReserve;
|
|
43
|
+
this.padding1 = fields.padding1;
|
|
41
44
|
}
|
|
42
45
|
static layout(property) {
|
|
43
46
|
return borsh.struct([
|
|
@@ -46,8 +49,10 @@ class ElevationGroup {
|
|
|
46
49
|
borsh.u8("ltvPct"),
|
|
47
50
|
borsh.u8("liquidationThresholdPct"),
|
|
48
51
|
borsh.u8("allowNewLoans"),
|
|
49
|
-
borsh.
|
|
50
|
-
borsh.
|
|
52
|
+
borsh.u8("maxReservesAsCollateral"),
|
|
53
|
+
borsh.u8("padding0"),
|
|
54
|
+
borsh.publicKey("debtReserve"),
|
|
55
|
+
borsh.array(borsh.u64(), 4, "padding1"),
|
|
51
56
|
], property);
|
|
52
57
|
}
|
|
53
58
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -58,8 +63,10 @@ class ElevationGroup {
|
|
|
58
63
|
ltvPct: obj.ltvPct,
|
|
59
64
|
liquidationThresholdPct: obj.liquidationThresholdPct,
|
|
60
65
|
allowNewLoans: obj.allowNewLoans,
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
maxReservesAsCollateral: obj.maxReservesAsCollateral,
|
|
67
|
+
padding0: obj.padding0,
|
|
68
|
+
debtReserve: obj.debtReserve,
|
|
69
|
+
padding1: obj.padding1,
|
|
63
70
|
});
|
|
64
71
|
}
|
|
65
72
|
static toEncodable(fields) {
|
|
@@ -69,8 +76,10 @@ class ElevationGroup {
|
|
|
69
76
|
ltvPct: fields.ltvPct,
|
|
70
77
|
liquidationThresholdPct: fields.liquidationThresholdPct,
|
|
71
78
|
allowNewLoans: fields.allowNewLoans,
|
|
72
|
-
|
|
73
|
-
|
|
79
|
+
maxReservesAsCollateral: fields.maxReservesAsCollateral,
|
|
80
|
+
padding0: fields.padding0,
|
|
81
|
+
debtReserve: fields.debtReserve,
|
|
82
|
+
padding1: fields.padding1,
|
|
74
83
|
};
|
|
75
84
|
}
|
|
76
85
|
toJSON() {
|
|
@@ -80,8 +89,10 @@ class ElevationGroup {
|
|
|
80
89
|
ltvPct: this.ltvPct,
|
|
81
90
|
liquidationThresholdPct: this.liquidationThresholdPct,
|
|
82
91
|
allowNewLoans: this.allowNewLoans,
|
|
83
|
-
|
|
84
|
-
|
|
92
|
+
maxReservesAsCollateral: this.maxReservesAsCollateral,
|
|
93
|
+
padding0: this.padding0,
|
|
94
|
+
debtReserve: this.debtReserve.toString(),
|
|
95
|
+
padding1: this.padding1.map((item) => item.toString()),
|
|
85
96
|
};
|
|
86
97
|
}
|
|
87
98
|
static fromJSON(obj) {
|
|
@@ -91,8 +102,10 @@ class ElevationGroup {
|
|
|
91
102
|
ltvPct: obj.ltvPct,
|
|
92
103
|
liquidationThresholdPct: obj.liquidationThresholdPct,
|
|
93
104
|
allowNewLoans: obj.allowNewLoans,
|
|
94
|
-
|
|
95
|
-
|
|
105
|
+
maxReservesAsCollateral: obj.maxReservesAsCollateral,
|
|
106
|
+
padding0: obj.padding0,
|
|
107
|
+
debtReserve: new web3_js_1.PublicKey(obj.debtReserve),
|
|
108
|
+
padding1: obj.padding1.map((item) => new bn_js_1.default(item)),
|
|
96
109
|
});
|
|
97
110
|
}
|
|
98
111
|
toEncodable() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElevationGroup.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/ElevationGroup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Elev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AAI,CAAC,WAAW,CAAC,QAAQ,EAAE;YACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;SACvD,CAAA;IACH,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAuB;QACrC,OAAO,IAAI,cAAc,CAAC;YACxB,sBAAsB,EAAE,GAAG,CAAC,sBAAsB;YAClD,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,uBAAuB,EAAE,GAAG,CAAC,uBAAuB;YACpD,aAAa,EAAE,GAAG,CAAC,aAAa;YAChC,uBAAuB,EAAE,GAAG,CAAC,uBAAuB;YACpD,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,WAAW,EAAE,IAAI,mBAAS,CAAC,GAAG,CAAC,WAAW,CAAC;YAC3C,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,eAAE,CAAC,IAAI,CAAC,CAAC;SACnD,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACzC,CAAC;CACF;AArGD,wCAqGC","sourcesContent":["import { PublicKey } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\"\n\nexport interface ElevationGroupFields {\n maxLiquidationBonusBps: number\n id: number\n ltvPct: number\n liquidationThresholdPct: number\n allowNewLoans: number\n maxReservesAsCollateral: number\n padding0: number\n /** Mandatory debt reserve for this elevation group */\n debtReserve: PublicKey\n padding1: Array<BN>\n}\n\nexport interface ElevationGroupJSON {\n maxLiquidationBonusBps: number\n id: number\n ltvPct: number\n liquidationThresholdPct: number\n allowNewLoans: number\n maxReservesAsCollateral: number\n padding0: number\n /** Mandatory debt reserve for this elevation group */\n debtReserve: string\n padding1: Array<string>\n}\n\nexport class ElevationGroup {\n readonly maxLiquidationBonusBps: number\n readonly id: number\n readonly ltvPct: number\n readonly liquidationThresholdPct: number\n readonly allowNewLoans: number\n readonly maxReservesAsCollateral: number\n readonly padding0: number\n /** Mandatory debt reserve for this elevation group */\n readonly debtReserve: PublicKey\n readonly padding1: Array<BN>\n\n constructor(fields: ElevationGroupFields) {\n this.maxLiquidationBonusBps = fields.maxLiquidationBonusBps\n this.id = fields.id\n this.ltvPct = fields.ltvPct\n this.liquidationThresholdPct = fields.liquidationThresholdPct\n this.allowNewLoans = fields.allowNewLoans\n this.maxReservesAsCollateral = fields.maxReservesAsCollateral\n this.padding0 = fields.padding0\n this.debtReserve = fields.debtReserve\n this.padding1 = fields.padding1\n }\n\n static layout(property?: string) {\n return borsh.struct(\n [\n borsh.u16(\"maxLiquidationBonusBps\"),\n borsh.u8(\"id\"),\n borsh.u8(\"ltvPct\"),\n borsh.u8(\"liquidationThresholdPct\"),\n borsh.u8(\"allowNewLoans\"),\n borsh.u8(\"maxReservesAsCollateral\"),\n borsh.u8(\"padding0\"),\n borsh.publicKey(\"debtReserve\"),\n borsh.array(borsh.u64(), 4, \"padding1\"),\n ],\n property\n )\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static fromDecoded(obj: any) {\n return new ElevationGroup({\n maxLiquidationBonusBps: obj.maxLiquidationBonusBps,\n id: obj.id,\n ltvPct: obj.ltvPct,\n liquidationThresholdPct: obj.liquidationThresholdPct,\n allowNewLoans: obj.allowNewLoans,\n maxReservesAsCollateral: obj.maxReservesAsCollateral,\n padding0: obj.padding0,\n debtReserve: obj.debtReserve,\n padding1: obj.padding1,\n })\n }\n\n static toEncodable(fields: ElevationGroupFields) {\n return {\n maxLiquidationBonusBps: fields.maxLiquidationBonusBps,\n id: fields.id,\n ltvPct: fields.ltvPct,\n liquidationThresholdPct: fields.liquidationThresholdPct,\n allowNewLoans: fields.allowNewLoans,\n maxReservesAsCollateral: fields.maxReservesAsCollateral,\n padding0: fields.padding0,\n debtReserve: fields.debtReserve,\n padding1: fields.padding1,\n }\n }\n\n toJSON(): ElevationGroupJSON {\n return {\n maxLiquidationBonusBps: this.maxLiquidationBonusBps,\n id: this.id,\n ltvPct: this.ltvPct,\n liquidationThresholdPct: this.liquidationThresholdPct,\n allowNewLoans: this.allowNewLoans,\n maxReservesAsCollateral: this.maxReservesAsCollateral,\n padding0: this.padding0,\n debtReserve: this.debtReserve.toString(),\n padding1: this.padding1.map((item) => item.toString()),\n }\n }\n\n static fromJSON(obj: ElevationGroupJSON): ElevationGroup {\n return new ElevationGroup({\n maxLiquidationBonusBps: obj.maxLiquidationBonusBps,\n id: obj.id,\n ltvPct: obj.ltvPct,\n liquidationThresholdPct: obj.liquidationThresholdPct,\n allowNewLoans: obj.allowNewLoans,\n maxReservesAsCollateral: obj.maxReservesAsCollateral,\n padding0: obj.padding0,\n debtReserve: new PublicKey(obj.debtReserve),\n padding1: obj.padding1.map((item) => new BN(item)),\n })\n }\n\n toEncodable() {\n return ElevationGroup.toEncodable(this)\n }\n}\n"]}
|
|
@@ -8,6 +8,13 @@ export interface ObligationCollateralFields {
|
|
|
8
8
|
depositedAmount: BN;
|
|
9
9
|
/** Collateral market value in quote currency (scaled fraction) */
|
|
10
10
|
marketValueSf: BN;
|
|
11
|
+
/**
|
|
12
|
+
* Debt amount (lamport) taken against this collateral.
|
|
13
|
+
* (only meaningful if this obligation is part of an elevation group, otherwise 0)
|
|
14
|
+
* This is only indicative of the debt computed on the last refresh obligation.
|
|
15
|
+
* If the obligation have multiple collateral this value is the same for all of them.
|
|
16
|
+
*/
|
|
17
|
+
borrowedAmountAgainstThisCollateralInElevationGroup: BN;
|
|
11
18
|
padding: Array<BN>;
|
|
12
19
|
}
|
|
13
20
|
export interface ObligationCollateralJSON {
|
|
@@ -17,6 +24,13 @@ export interface ObligationCollateralJSON {
|
|
|
17
24
|
depositedAmount: string;
|
|
18
25
|
/** Collateral market value in quote currency (scaled fraction) */
|
|
19
26
|
marketValueSf: string;
|
|
27
|
+
/**
|
|
28
|
+
* Debt amount (lamport) taken against this collateral.
|
|
29
|
+
* (only meaningful if this obligation is part of an elevation group, otherwise 0)
|
|
30
|
+
* This is only indicative of the debt computed on the last refresh obligation.
|
|
31
|
+
* If the obligation have multiple collateral this value is the same for all of them.
|
|
32
|
+
*/
|
|
33
|
+
borrowedAmountAgainstThisCollateralInElevationGroup: string;
|
|
20
34
|
padding: Array<string>;
|
|
21
35
|
}
|
|
22
36
|
/** Obligation collateral state */
|
|
@@ -27,6 +41,13 @@ export declare class ObligationCollateral {
|
|
|
27
41
|
readonly depositedAmount: BN;
|
|
28
42
|
/** Collateral market value in quote currency (scaled fraction) */
|
|
29
43
|
readonly marketValueSf: BN;
|
|
44
|
+
/**
|
|
45
|
+
* Debt amount (lamport) taken against this collateral.
|
|
46
|
+
* (only meaningful if this obligation is part of an elevation group, otherwise 0)
|
|
47
|
+
* This is only indicative of the debt computed on the last refresh obligation.
|
|
48
|
+
* If the obligation have multiple collateral this value is the same for all of them.
|
|
49
|
+
*/
|
|
50
|
+
readonly borrowedAmountAgainstThisCollateralInElevationGroup: BN;
|
|
30
51
|
readonly padding: Array<BN>;
|
|
31
52
|
constructor(fields: ObligationCollateralFields);
|
|
32
53
|
static layout(property?: string): any;
|
|
@@ -35,6 +56,7 @@ export declare class ObligationCollateral {
|
|
|
35
56
|
depositReserve: PublicKey;
|
|
36
57
|
depositedAmount: BN;
|
|
37
58
|
marketValueSf: BN;
|
|
59
|
+
borrowedAmountAgainstThisCollateralInElevationGroup: BN;
|
|
38
60
|
padding: BN[];
|
|
39
61
|
};
|
|
40
62
|
toJSON(): ObligationCollateralJSON;
|
|
@@ -43,6 +65,7 @@ export declare class ObligationCollateral {
|
|
|
43
65
|
depositReserve: PublicKey;
|
|
44
66
|
depositedAmount: BN;
|
|
45
67
|
marketValueSf: BN;
|
|
68
|
+
borrowedAmountAgainstThisCollateralInElevationGroup: BN;
|
|
46
69
|
padding: BN[];
|
|
47
70
|
};
|
|
48
71
|
}
|
|
@@ -36,6 +36,8 @@ class ObligationCollateral {
|
|
|
36
36
|
this.depositReserve = fields.depositReserve;
|
|
37
37
|
this.depositedAmount = fields.depositedAmount;
|
|
38
38
|
this.marketValueSf = fields.marketValueSf;
|
|
39
|
+
this.borrowedAmountAgainstThisCollateralInElevationGroup =
|
|
40
|
+
fields.borrowedAmountAgainstThisCollateralInElevationGroup;
|
|
39
41
|
this.padding = fields.padding;
|
|
40
42
|
}
|
|
41
43
|
static layout(property) {
|
|
@@ -43,7 +45,8 @@ class ObligationCollateral {
|
|
|
43
45
|
borsh.publicKey("depositReserve"),
|
|
44
46
|
borsh.u64("depositedAmount"),
|
|
45
47
|
borsh.u128("marketValueSf"),
|
|
46
|
-
borsh.
|
|
48
|
+
borsh.u64("borrowedAmountAgainstThisCollateralInElevationGroup"),
|
|
49
|
+
borsh.array(borsh.u64(), 9, "padding"),
|
|
47
50
|
], property);
|
|
48
51
|
}
|
|
49
52
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -52,6 +55,7 @@ class ObligationCollateral {
|
|
|
52
55
|
depositReserve: obj.depositReserve,
|
|
53
56
|
depositedAmount: obj.depositedAmount,
|
|
54
57
|
marketValueSf: obj.marketValueSf,
|
|
58
|
+
borrowedAmountAgainstThisCollateralInElevationGroup: obj.borrowedAmountAgainstThisCollateralInElevationGroup,
|
|
55
59
|
padding: obj.padding,
|
|
56
60
|
});
|
|
57
61
|
}
|
|
@@ -60,6 +64,7 @@ class ObligationCollateral {
|
|
|
60
64
|
depositReserve: fields.depositReserve,
|
|
61
65
|
depositedAmount: fields.depositedAmount,
|
|
62
66
|
marketValueSf: fields.marketValueSf,
|
|
67
|
+
borrowedAmountAgainstThisCollateralInElevationGroup: fields.borrowedAmountAgainstThisCollateralInElevationGroup,
|
|
63
68
|
padding: fields.padding,
|
|
64
69
|
};
|
|
65
70
|
}
|
|
@@ -68,6 +73,7 @@ class ObligationCollateral {
|
|
|
68
73
|
depositReserve: this.depositReserve.toString(),
|
|
69
74
|
depositedAmount: this.depositedAmount.toString(),
|
|
70
75
|
marketValueSf: this.marketValueSf.toString(),
|
|
76
|
+
borrowedAmountAgainstThisCollateralInElevationGroup: this.borrowedAmountAgainstThisCollateralInElevationGroup.toString(),
|
|
71
77
|
padding: this.padding.map((item) => item.toString()),
|
|
72
78
|
};
|
|
73
79
|
}
|
|
@@ -76,6 +82,7 @@ class ObligationCollateral {
|
|
|
76
82
|
depositReserve: new web3_js_1.PublicKey(obj.depositReserve),
|
|
77
83
|
depositedAmount: new bn_js_1.default(obj.depositedAmount),
|
|
78
84
|
marketValueSf: new bn_js_1.default(obj.marketValueSf),
|
|
85
|
+
borrowedAmountAgainstThisCollateralInElevationGroup: new bn_js_1.default(obj.borrowedAmountAgainstThisCollateralInElevationGroup),
|
|
79
86
|
padding: obj.padding.map((item) => new bn_js_1.default(item)),
|
|
80
87
|
});
|
|
81
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObligationCollateral.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/ObligationCollateral.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2C,CAAC,wDAAwD;AACpG,kDAAsB,CAAC,wDAAwD;AAE/E,wDAAyC;
|
|
1
|
+
{"version":3,"file":"ObligationCollateral.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/ObligationCollateral.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2C,CAAC,wDAAwD;AACpG,kDAAsB,CAAC,wDAAwD;AAE/E,wDAAyC;AAoCzC,kCAAkC;AAClC,MAAa,oBAAoB;IAgB/B,YAAY,MAAkC;QAC5C,IAAI,CAAC,cAAc,GAAG,M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IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE;YAC9C,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;YAChD,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE;YAC5C,mDAAmD,EACjD,IAAI,CAAC,mDAAmD,CAAC,QAAQ,EAAE;YACrE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;SACrD,CAAA;IACH,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAA6B;QAC3C,OAAO,IAAI,oBAAoB,CAAC;YAC9B,cAAc,EAAE,IAAI,mBAAS,CAAC,GAAG,CAAC,cAAc,CAAC;YACjD,eAAe,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,eAAe,CAAC;YAC5C,aAAa,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,aAAa,CAAC;YACxC,mDAAmD,EAAE,IAAI,eAAE,CACzD,GAAG,CAAC,mDAAmD,CACxD;YACD,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,eAAE,CAAC,IAAI,CAAC,CAAC;SACjD,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,oBAAoB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAC/C,CAAC;CACF;AAvFD,oDAuFC","sourcesContent":["import { PublicKey } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\"\n\nexport interface ObligationCollateralFields {\n /** Reserve collateral is deposited to */\n depositReserve: PublicKey\n /** Amount of collateral deposited */\n depositedAmount: BN\n /** Collateral market value in quote currency (scaled fraction) */\n marketValueSf: BN\n /**\n * Debt amount (lamport) taken against this collateral.\n * (only meaningful if this obligation is part of an elevation group, otherwise 0)\n * This is only indicative of the debt computed on the last refresh obligation.\n * If the obligation have multiple collateral this value is the same for all of them.\n */\n borrowedAmountAgainstThisCollateralInElevationGroup: BN\n padding: Array<BN>\n}\n\nexport interface ObligationCollateralJSON {\n /** Reserve collateral is deposited to */\n depositReserve: string\n /** Amount of collateral deposited */\n depositedAmount: string\n /** Collateral market value in quote currency (scaled fraction) */\n marketValueSf: string\n /**\n * Debt amount (lamport) taken against this collateral.\n * (only meaningful if this obligation is part of an elevation group, otherwise 0)\n * This is only indicative of the debt computed on the last refresh obligation.\n * If the obligation have multiple collateral this value is the same for all of them.\n */\n borrowedAmountAgainstThisCollateralInElevationGroup: string\n padding: Array<string>\n}\n\n/** Obligation collateral state */\nexport class ObligationCollateral {\n /** Reserve collateral is deposited to */\n readonly depositReserve: PublicKey\n /** Amount of collateral deposited */\n readonly depositedAmount: BN\n /** Collateral market value in quote currency (scaled fraction) */\n readonly marketValueSf: BN\n /**\n * Debt amount (lamport) taken against this collateral.\n * (only meaningful if this obligation is part of an elevation group, otherwise 0)\n * This is only indicative of the debt computed on the last refresh obligation.\n * If the obligation have multiple collateral this value is the same for all of them.\n */\n readonly borrowedAmountAgainstThisCollateralInElevationGroup: BN\n readonly padding: Array<BN>\n\n constructor(fields: ObligationCollateralFields) {\n this.depositReserve = fields.depositReserve\n this.depositedAmount = fields.depositedAmount\n this.marketValueSf = fields.marketValueSf\n this.borrowedAmountAgainstThisCollateralInElevationGroup =\n fields.borrowedAmountAgainstThisCollateralInElevationGroup\n this.padding = fields.padding\n }\n\n static layout(property?: string) {\n return borsh.struct(\n [\n borsh.publicKey(\"depositReserve\"),\n borsh.u64(\"depositedAmount\"),\n borsh.u128(\"marketValueSf\"),\n borsh.u64(\"borrowedAmountAgainstThisCollateralInElevationGroup\"),\n borsh.array(borsh.u64(), 9, \"padding\"),\n ],\n property\n )\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static fromDecoded(obj: any) {\n return new ObligationCollateral({\n depositReserve: obj.depositReserve,\n depositedAmount: obj.depositedAmount,\n marketValueSf: obj.marketValueSf,\n borrowedAmountAgainstThisCollateralInElevationGroup:\n obj.borrowedAmountAgainstThisCollateralInElevationGroup,\n padding: obj.padding,\n })\n }\n\n static toEncodable(fields: ObligationCollateralFields) {\n return {\n depositReserve: fields.depositReserve,\n depositedAmount: fields.depositedAmount,\n marketValueSf: fields.marketValueSf,\n borrowedAmountAgainstThisCollateralInElevationGroup:\n fields.borrowedAmountAgainstThisCollateralInElevationGroup,\n padding: fields.padding,\n }\n }\n\n toJSON(): ObligationCollateralJSON {\n return {\n depositReserve: this.depositReserve.toString(),\n depositedAmount: this.depositedAmount.toString(),\n marketValueSf: this.marketValueSf.toString(),\n borrowedAmountAgainstThisCollateralInElevationGroup:\n this.borrowedAmountAgainstThisCollateralInElevationGroup.toString(),\n padding: this.padding.map((item) => item.toString()),\n }\n }\n\n static fromJSON(obj: ObligationCollateralJSON): ObligationCollateral {\n return new ObligationCollateral({\n depositReserve: new PublicKey(obj.depositReserve),\n depositedAmount: new BN(obj.depositedAmount),\n marketValueSf: new BN(obj.marketValueSf),\n borrowedAmountAgainstThisCollateralInElevationGroup: new BN(\n obj.borrowedAmountAgainstThisCollateralInElevationGroup\n ),\n padding: obj.padding.map((item) => new BN(item)),\n })\n }\n\n toEncodable() {\n return ObligationCollateral.toEncodable(this)\n }\n}\n"]}
|
|
@@ -13,6 +13,8 @@ export interface ObligationLiquidityFields {
|
|
|
13
13
|
marketValueSf: BN;
|
|
14
14
|
/** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */
|
|
15
15
|
borrowFactorAdjustedMarketValueSf: BN;
|
|
16
|
+
/** Amount of liquidity borrowed outside of an elevation group */
|
|
17
|
+
borrowedAmountOutsideElevationGroups: BN;
|
|
16
18
|
padding2: Array<BN>;
|
|
17
19
|
}
|
|
18
20
|
export interface ObligationLiquidityJSON {
|
|
@@ -27,6 +29,8 @@ export interface ObligationLiquidityJSON {
|
|
|
27
29
|
marketValueSf: string;
|
|
28
30
|
/** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */
|
|
29
31
|
borrowFactorAdjustedMarketValueSf: string;
|
|
32
|
+
/** Amount of liquidity borrowed outside of an elevation group */
|
|
33
|
+
borrowedAmountOutsideElevationGroups: string;
|
|
30
34
|
padding2: Array<string>;
|
|
31
35
|
}
|
|
32
36
|
/** Obligation liquidity state */
|
|
@@ -42,6 +46,8 @@ export declare class ObligationLiquidity {
|
|
|
42
46
|
readonly marketValueSf: BN;
|
|
43
47
|
/** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */
|
|
44
48
|
readonly borrowFactorAdjustedMarketValueSf: BN;
|
|
49
|
+
/** Amount of liquidity borrowed outside of an elevation group */
|
|
50
|
+
readonly borrowedAmountOutsideElevationGroups: BN;
|
|
45
51
|
readonly padding2: Array<BN>;
|
|
46
52
|
constructor(fields: ObligationLiquidityFields);
|
|
47
53
|
static layout(property?: string): any;
|
|
@@ -56,6 +62,7 @@ export declare class ObligationLiquidity {
|
|
|
56
62
|
borrowedAmountSf: BN;
|
|
57
63
|
marketValueSf: BN;
|
|
58
64
|
borrowFactorAdjustedMarketValueSf: BN;
|
|
65
|
+
borrowedAmountOutsideElevationGroups: BN;
|
|
59
66
|
padding2: BN[];
|
|
60
67
|
};
|
|
61
68
|
toJSON(): ObligationLiquidityJSON;
|
|
@@ -70,6 +77,7 @@ export declare class ObligationLiquidity {
|
|
|
70
77
|
borrowedAmountSf: BN;
|
|
71
78
|
marketValueSf: BN;
|
|
72
79
|
borrowFactorAdjustedMarketValueSf: BN;
|
|
80
|
+
borrowedAmountOutsideElevationGroups: BN;
|
|
73
81
|
padding2: BN[];
|
|
74
82
|
};
|
|
75
83
|
}
|
|
@@ -41,6 +41,8 @@ class ObligationLiquidity {
|
|
|
41
41
|
this.marketValueSf = fields.marketValueSf;
|
|
42
42
|
this.borrowFactorAdjustedMarketValueSf =
|
|
43
43
|
fields.borrowFactorAdjustedMarketValueSf;
|
|
44
|
+
this.borrowedAmountOutsideElevationGroups =
|
|
45
|
+
fields.borrowedAmountOutsideElevationGroups;
|
|
44
46
|
this.padding2 = fields.padding2;
|
|
45
47
|
}
|
|
46
48
|
static layout(property) {
|
|
@@ -51,7 +53,8 @@ class ObligationLiquidity {
|
|
|
51
53
|
borsh.u128("borrowedAmountSf"),
|
|
52
54
|
borsh.u128("marketValueSf"),
|
|
53
55
|
borsh.u128("borrowFactorAdjustedMarketValueSf"),
|
|
54
|
-
borsh.
|
|
56
|
+
borsh.u64("borrowedAmountOutsideElevationGroups"),
|
|
57
|
+
borsh.array(borsh.u64(), 7, "padding2"),
|
|
55
58
|
], property);
|
|
56
59
|
}
|
|
57
60
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -63,6 +66,7 @@ class ObligationLiquidity {
|
|
|
63
66
|
borrowedAmountSf: obj.borrowedAmountSf,
|
|
64
67
|
marketValueSf: obj.marketValueSf,
|
|
65
68
|
borrowFactorAdjustedMarketValueSf: obj.borrowFactorAdjustedMarketValueSf,
|
|
69
|
+
borrowedAmountOutsideElevationGroups: obj.borrowedAmountOutsideElevationGroups,
|
|
66
70
|
padding2: obj.padding2,
|
|
67
71
|
});
|
|
68
72
|
}
|
|
@@ -74,6 +78,7 @@ class ObligationLiquidity {
|
|
|
74
78
|
borrowedAmountSf: fields.borrowedAmountSf,
|
|
75
79
|
marketValueSf: fields.marketValueSf,
|
|
76
80
|
borrowFactorAdjustedMarketValueSf: fields.borrowFactorAdjustedMarketValueSf,
|
|
81
|
+
borrowedAmountOutsideElevationGroups: fields.borrowedAmountOutsideElevationGroups,
|
|
77
82
|
padding2: fields.padding2,
|
|
78
83
|
};
|
|
79
84
|
}
|
|
@@ -85,6 +90,7 @@ class ObligationLiquidity {
|
|
|
85
90
|
borrowedAmountSf: this.borrowedAmountSf.toString(),
|
|
86
91
|
marketValueSf: this.marketValueSf.toString(),
|
|
87
92
|
borrowFactorAdjustedMarketValueSf: this.borrowFactorAdjustedMarketValueSf.toString(),
|
|
93
|
+
borrowedAmountOutsideElevationGroups: this.borrowedAmountOutsideElevationGroups.toString(),
|
|
88
94
|
padding2: this.padding2.map((item) => item.toString()),
|
|
89
95
|
};
|
|
90
96
|
}
|
|
@@ -96,6 +102,7 @@ class ObligationLiquidity {
|
|
|
96
102
|
borrowedAmountSf: new bn_js_1.default(obj.borrowedAmountSf),
|
|
97
103
|
marketValueSf: new bn_js_1.default(obj.marketValueSf),
|
|
98
104
|
borrowFactorAdjustedMarketValueSf: new bn_js_1.default(obj.borrowFactorAdjustedMarketValueSf),
|
|
105
|
+
borrowedAmountOutsideElevationGroups: new bn_js_1.default(obj.borrowedAmountOutsideElevationGroups),
|
|
99
106
|
padding2: obj.padding2.map((item) => new bn_js_1.default(item)),
|
|
100
107
|
});
|
|
101
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObligationLiquidity.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/ObligationLiquidity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2C,CAAC,wDAAwD;AACpG,kDAAsB,CAAC,wDAAwD;AAC/E,gDAAiC,CAAC,wDAAwD;AAC1F,wDAAyC;
|
|
1
|
+
{"version":3,"file":"ObligationLiquidity.js","sourceRoot":"","sources":["../../../src/idl_codegen/types/ObligationLiquidity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2C,CAAC,wDAAwD;AACpG,kDAAsB,CAAC,wDAAwD;AAC/E,gDAAiC,CAAC,wDAAwD;AAC1F,wDAAyC;AAoCzC,iCAAiC;AACjC,MAAa,mBAAmB;IAgB9B,YAAY,MAAiC;QAC3C,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAA;QACzC,IAAI,CAAC,uBA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QAC1C,OAAO,IAAI,mBAAmB,CAAC;YAC7B,aAAa,EAAE,IAAI,mBAAS,CAAC,GAAG,CAAC,aAAa,CAAC;YAC/C,uBAAuB,EAAE,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CACtD,GAAG,CAAC,uBAAuB,CAC5B;YACD,OAAO,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,OAAO,CAAC;YAC5B,gBAAgB,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,gBAAgB,CAAC;YAC9C,aAAa,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,aAAa,CAAC;YACxC,iCAAiC,EAAE,IAAI,eAAE,CACvC,GAAG,CAAC,iCAAiC,CACtC;YACD,oCAAoC,EAAE,IAAI,eAAE,CAC1C,GAAG,CAAC,oCAAoC,CACzC;YACD,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,eAAE,CAAC,IAAI,CAAC,CAAC;SACnD,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,OAAO,mBAAmB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;CACF;AAtHD,kDAsHC","sourcesContent":["import { PublicKey } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\"\n\nexport interface ObligationLiquidityFields {\n /** Reserve liquidity is borrowed from */\n borrowReserve: PublicKey\n /** Borrow rate used for calculating interest (big scaled fraction) */\n cumulativeBorrowRateBsf: types.BigFractionBytesFields\n padding: BN\n /** Amount of liquidity borrowed plus interest (scaled fraction) */\n borrowedAmountSf: BN\n /** Liquidity market value in quote currency (scaled fraction) */\n marketValueSf: BN\n /** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */\n borrowFactorAdjustedMarketValueSf: BN\n /** Amount of liquidity borrowed outside of an elevation group */\n borrowedAmountOutsideElevationGroups: BN\n padding2: Array<BN>\n}\n\nexport interface ObligationLiquidityJSON {\n /** Reserve liquidity is borrowed from */\n borrowReserve: string\n /** Borrow rate used for calculating interest (big scaled fraction) */\n cumulativeBorrowRateBsf: types.BigFractionBytesJSON\n padding: string\n /** Amount of liquidity borrowed plus interest (scaled fraction) */\n borrowedAmountSf: string\n /** Liquidity market value in quote currency (scaled fraction) */\n marketValueSf: string\n /** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */\n borrowFactorAdjustedMarketValueSf: string\n /** Amount of liquidity borrowed outside of an elevation group */\n borrowedAmountOutsideElevationGroups: string\n padding2: Array<string>\n}\n\n/** Obligation liquidity state */\nexport class ObligationLiquidity {\n /** Reserve liquidity is borrowed from */\n readonly borrowReserve: PublicKey\n /** Borrow rate used for calculating interest (big scaled fraction) */\n readonly cumulativeBorrowRateBsf: types.BigFractionBytes\n readonly padding: BN\n /** Amount of liquidity borrowed plus interest (scaled fraction) */\n readonly borrowedAmountSf: BN\n /** Liquidity market value in quote currency (scaled fraction) */\n readonly marketValueSf: BN\n /** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */\n readonly borrowFactorAdjustedMarketValueSf: BN\n /** Amount of liquidity borrowed outside of an elevation group */\n readonly borrowedAmountOutsideElevationGroups: BN\n readonly padding2: Array<BN>\n\n constructor(fields: ObligationLiquidityFields) {\n this.borrowReserve = fields.borrowReserve\n this.cumulativeBorrowRateBsf = new types.BigFractionBytes({\n ...fields.cumulativeBorrowRateBsf,\n })\n this.padding = fields.padding\n this.borrowedAmountSf = fields.borrowedAmountSf\n this.marketValueSf = fields.marketValueSf\n this.borrowFactorAdjustedMarketValueSf =\n fields.borrowFactorAdjustedMarketValueSf\n this.borrowedAmountOutsideElevationGroups =\n fields.borrowedAmountOutsideElevationGroups\n this.padding2 = fields.padding2\n }\n\n static layout(property?: string) {\n return borsh.struct(\n [\n borsh.publicKey(\"borrowReserve\"),\n types.BigFractionBytes.layout(\"cumulativeBorrowRateBsf\"),\n borsh.u64(\"padding\"),\n borsh.u128(\"borrowedAmountSf\"),\n borsh.u128(\"marketValueSf\"),\n borsh.u128(\"borrowFactorAdjustedMarketValueSf\"),\n borsh.u64(\"borrowedAmountOutsideElevationGroups\"),\n borsh.array(borsh.u64(), 7, \"padding2\"),\n ],\n property\n )\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static fromDecoded(obj: any) {\n return new ObligationLiquidity({\n borrowReserve: obj.borrowReserve,\n cumulativeBorrowRateBsf: types.BigFractionBytes.fromDecoded(\n obj.cumulativeBorrowRateBsf\n ),\n padding: obj.padding,\n borrowedAmountSf: obj.borrowedAmountSf,\n marketValueSf: obj.marketValueSf,\n borrowFactorAdjustedMarketValueSf: obj.borrowFactorAdjustedMarketValueSf,\n borrowedAmountOutsideElevationGroups:\n obj.borrowedAmountOutsideElevationGroups,\n padding2: obj.padding2,\n })\n }\n\n static toEncodable(fields: ObligationLiquidityFields) {\n return {\n borrowReserve: fields.borrowReserve,\n cumulativeBorrowRateBsf: types.BigFractionBytes.toEncodable(\n fields.cumulativeBorrowRateBsf\n ),\n padding: fields.padding,\n borrowedAmountSf: fields.borrowedAmountSf,\n marketValueSf: fields.marketValueSf,\n borrowFactorAdjustedMarketValueSf:\n fields.borrowFactorAdjustedMarketValueSf,\n borrowedAmountOutsideElevationGroups:\n fields.borrowedAmountOutsideElevationGroups,\n padding2: fields.padding2,\n }\n }\n\n toJSON(): ObligationLiquidityJSON {\n return {\n borrowReserve: this.borrowReserve.toString(),\n cumulativeBorrowRateBsf: this.cumulativeBorrowRateBsf.toJSON(),\n padding: this.padding.toString(),\n borrowedAmountSf: this.borrowedAmountSf.toString(),\n marketValueSf: this.marketValueSf.toString(),\n borrowFactorAdjustedMarketValueSf:\n this.borrowFactorAdjustedMarketValueSf.toString(),\n borrowedAmountOutsideElevationGroups:\n this.borrowedAmountOutsideElevationGroups.toString(),\n padding2: this.padding2.map((item) => item.toString()),\n }\n }\n\n static fromJSON(obj: ObligationLiquidityJSON): ObligationLiquidity {\n return new ObligationLiquidity({\n borrowReserve: new PublicKey(obj.borrowReserve),\n cumulativeBorrowRateBsf: types.BigFractionBytes.fromJSON(\n obj.cumulativeBorrowRateBsf\n ),\n padding: new BN(obj.padding),\n borrowedAmountSf: new BN(obj.borrowedAmountSf),\n marketValueSf: new BN(obj.marketValueSf),\n borrowFactorAdjustedMarketValueSf: new BN(\n obj.borrowFactorAdjustedMarketValueSf\n ),\n borrowedAmountOutsideElevationGroups: new BN(\n obj.borrowedAmountOutsideElevationGroups\n ),\n padding2: obj.padding2.map((item) => new BN(item)),\n })\n }\n\n toEncodable() {\n return ObligationLiquidity.toEncodable(this)\n }\n}\n"]}
|
|
@@ -6,7 +6,8 @@ export interface ReserveConfigFields {
|
|
|
6
6
|
status: number;
|
|
7
7
|
/** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */
|
|
8
8
|
assetTier: number;
|
|
9
|
-
|
|
9
|
+
/** Flat rate that goes to the host */
|
|
10
|
+
hostFixedInterestRateBps: number;
|
|
10
11
|
/** Boost for side (debt or collateral) */
|
|
11
12
|
multiplierSideBoost: Array<number>;
|
|
12
13
|
/** Reward points multiplier per obligation type */
|
|
@@ -55,13 +56,27 @@ export interface ReserveConfigFields {
|
|
|
55
56
|
disableUsageAsCollOutsideEmode: number;
|
|
56
57
|
utilizationLimitBlockBorrowingAbove: number;
|
|
57
58
|
reserved1: Array<number>;
|
|
59
|
+
/**
|
|
60
|
+
* Maximum amount liquidity of this reserve borrowed outside all elevation groups
|
|
61
|
+
* - u64::MAX for inf
|
|
62
|
+
* - 0 to disable borrows outside elevation groups
|
|
63
|
+
*/
|
|
64
|
+
borrowLimitOutsideElevationGroup: BN;
|
|
65
|
+
/**
|
|
66
|
+
* Defines the maximum amount (in lamports of elevation group debt asset)
|
|
67
|
+
* that can be borrowed when this reserve is used as collateral.
|
|
68
|
+
* - u64::MAX for inf
|
|
69
|
+
* - 0 to disable borrows in this elevation group (expected value for the debt asset)
|
|
70
|
+
*/
|
|
71
|
+
borrowLimitAgainstThisCollateralInElevationGroup: Array<BN>;
|
|
58
72
|
}
|
|
59
73
|
export interface ReserveConfigJSON {
|
|
60
74
|
/** Status of the reserve Active/Obsolete/Hidden */
|
|
61
75
|
status: number;
|
|
62
76
|
/** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */
|
|
63
77
|
assetTier: number;
|
|
64
|
-
|
|
78
|
+
/** Flat rate that goes to the host */
|
|
79
|
+
hostFixedInterestRateBps: number;
|
|
65
80
|
/** Boost for side (debt or collateral) */
|
|
66
81
|
multiplierSideBoost: Array<number>;
|
|
67
82
|
/** Reward points multiplier per obligation type */
|
|
@@ -110,6 +125,19 @@ export interface ReserveConfigJSON {
|
|
|
110
125
|
disableUsageAsCollOutsideEmode: number;
|
|
111
126
|
utilizationLimitBlockBorrowingAbove: number;
|
|
112
127
|
reserved1: Array<number>;
|
|
128
|
+
/**
|
|
129
|
+
* Maximum amount liquidity of this reserve borrowed outside all elevation groups
|
|
130
|
+
* - u64::MAX for inf
|
|
131
|
+
* - 0 to disable borrows outside elevation groups
|
|
132
|
+
*/
|
|
133
|
+
borrowLimitOutsideElevationGroup: string;
|
|
134
|
+
/**
|
|
135
|
+
* Defines the maximum amount (in lamports of elevation group debt asset)
|
|
136
|
+
* that can be borrowed when this reserve is used as collateral.
|
|
137
|
+
* - u64::MAX for inf
|
|
138
|
+
* - 0 to disable borrows in this elevation group (expected value for the debt asset)
|
|
139
|
+
*/
|
|
140
|
+
borrowLimitAgainstThisCollateralInElevationGroup: Array<string>;
|
|
113
141
|
}
|
|
114
142
|
/** Reserve configuration values */
|
|
115
143
|
export declare class ReserveConfig {
|
|
@@ -117,7 +145,8 @@ export declare class ReserveConfig {
|
|
|
117
145
|
readonly status: number;
|
|
118
146
|
/** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */
|
|
119
147
|
readonly assetTier: number;
|
|
120
|
-
|
|
148
|
+
/** Flat rate that goes to the host */
|
|
149
|
+
readonly hostFixedInterestRateBps: number;
|
|
121
150
|
/** Boost for side (debt or collateral) */
|
|
122
151
|
readonly multiplierSideBoost: Array<number>;
|
|
123
152
|
/** Reward points multiplier per obligation type */
|
|
@@ -166,13 +195,26 @@ export declare class ReserveConfig {
|
|
|
166
195
|
readonly disableUsageAsCollOutsideEmode: number;
|
|
167
196
|
readonly utilizationLimitBlockBorrowingAbove: number;
|
|
168
197
|
readonly reserved1: Array<number>;
|
|
198
|
+
/**
|
|
199
|
+
* Maximum amount liquidity of this reserve borrowed outside all elevation groups
|
|
200
|
+
* - u64::MAX for inf
|
|
201
|
+
* - 0 to disable borrows outside elevation groups
|
|
202
|
+
*/
|
|
203
|
+
readonly borrowLimitOutsideElevationGroup: BN;
|
|
204
|
+
/**
|
|
205
|
+
* Defines the maximum amount (in lamports of elevation group debt asset)
|
|
206
|
+
* that can be borrowed when this reserve is used as collateral.
|
|
207
|
+
* - u64::MAX for inf
|
|
208
|
+
* - 0 to disable borrows in this elevation group (expected value for the debt asset)
|
|
209
|
+
*/
|
|
210
|
+
readonly borrowLimitAgainstThisCollateralInElevationGroup: Array<BN>;
|
|
169
211
|
constructor(fields: ReserveConfigFields);
|
|
170
212
|
static layout(property?: string): any;
|
|
171
213
|
static fromDecoded(obj: any): types.ReserveConfig;
|
|
172
214
|
static toEncodable(fields: ReserveConfigFields): {
|
|
173
215
|
status: number;
|
|
174
216
|
assetTier: number;
|
|
175
|
-
|
|
217
|
+
hostFixedInterestRateBps: number;
|
|
176
218
|
multiplierSideBoost: number[];
|
|
177
219
|
multiplierTagBoost: number[];
|
|
178
220
|
protocolTakeRatePct: number;
|
|
@@ -193,7 +235,7 @@ export declare class ReserveConfig {
|
|
|
193
235
|
points: {
|
|
194
236
|
utilizationRateBps: number;
|
|
195
237
|
borrowRateBps: number;
|
|
196
|
-
}[];
|
|
238
|
+
}[]; /** Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */
|
|
197
239
|
};
|
|
198
240
|
borrowFactorPct: BN;
|
|
199
241
|
depositLimit: BN;
|
|
@@ -219,7 +261,7 @@ export declare class ReserveConfig {
|
|
|
219
261
|
};
|
|
220
262
|
pythConfiguration: {
|
|
221
263
|
price: PublicKey;
|
|
222
|
-
};
|
|
264
|
+
};
|
|
223
265
|
blockPriceUsage: number;
|
|
224
266
|
reserved: number[];
|
|
225
267
|
padding: BN[];
|
|
@@ -240,13 +282,15 @@ export declare class ReserveConfig {
|
|
|
240
282
|
disableUsageAsCollOutsideEmode: number;
|
|
241
283
|
utilizationLimitBlockBorrowingAbove: number;
|
|
242
284
|
reserved1: number[];
|
|
285
|
+
borrowLimitOutsideElevationGroup: BN;
|
|
286
|
+
borrowLimitAgainstThisCollateralInElevationGroup: BN[];
|
|
243
287
|
};
|
|
244
288
|
toJSON(): ReserveConfigJSON;
|
|
245
289
|
static fromJSON(obj: ReserveConfigJSON): ReserveConfig;
|
|
246
290
|
toEncodable(): {
|
|
247
291
|
status: number;
|
|
248
292
|
assetTier: number;
|
|
249
|
-
|
|
293
|
+
hostFixedInterestRateBps: number;
|
|
250
294
|
multiplierSideBoost: number[];
|
|
251
295
|
multiplierTagBoost: number[];
|
|
252
296
|
protocolTakeRatePct: number;
|
|
@@ -267,7 +311,7 @@ export declare class ReserveConfig {
|
|
|
267
311
|
points: {
|
|
268
312
|
utilizationRateBps: number;
|
|
269
313
|
borrowRateBps: number;
|
|
270
|
-
}[];
|
|
314
|
+
}[]; /** Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */
|
|
271
315
|
};
|
|
272
316
|
borrowFactorPct: BN;
|
|
273
317
|
depositLimit: BN;
|
|
@@ -293,7 +337,7 @@ export declare class ReserveConfig {
|
|
|
293
337
|
};
|
|
294
338
|
pythConfiguration: {
|
|
295
339
|
price: PublicKey;
|
|
296
|
-
};
|
|
340
|
+
};
|
|
297
341
|
blockPriceUsage: number;
|
|
298
342
|
reserved: number[];
|
|
299
343
|
padding: BN[];
|
|
@@ -314,5 +358,7 @@ export declare class ReserveConfig {
|
|
|
314
358
|
disableUsageAsCollOutsideEmode: number;
|
|
315
359
|
utilizationLimitBlockBorrowingAbove: number;
|
|
316
360
|
reserved1: number[];
|
|
361
|
+
borrowLimitOutsideElevationGroup: BN;
|
|
362
|
+
borrowLimitAgainstThisCollateralInElevationGroup: BN[];
|
|
317
363
|
};
|
|
318
364
|
}
|