@kamino-finance/klend-sdk 3.2.18 → 3.2.19

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.
Files changed (48) hide show
  1. package/README.md +42 -0
  2. package/dist/classes/manager.js +0 -17
  3. package/dist/classes/manager.js.map +1 -1
  4. package/dist/classes/market.d.ts +15 -0
  5. package/dist/classes/market.js +153 -0
  6. package/dist/classes/market.js.map +1 -1
  7. package/dist/classes/obligation.js.map +1 -1
  8. package/dist/classes/reserve.js +0 -45
  9. package/dist/classes/reserve.js.map +1 -1
  10. package/dist/client_kamino_manager.d.ts +2 -1
  11. package/dist/client_kamino_manager.js +22 -21
  12. package/dist/client_kamino_manager.js.map +1 -1
  13. package/dist/idl.json +41 -19
  14. package/dist/idl_codegen/accounts/LendingMarket.d.ts +6 -6
  15. package/dist/idl_codegen/accounts/LendingMarket.js +5 -5
  16. package/dist/idl_codegen/accounts/LendingMarket.js.map +1 -1
  17. package/dist/idl_codegen/errors/custom.d.ts +25 -1
  18. package/dist/idl_codegen/errors/custom.js +40 -1
  19. package/dist/idl_codegen/errors/custom.js.map +1 -1
  20. package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.d.ts +0 -1
  21. package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.js +1 -1
  22. package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.js.map +1 -1
  23. package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.d.ts +0 -1
  24. package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.js +1 -1
  25. package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.js.map +1 -1
  26. package/dist/idl_codegen/instructions/index.d.ts +2 -0
  27. package/dist/idl_codegen/instructions/index.js +3 -1
  28. package/dist/idl_codegen/instructions/index.js.map +1 -1
  29. package/dist/idl_codegen/instructions/refreshReservesBatch.d.ts +6 -0
  30. package/dist/idl_codegen/instructions/refreshReservesBatch.js +43 -0
  31. package/dist/idl_codegen/instructions/refreshReservesBatch.js.map +1 -0
  32. package/dist/idl_codegen/programId.js.map +1 -1
  33. package/dist/idl_codegen/types/ReserveConfig.d.ts +16 -16
  34. package/dist/idl_codegen/types/ReserveConfig.js +12 -12
  35. package/dist/idl_codegen/types/ReserveConfig.js.map +1 -1
  36. package/dist/idl_codegen/types/UpdateConfigMode.d.ts +14 -14
  37. package/dist/idl_codegen/types/UpdateConfigMode.js +25 -25
  38. package/dist/idl_codegen/types/UpdateConfigMode.js.map +1 -1
  39. package/dist/idl_codegen/types/UpdateLendingMarketMode.d.ts +20 -7
  40. package/dist/idl_codegen/types/UpdateLendingMarketMode.js +39 -13
  41. package/dist/idl_codegen/types/UpdateLendingMarketMode.js.map +1 -1
  42. package/dist/idl_codegen/types/index.d.ts +4 -4
  43. package/dist/idl_codegen/types/index.js.map +1 -1
  44. package/dist/utils/instruction.js +0 -1
  45. package/dist/utils/instruction.js.map +1 -1
  46. package/dist/utils/managerTypes.js +2 -2
  47. package/dist/utils/managerTypes.js.map +1 -1
  48. package/package.json +1 -1
package/dist/idl.json CHANGED
@@ -423,6 +423,16 @@
423
423
  ],
424
424
  "args": []
425
425
  },
426
+ {
427
+ "name": "refreshReservesBatch",
428
+ "accounts": [],
429
+ "args": [
430
+ {
431
+ "name": "skipPriceUpdates",
432
+ "type": "bool"
433
+ }
434
+ ]
435
+ },
426
436
  {
427
437
  "name": "depositReserveLiquidity",
428
438
  "accounts": [
@@ -1309,7 +1319,7 @@
1309
1319
  },
1310
1320
  {
1311
1321
  "name": "reserveLiquidityMint",
1312
- "isMut": true,
1322
+ "isMut": false,
1313
1323
  "isSigner": false
1314
1324
  },
1315
1325
  {
@@ -1347,10 +1357,7 @@
1347
1357
  {
1348
1358
  "name": "tokenProgram",
1349
1359
  "isMut": false,
1350
- "isSigner": false,
1351
- "docs": [
1352
- "flash loans on token_22 tokens are currently purposefully disabled"
1353
- ]
1360
+ "isSigner": false
1354
1361
  }
1355
1362
  ],
1356
1363
  "args": [
@@ -1389,7 +1396,7 @@
1389
1396
  },
1390
1397
  {
1391
1398
  "name": "reserveLiquidityMint",
1392
- "isMut": true,
1399
+ "isMut": false,
1393
1400
  "isSigner": false
1394
1401
  },
1395
1402
  {
@@ -1427,10 +1434,7 @@
1427
1434
  {
1428
1435
  "name": "tokenProgram",
1429
1436
  "isMut": false,
1430
- "isSigner": false,
1431
- "docs": [
1432
- "flash loans on token_22 tokens are currently purposefully disabled"
1433
- ]
1437
+ "isSigner": false
1434
1438
  }
1435
1439
  ],
1436
1440
  "args": [
@@ -1998,9 +2002,9 @@
1998
2002
  "type": "publicKey"
1999
2003
  },
2000
2004
  {
2001
- "name": "multiplierPointsTagBoost",
2005
+ "name": "reserved1",
2002
2006
  "docs": [
2003
- "Reward points multiplier per obligation type"
2007
+ "[DEPRECATED] Reward points multiplier per obligation type"
2004
2008
  ],
2005
2009
  "type": {
2006
2010
  "array": [
@@ -2627,10 +2631,10 @@
2627
2631
  "name": "DeleveragingThresholdSlotsPerBps"
2628
2632
  },
2629
2633
  {
2630
- "name": "UpdateMultiplierSideBoost"
2634
+ "name": "DeprecatedUpdateMultiplierSideBoost"
2631
2635
  },
2632
2636
  {
2633
- "name": "UpdateMultiplierTagBoost"
2637
+ "name": "DeprecatedUpdateMultiplierTagBoost"
2634
2638
  },
2635
2639
  {
2636
2640
  "name": "UpdateReserveStatus"
@@ -2764,7 +2768,7 @@
2764
2768
  "name": "UpdateReferralFeeBps"
2765
2769
  },
2766
2770
  {
2767
- "name": "UpdateMultiplierPoints"
2771
+ "name": "DeprecatedUpdateMultiplierPoints"
2768
2772
  },
2769
2773
  {
2770
2774
  "name": "UpdatePriceRefreshTriggerToMaxAgePct"
@@ -2780,6 +2784,9 @@
2780
2784
  },
2781
2785
  {
2782
2786
  "name": "UpdateMinValueSkipPriorityLiqCheck"
2787
+ },
2788
+ {
2789
+ "name": "UpdatePaddingFields"
2783
2790
  }
2784
2791
  ]
2785
2792
  }
@@ -3152,9 +3159,9 @@
3152
3159
  "type": "u16"
3153
3160
  },
3154
3161
  {
3155
- "name": "multiplierSideBoost",
3162
+ "name": "reserved2",
3156
3163
  "docs": [
3157
- "Boost for side (debt or collateral)"
3164
+ "[DEPRECATED] Boost for side (debt or collateral)"
3158
3165
  ],
3159
3166
  "type": {
3160
3167
  "array": [
@@ -3164,9 +3171,9 @@
3164
3171
  }
3165
3172
  },
3166
3173
  {
3167
- "name": "multiplierTagBoost",
3174
+ "name": "reserved3",
3168
3175
  "docs": [
3169
- "Reward points multiplier per obligation type"
3176
+ "[DEPRECATED] Reward points multiplier per obligation type"
3170
3177
  ],
3171
3178
  "type": {
3172
3179
  "array": [
@@ -4385,6 +4392,21 @@
4385
4392
  "code": 6108,
4386
4393
  "name": "UnsupportedTokenExtension",
4387
4394
  "msg": "Mint has a token (2022) extension that is not supported"
4395
+ },
4396
+ {
4397
+ "code": 6109,
4398
+ "name": "InvalidTokenAccount",
4399
+ "msg": "Can't have an spl token mint with a t22 account"
4400
+ },
4401
+ {
4402
+ "code": 6110,
4403
+ "name": "DepositDisabledOutsideElevationGroup",
4404
+ "msg": "Can't deposit into this reserve outside elevation group"
4405
+ },
4406
+ {
4407
+ "code": 6111,
4408
+ "name": "CannotCalculateReferralAmountDueToSlotsMismatch",
4409
+ "msg": "Cannot calculate referral amount due to slots mismatch"
4388
4410
  }
4389
4411
  ]
4390
4412
  }
@@ -40,8 +40,8 @@ export interface LendingMarketFields {
40
40
  globalAllowedBorrowValue: BN;
41
41
  /** The address of the risk council, in charge of making parameter and risk decisions on behalf of the protocol */
42
42
  riskCouncil: PublicKey;
43
- /** Reward points multiplier per obligation type */
44
- multiplierPointsTagBoost: Array<number>;
43
+ /** [DEPRECATED] Reward points multiplier per obligation type */
44
+ reserved1: Array<number>;
45
45
  /** Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold */
46
46
  elevationGroups: Array<types.ElevationGroupFields>;
47
47
  elevationGroupPadding: Array<BN>;
@@ -89,8 +89,8 @@ export interface LendingMarketJSON {
89
89
  globalAllowedBorrowValue: string;
90
90
  /** The address of the risk council, in charge of making parameter and risk decisions on behalf of the protocol */
91
91
  riskCouncil: string;
92
- /** Reward points multiplier per obligation type */
93
- multiplierPointsTagBoost: Array<number>;
92
+ /** [DEPRECATED] Reward points multiplier per obligation type */
93
+ reserved1: Array<number>;
94
94
  /** Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold */
95
95
  elevationGroups: Array<types.ElevationGroupJSON>;
96
96
  elevationGroupPadding: Array<string>;
@@ -138,8 +138,8 @@ export declare class LendingMarket {
138
138
  readonly globalAllowedBorrowValue: BN;
139
139
  /** The address of the risk council, in charge of making parameter and risk decisions on behalf of the protocol */
140
140
  readonly riskCouncil: PublicKey;
141
- /** Reward points multiplier per obligation type */
142
- readonly multiplierPointsTagBoost: Array<number>;
141
+ /** [DEPRECATED] Reward points multiplier per obligation type */
142
+ readonly reserved1: Array<number>;
143
143
  /** Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold */
144
144
  readonly elevationGroups: Array<types.ElevationGroup>;
145
145
  readonly elevationGroupPadding: Array<BN>;
@@ -63,7 +63,7 @@ class LendingMarket {
63
63
  this.globalUnhealthyBorrowValue = fields.globalUnhealthyBorrowValue;
64
64
  this.globalAllowedBorrowValue = fields.globalAllowedBorrowValue;
65
65
  this.riskCouncil = fields.riskCouncil;
66
- this.multiplierPointsTagBoost = fields.multiplierPointsTagBoost;
66
+ this.reserved1 = fields.reserved1;
67
67
  this.elevationGroups = fields.elevationGroups.map((item) => new types.ElevationGroup(Object.assign({}, item)));
68
68
  this.elevationGroupPadding = fields.elevationGroupPadding;
69
69
  this.minNetValueInObligationSf = fields.minNetValueInObligationSf;
@@ -120,7 +120,7 @@ class LendingMarket {
120
120
  globalUnhealthyBorrowValue: dec.globalUnhealthyBorrowValue,
121
121
  globalAllowedBorrowValue: dec.globalAllowedBorrowValue,
122
122
  riskCouncil: dec.riskCouncil,
123
- multiplierPointsTagBoost: dec.multiplierPointsTagBoost,
123
+ reserved1: dec.reserved1,
124
124
  elevationGroups: dec.elevationGroups.map((item /* eslint-disable-line @typescript-eslint/no-explicit-any */) => types.ElevationGroup.fromDecoded(item)),
125
125
  elevationGroupPadding: dec.elevationGroupPadding,
126
126
  minNetValueInObligationSf: dec.minNetValueInObligationSf,
@@ -147,7 +147,7 @@ class LendingMarket {
147
147
  globalUnhealthyBorrowValue: this.globalUnhealthyBorrowValue.toString(),
148
148
  globalAllowedBorrowValue: this.globalAllowedBorrowValue.toString(),
149
149
  riskCouncil: this.riskCouncil.toString(),
150
- multiplierPointsTagBoost: this.multiplierPointsTagBoost,
150
+ reserved1: this.reserved1,
151
151
  elevationGroups: this.elevationGroups.map((item) => item.toJSON()),
152
152
  elevationGroupPadding: this.elevationGroupPadding.map((item) => item.toString()),
153
153
  minNetValueInObligationSf: this.minNetValueInObligationSf.toString(),
@@ -174,7 +174,7 @@ class LendingMarket {
174
174
  globalUnhealthyBorrowValue: new bn_js_1.default(obj.globalUnhealthyBorrowValue),
175
175
  globalAllowedBorrowValue: new bn_js_1.default(obj.globalAllowedBorrowValue),
176
176
  riskCouncil: new web3_js_1.PublicKey(obj.riskCouncil),
177
- multiplierPointsTagBoost: obj.multiplierPointsTagBoost,
177
+ reserved1: obj.reserved1,
178
178
  elevationGroups: obj.elevationGroups.map((item) => types.ElevationGroup.fromJSON(item)),
179
179
  elevationGroupPadding: obj.elevationGroupPadding.map((item) => new bn_js_1.default(item)),
180
180
  minNetValueInObligationSf: new bn_js_1.default(obj.minNetValueInObligationSf),
@@ -205,7 +205,7 @@ LendingMarket.layout = borsh.struct([
205
205
  borsh.u64("globalUnhealthyBorrowValue"),
206
206
  borsh.u64("globalAllowedBorrowValue"),
207
207
  borsh.publicKey("riskCouncil"),
208
- borsh.array(borsh.u8(), 8, "multiplierPointsTagBoost"),
208
+ borsh.array(borsh.u8(), 8, "reserved1"),
209
209
  borsh.array(types.ElevationGroup.layout(), 32, "elevationGroups"),
210
210
  borsh.array(borsh.u64(), 90, "elevationGroupPadding"),
211
211
  borsh.u128("minNetValueInObligationSf"),
@@ -1 +1 @@
1
- {"version":3,"file":"LendingMarket.js","sourceRoot":"","sources":["../../../src/idl_codegen/accounts/LendingMarket.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAuD;AACvD,kDAAsB,CAAC,wDAAwD;AAC/E,wDAAyC,CAAC,wDAAwD;AAClG,gDAAiC,CAAC,wDAAwD;AAC1F,4CAAyC;AAsGzC,MAAa,aAAa;IA+ExB,YAAY,MAA2B;QACrC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAC7B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA;QAC/B,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAA;QACnD,IAAI,CAAC,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAA;QAC/D,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAA;QACzC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAA;QAC3C,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAA;QACzC,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAA;QACzD,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAA;QAC3C,IAAI,CAAC,8BAA8B,GAAG,MAAM,CAAC,8BAA8B,CAAA;QAC3E,IAAI,CAAC,gCAAgC;YACnC,MAAM,CAAC,gCAAgC,CAAA;QACzC,IAAI,CAAC,6BAA6B,GAAG,MAAM,CAAC,6BAA6B,CAAA;QACzE,IAAI,CAAC,gCAAgC;YACnC,MAAM,CAAC,gCAAgC,CAAA;QACzC,IAAI,CAAC,oCAAoC;YACvC,MAAM,CAAC,oCAAoC,CAAA;QAC7C,IAAI,CAAC,0BAA0B,GAAG,MAAM,CAAC,0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AAC,CAAA","sourcesContent":["import { PublicKey, Connection } from \"@solana/web3.js\"\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 LendingMarketFields {\n /** Version of lending market */\n version: BN\n /** Bump seed for derived authority address */\n bumpSeed: BN\n /** Owner authority which can add new reserves */\n lendingMarketOwner: PublicKey\n /** Temporary cache of the lending market owner, used in update_lending_market_owner */\n lendingMarketOwnerCached: PublicKey\n /**\n * Currency market prices are quoted in\n * e.g. \"USD\" null padded (`*b\"USD\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\"`) or a SPL token mint pubkey\n */\n quoteCurrency: Array<number>\n /** Referral fee for the lending market, as bps out of the total protocol fee */\n referralFeeBps: number\n emergencyMode: number\n autodeleverageEnabled: number\n borrowDisabled: number\n /**\n * Refresh price from oracle only if it's older than this percentage of the price max age.\n * e.g. if the max age is set to 100s and this is set to 80%, the price will be refreshed if it's older than 80s.\n * Price is always refreshed if this set to 0.\n */\n priceRefreshTriggerToMaxAgePct: number\n /** Percentage of the total borrowed value in an obligation available for liquidation */\n liquidationMaxDebtCloseFactorPct: number\n /** Minimum acceptable unhealthy LTV before max_debt_close_factor_pct becomes 100% */\n insolvencyRiskUnhealthyLtvPct: number\n /** Minimum liquidation value threshold triggering full liquidation for an obligation */\n minFullLiquidationValueThreshold: BN\n /** Max allowed liquidation value in one ix call */\n maxLiquidatableDebtMarketValueAtOnce: BN\n /** Global maximum unhealthy borrow value allowed for any obligation */\n globalUnhealthyBorrowValue: BN\n /** Global maximum allowed borrow value allowed for any obligation */\n globalAllowedBorrowValue: BN\n /** The address of the risk council, in charge of making parameter and risk decisions on behalf of the protocol */\n riskCouncil: PublicKey\n /** Reward points multiplier per obligation type */\n multiplierPointsTagBoost: Array<number>\n /** Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold */\n elevationGroups: Array<types.ElevationGroupFields>\n elevationGroupPadding: Array<BN>\n /** Min net value accepted to be found in a position after any lending action in an obligation (scaled by quote currency decimals) */\n minNetValueInObligationSf: BN\n minValueSkipLiquidationLtvBfChecks: BN\n padding1: Array<BN>\n}\n\nexport interface LendingMarketJSON {\n /** Version of lending market */\n version: string\n /** Bump seed for derived authority address */\n bumpSeed: string\n /** Owner authority which can add new reserves */\n lendingMarketOwner: string\n /** Temporary cache of the lending market owner, used in update_lending_market_owner */\n lendingMarketOwnerCached: string\n /**\n * Currency market prices are quoted in\n * e.g. \"USD\" null padded (`*b\"USD\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\"`) or a SPL token mint pubkey\n */\n quoteCurrency: Array<number>\n /** Referral fee for the lending market, as bps out of the total protocol fee */\n referralFeeBps: number\n emergencyMode: number\n autodeleverageEnabled: number\n borrowDisabled: number\n /**\n * Refresh price from oracle only if it's older than this percentage of the price max age.\n * e.g. if the max age is set to 100s and this is set to 80%, the price will be refreshed if it's older than 80s.\n * Price is always refreshed if this set to 0.\n */\n priceRefreshTriggerToMaxAgePct: number\n /** Percentage of the total borrowed value in an obligation available for liquidation */\n liquidationMaxDebtCloseFactorPct: number\n /** Minimum acceptable unhealthy LTV before max_debt_close_factor_pct becomes 100% */\n insolvencyRiskUnhealthyLtvPct: number\n /** Minimum liquidation value threshold triggering full liquidation for an obligation */\n minFullLiquidationValueThreshold: string\n /** Max allowed liquidation value in one ix call */\n maxLiquidatableDebtMarketValueAtOnce: string\n /** Global maximum unhealthy borrow value allowed for any obligation */\n globalUnhealthyBorrowValue: string\n /** Global maximum allowed borrow value allowed for any obligation */\n globalAllowedBorrowValue: string\n /** The address of the risk council, in charge of making parameter and risk decisions on behalf of the protocol */\n riskCouncil: string\n /** Reward points multiplier per obligation type */\n multiplierPointsTagBoost: Array<number>\n /** Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold */\n elevationGroups: Array<types.ElevationGroupJSON>\n elevationGroupPadding: Array<string>\n /** Min net value accepted to be found in a position after any lending action in an obligation (scaled by quote currency decimals) */\n minNetValueInObligationSf: string\n minValueSkipLiquidationLtvBfChecks: string\n padding1: Array<string>\n}\n\nexport class LendingMarket {\n /** Version of lending market */\n readonly version: BN\n /** Bump seed for derived authority address */\n readonly bumpSeed: BN\n /** Owner authority which can add new reserves */\n readonly lendingMarketOwner: PublicKey\n /** Temporary cache of the lending market owner, used in update_lending_market_owner */\n readonly lendingMarketOwnerCached: PublicKey\n /**\n * Currency market prices are quoted in\n * e.g. \"USD\" null padded (`*b\"USD\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\"`) or a SPL token mint pubkey\n */\n readonly quoteCurrency: Array<number>\n /** Referral fee for the lending market, as bps out of the total protocol fee */\n readonly referralFeeBps: number\n readonly emergencyMode: number\n readonly autodeleverageEnabled: number\n readonly borrowDisabled: number\n /**\n * Refresh price from oracle only if it's older than this percentage of the price max age.\n * e.g. if the max age is set to 100s and this is set to 80%, the price will be refreshed if it's older than 80s.\n * Price is always refreshed if this set to 0.\n */\n readonly priceRefreshTriggerToMaxAgePct: number\n /** Percentage of the total borrowed value in an obligation available for liquidation */\n readonly liquidationMaxDebtCloseFactorPct: number\n /** Minimum acceptable unhealthy LTV before max_debt_close_factor_pct becomes 100% */\n readonly insolvencyRiskUnhealthyLtvPct: number\n /** Minimum liquidation value threshold triggering full liquidation for an obligation */\n readonly minFullLiquidationValueThreshold: BN\n /** Max allowed liquidation value in one ix call */\n readonly maxLiquidatableDebtMarketValueAtOnce: BN\n /** Global maximum unhealthy borrow value allowed for any obligation */\n readonly globalUnhealthyBorrowValue: BN\n /** Global maximum allowed borrow value allowed for any obligation */\n readonly globalAllowedBorrowValue: BN\n /** The address of the risk council, in charge of making parameter and risk decisions on behalf of the protocol */\n readonly riskCouncil: PublicKey\n /** Reward points multiplier per obligation type */\n readonly multiplierPointsTagBoost: Array<number>\n /** Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold */\n readonly elevationGroups: Array<types.ElevationGroup>\n readonly elevationGroupPadding: Array<BN>\n /** Min net value accepted to be found in a position after any lending action in an obligation (scaled by quote currency decimals) */\n readonly minNetValueInObligationSf: BN\n readonly minValueSkipLiquidationLtvBfChecks: BN\n readonly padding1: Array<BN>\n\n static readonly discriminator = Buffer.from([\n 246, 114, 50, 98, 72, 157, 28, 120,\n ])\n\n static readonly layout = borsh.struct([\n borsh.u64(\"version\"),\n borsh.u64(\"bumpSeed\"),\n borsh.publicKey(\"lendingMarketOwner\"),\n borsh.publicKey(\"lendingMarketOwnerCached\"),\n borsh.array(borsh.u8(), 32, \"quoteCurrency\"),\n borsh.u16(\"referralFeeBps\"),\n borsh.u8(\"emergencyMode\"),\n borsh.u8(\"autodeleverageEnabled\"),\n borsh.u8(\"borrowDisabled\"),\n borsh.u8(\"priceRefreshTriggerToMaxAgePct\"),\n borsh.u8(\"liquidationMaxDebtCloseFactorPct\"),\n borsh.u8(\"insolvencyRiskUnhealthyLtvPct\"),\n borsh.u64(\"minFullLiquidationValueThreshold\"),\n borsh.u64(\"maxLiquidatableDebtMarketValueAtOnce\"),\n borsh.u64(\"globalUnhealthyBorrowValue\"),\n borsh.u64(\"globalAllowedBorrowValue\"),\n borsh.publicKey(\"riskCouncil\"),\n borsh.array(borsh.u8(), 8, \"multiplierPointsTagBoost\"),\n borsh.array(types.ElevationGroup.layout(), 32, \"elevationGroups\"),\n borsh.array(borsh.u64(), 90, \"elevationGroupPadding\"),\n borsh.u128(\"minNetValueInObligationSf\"),\n borsh.u64(\"minValueSkipLiquidationLtvBfChecks\"),\n borsh.array(borsh.u64(), 177, \"padding1\"),\n ])\n\n constructor(fields: LendingMarketFields) {\n this.version = fields.version\n this.bumpSeed = fields.bumpSeed\n this.lendingMarketOwner = fields.lendingMarketOwner\n this.lendingMarketOwnerCached = fields.lendingMarketOwnerCached\n this.quoteCurrency = fields.quoteCurrency\n this.referralFeeBps = fields.referralFeeBps\n this.emergencyMode = fields.emergencyMode\n this.autodeleverageEnabled = fields.autodeleverageEnabled\n this.borrowDisabled = fields.borrowDisabled\n this.priceRefreshTriggerToMaxAgePct = fields.priceRefreshTriggerToMaxAgePct\n this.liquidationMaxDebtCloseFactorPct =\n fields.liquidationMaxDebtCloseFactorPct\n this.insolvencyRiskUnhealthyLtvPct = fields.insolvencyRiskUnhealthyLtvPct\n this.minFullLiquidationValueThreshold =\n fields.minFullLiquidationValueThreshold\n this.maxLiquidatableDebtMarketValueAtOnce =\n fields.maxLiquidatableDebtMarketValueAtOnce\n this.globalUnhealthyBorrowValue = fields.globalUnhealthyBorrowValue\n this.globalAllowedBorrowValue = fields.globalAllowedBorrowValue\n this.riskCouncil = fields.riskCouncil\n this.multiplierPointsTagBoost = fields.multiplierPointsTagBoost\n this.elevationGroups = fields.elevationGroups.map(\n (item) => new types.ElevationGroup({ ...item })\n )\n this.elevationGroupPadding = fields.elevationGroupPadding\n this.minNetValueInObligationSf = fields.minNetValueInObligationSf\n this.minValueSkipLiquidationLtvBfChecks =\n fields.minValueSkipLiquidationLtvBfChecks\n this.padding1 = fields.padding1\n }\n\n static async fetch(\n c: Connection,\n address: PublicKey,\n programId: PublicKey = PROGRAM_ID\n ): Promise<LendingMarket | null> {\n const info = await c.getAccountInfo(address)\n\n if (info === null) {\n return null\n }\n if (!info.owner.equals(programId)) {\n throw new Error(\"account doesn't belong to this program\")\n }\n\n return this.decode(info.data)\n }\n\n static async fetchMultiple(\n c: Connection,\n addresses: PublicKey[],\n programId: PublicKey = PROGRAM_ID\n ): Promise<Array<LendingMarket | null>> {\n const infos = await c.getMultipleAccountsInfo(addresses)\n\n return infos.map((info) => {\n if (info === null) {\n return null\n }\n if (!info.owner.equals(programId)) {\n throw new Error(\"account doesn't belong to this program\")\n }\n\n return this.decode(info.data)\n })\n }\n\n static decode(data: Buffer): LendingMarket {\n if (!data.slice(0, 8).equals(LendingMarket.discriminator)) {\n throw new Error(\"invalid account discriminator\")\n }\n\n const dec = LendingMarket.layout.decode(data.slice(8))\n\n return new LendingMarket({\n version: dec.version,\n bumpSeed: dec.bumpSeed,\n lendingMarketOwner: dec.lendingMarketOwner,\n lendingMarketOwnerCached: dec.lendingMarketOwnerCached,\n quoteCurrency: dec.quoteCurrency,\n referralFeeBps: dec.referralFeeBps,\n emergencyMode: dec.emergencyMode,\n autodeleverageEnabled: dec.autodeleverageEnabled,\n borrowDisabled: dec.borrowDisabled,\n priceRefreshTriggerToMaxAgePct: dec.priceRefreshTriggerToMaxAgePct,\n liquidationMaxDebtCloseFactorPct: dec.liquidationMaxDebtCloseFactorPct,\n insolvencyRiskUnhealthyLtvPct: dec.insolvencyRiskUnhealthyLtvPct,\n minFullLiquidationValueThreshold: dec.minFullLiquidationValueThreshold,\n maxLiquidatableDebtMarketValueAtOnce:\n dec.maxLiquidatableDebtMarketValueAtOnce,\n globalUnhealthyBorrowValue: dec.globalUnhealthyBorrowValue,\n globalAllowedBorrowValue: dec.globalAllowedBorrowValue,\n riskCouncil: dec.riskCouncil,\n multiplierPointsTagBoost: dec.multiplierPointsTagBoost,\n elevationGroups: dec.elevationGroups.map(\n (\n item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */\n ) => types.ElevationGroup.fromDecoded(item)\n ),\n elevationGroupPadding: dec.elevationGroupPadding,\n minNetValueInObligationSf: dec.minNetValueInObligationSf,\n minValueSkipLiquidationLtvBfChecks:\n dec.minValueSkipLiquidationLtvBfChecks,\n padding1: dec.padding1,\n })\n }\n\n toJSON(): LendingMarketJSON {\n return {\n version: this.version.toString(),\n bumpSeed: this.bumpSeed.toString(),\n lendingMarketOwner: this.lendingMarketOwner.toString(),\n lendingMarketOwnerCached: this.lendingMarketOwnerCached.toString(),\n quoteCurrency: this.quoteCurrency,\n referralFeeBps: this.referralFeeBps,\n emergencyMode: this.emergencyMode,\n autodeleverageEnabled: this.autodeleverageEnabled,\n borrowDisabled: this.borrowDisabled,\n priceRefreshTriggerToMaxAgePct: this.priceRefreshTriggerToMaxAgePct,\n liquidationMaxDebtCloseFactorPct: this.liquidationMaxDebtCloseFactorPct,\n insolvencyRiskUnhealthyLtvPct: this.insolvencyRiskUnhealthyLtvPct,\n minFullLiquidationValueThreshold:\n this.minFullLiquidationValueThreshold.toString(),\n maxLiquidatableDebtMarketValueAtOnce:\n this.maxLiquidatableDebtMarketValueAtOnce.toString(),\n globalUnhealthyBorrowValue: this.globalUnhealthyBorrowValue.toString(),\n globalAllowedBorrowValue: this.globalAllowedBorrowValue.toString(),\n riskCouncil: this.riskCouncil.toString(),\n multiplierPointsTagBoost: this.multiplierPointsTagBoost,\n elevationGroups: this.elevationGroups.map((item) => item.toJSON()),\n elevationGroupPadding: this.elevationGroupPadding.map((item) =>\n item.toString()\n ),\n minNetValueInObligationSf: this.minNetValueInObligationSf.toString(),\n minValueSkipLiquidationLtvBfChecks:\n this.minValueSkipLiquidationLtvBfChecks.toString(),\n padding1: this.padding1.map((item) => item.toString()),\n }\n }\n\n static fromJSON(obj: LendingMarketJSON): LendingMarket {\n return new LendingMarket({\n version: new BN(obj.version),\n bumpSeed: new BN(obj.bumpSeed),\n lendingMarketOwner: new PublicKey(obj.lendingMarketOwner),\n lendingMarketOwnerCached: new PublicKey(obj.lendingMarketOwnerCached),\n quoteCurrency: obj.quoteCurrency,\n referralFeeBps: obj.referralFeeBps,\n emergencyMode: obj.emergencyMode,\n autodeleverageEnabled: obj.autodeleverageEnabled,\n borrowDisabled: obj.borrowDisabled,\n priceRefreshTriggerToMaxAgePct: obj.priceRefreshTriggerToMaxAgePct,\n liquidationMaxDebtCloseFactorPct: obj.liquidationMaxDebtCloseFactorPct,\n insolvencyRiskUnhealthyLtvPct: obj.insolvencyRiskUnhealthyLtvPct,\n minFullLiquidationValueThreshold: new BN(\n obj.minFullLiquidationValueThreshold\n ),\n maxLiquidatableDebtMarketValueAtOnce: new BN(\n obj.maxLiquidatableDebtMarketValueAtOnce\n ),\n globalUnhealthyBorrowValue: new BN(obj.globalUnhealthyBorrowValue),\n globalAllowedBorrowValue: new BN(obj.globalAllowedBorrowValue),\n riskCouncil: new PublicKey(obj.riskCouncil),\n multiplierPointsTagBoost: obj.multiplierPointsTagBoost,\n elevationGroups: obj.elevationGroups.map((item) =>\n types.ElevationGroup.fromJSON(item)\n ),\n elevationGroupPadding: obj.elevationGroupPadding.map(\n (item) => new BN(item)\n ),\n minNetValueInObligationSf: new BN(obj.minNetValueInObligationSf),\n minValueSkipLiquidationLtvBfChecks: new BN(\n obj.minValueSkipLiquidationLtvBfChecks\n ),\n padding1: obj.padding1.map((item) => new BN(item)),\n })\n }\n}\n"]}
1
+ {"version":3,"file":"LendingMarket.js","sourceRoot":"","sources":["../../../src/idl_codegen/accounts/LendingMarket.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAuD;AACvD,kDAAsB,CAAC,wDAAwD;AAC/E,wDAAyC,CAAC,wDAAwD;AAClG,gDAAiC,CAAC,wDAAwD;AAC1F,4CAAyC;AAsGzC,MAAa,aAAa;IA+ExB,YAAY,MAA2B;QACrC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAC7B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA;QAC/B,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAA;QACnD,IAAI,CAAC,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAA;QAC/D,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAA;QACzC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,c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AAC;IACrC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC;IAC9B,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,WAAW,CAAC;IACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,iBAAiB,CAAC;IACjE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,uBAAuB,CAAC;IACrD,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC;IACvC,KAAK,CAAC,GAAG,CAAC,oCAAoC,CAAC;IAC/C,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,UAAU,CAAC;CAC1C,CAAC,CAAA","sourcesContent":["import { PublicKey, Connection } from \"@solana/web3.js\"\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 LendingMarketFields {\n /** Version of lending market */\n version: BN\n /** Bump seed for derived authority address */\n bumpSeed: BN\n /** Owner authority which can add new reserves */\n lendingMarketOwner: PublicKey\n /** Temporary cache of the lending market owner, used in update_lending_market_owner */\n lendingMarketOwnerCached: PublicKey\n /**\n * Currency market prices are quoted in\n * e.g. \"USD\" null padded (`*b\"USD\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\"`) or a SPL token mint pubkey\n */\n quoteCurrency: Array<number>\n /** Referral fee for the lending market, as bps out of the total protocol fee */\n referralFeeBps: number\n emergencyMode: number\n autodeleverageEnabled: number\n borrowDisabled: number\n /**\n * Refresh price from oracle only if it's older than this percentage of the price max age.\n * e.g. if the max age is set to 100s and this is set to 80%, the price will be refreshed if it's older than 80s.\n * Price is always refreshed if this set to 0.\n */\n priceRefreshTriggerToMaxAgePct: number\n /** Percentage of the total borrowed value in an obligation available for liquidation */\n liquidationMaxDebtCloseFactorPct: number\n /** Minimum acceptable unhealthy LTV before max_debt_close_factor_pct becomes 100% */\n insolvencyRiskUnhealthyLtvPct: number\n /** Minimum liquidation value threshold triggering full liquidation for an obligation */\n minFullLiquidationValueThreshold: BN\n /** Max allowed liquidation value in one ix call */\n maxLiquidatableDebtMarketValueAtOnce: BN\n /** Global maximum unhealthy borrow value allowed for any obligation */\n globalUnhealthyBorrowValue: BN\n /** Global maximum allowed borrow value allowed for any obligation */\n globalAllowedBorrowValue: BN\n /** The address of the risk council, in charge of making parameter and risk decisions on behalf of the protocol */\n riskCouncil: PublicKey\n /** [DEPRECATED] Reward points multiplier per obligation type */\n reserved1: Array<number>\n /** Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold */\n elevationGroups: Array<types.ElevationGroupFields>\n elevationGroupPadding: Array<BN>\n /** Min net value accepted to be found in a position after any lending action in an obligation (scaled by quote currency decimals) */\n minNetValueInObligationSf: BN\n minValueSkipLiquidationLtvBfChecks: BN\n padding1: Array<BN>\n}\n\nexport interface LendingMarketJSON {\n /** Version of lending market */\n version: string\n /** Bump seed for derived authority address */\n bumpSeed: string\n /** Owner authority which can add new reserves */\n lendingMarketOwner: string\n /** Temporary cache of the lending market owner, used in update_lending_market_owner */\n lendingMarketOwnerCached: string\n /**\n * Currency market prices are quoted in\n * e.g. \"USD\" null padded (`*b\"USD\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\"`) or a SPL token mint pubkey\n */\n quoteCurrency: Array<number>\n /** Referral fee for the lending market, as bps out of the total protocol fee */\n referralFeeBps: number\n emergencyMode: number\n autodeleverageEnabled: number\n borrowDisabled: number\n /**\n * Refresh price from oracle only if it's older than this percentage of the price max age.\n * e.g. if the max age is set to 100s and this is set to 80%, the price will be refreshed if it's older than 80s.\n * Price is always refreshed if this set to 0.\n */\n priceRefreshTriggerToMaxAgePct: number\n /** Percentage of the total borrowed value in an obligation available for liquidation */\n liquidationMaxDebtCloseFactorPct: number\n /** Minimum acceptable unhealthy LTV before max_debt_close_factor_pct becomes 100% */\n insolvencyRiskUnhealthyLtvPct: number\n /** Minimum liquidation value threshold triggering full liquidation for an obligation */\n minFullLiquidationValueThreshold: string\n /** Max allowed liquidation value in one ix call */\n maxLiquidatableDebtMarketValueAtOnce: string\n /** Global maximum unhealthy borrow value allowed for any obligation */\n globalUnhealthyBorrowValue: string\n /** Global maximum allowed borrow value allowed for any obligation */\n globalAllowedBorrowValue: string\n /** The address of the risk council, in charge of making parameter and risk decisions on behalf of the protocol */\n riskCouncil: string\n /** [DEPRECATED] Reward points multiplier per obligation type */\n reserved1: Array<number>\n /** Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold */\n elevationGroups: Array<types.ElevationGroupJSON>\n elevationGroupPadding: Array<string>\n /** Min net value accepted to be found in a position after any lending action in an obligation (scaled by quote currency decimals) */\n minNetValueInObligationSf: string\n minValueSkipLiquidationLtvBfChecks: string\n padding1: Array<string>\n}\n\nexport class LendingMarket {\n /** Version of lending market */\n readonly version: BN\n /** Bump seed for derived authority address */\n readonly bumpSeed: BN\n /** Owner authority which can add new reserves */\n readonly lendingMarketOwner: PublicKey\n /** Temporary cache of the lending market owner, used in update_lending_market_owner */\n readonly lendingMarketOwnerCached: PublicKey\n /**\n * Currency market prices are quoted in\n * e.g. \"USD\" null padded (`*b\"USD\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\"`) or a SPL token mint pubkey\n */\n readonly quoteCurrency: Array<number>\n /** Referral fee for the lending market, as bps out of the total protocol fee */\n readonly referralFeeBps: number\n readonly emergencyMode: number\n readonly autodeleverageEnabled: number\n readonly borrowDisabled: number\n /**\n * Refresh price from oracle only if it's older than this percentage of the price max age.\n * e.g. if the max age is set to 100s and this is set to 80%, the price will be refreshed if it's older than 80s.\n * Price is always refreshed if this set to 0.\n */\n readonly priceRefreshTriggerToMaxAgePct: number\n /** Percentage of the total borrowed value in an obligation available for liquidation */\n readonly liquidationMaxDebtCloseFactorPct: number\n /** Minimum acceptable unhealthy LTV before max_debt_close_factor_pct becomes 100% */\n readonly insolvencyRiskUnhealthyLtvPct: number\n /** Minimum liquidation value threshold triggering full liquidation for an obligation */\n readonly minFullLiquidationValueThreshold: BN\n /** Max allowed liquidation value in one ix call */\n readonly maxLiquidatableDebtMarketValueAtOnce: BN\n /** Global maximum unhealthy borrow value allowed for any obligation */\n readonly globalUnhealthyBorrowValue: BN\n /** Global maximum allowed borrow value allowed for any obligation */\n readonly globalAllowedBorrowValue: BN\n /** The address of the risk council, in charge of making parameter and risk decisions on behalf of the protocol */\n readonly riskCouncil: PublicKey\n /** [DEPRECATED] Reward points multiplier per obligation type */\n readonly reserved1: Array<number>\n /** Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold */\n readonly elevationGroups: Array<types.ElevationGroup>\n readonly elevationGroupPadding: Array<BN>\n /** Min net value accepted to be found in a position after any lending action in an obligation (scaled by quote currency decimals) */\n readonly minNetValueInObligationSf: BN\n readonly minValueSkipLiquidationLtvBfChecks: BN\n readonly padding1: Array<BN>\n\n static readonly discriminator = Buffer.from([\n 246, 114, 50, 98, 72, 157, 28, 120,\n ])\n\n static readonly layout = borsh.struct([\n borsh.u64(\"version\"),\n borsh.u64(\"bumpSeed\"),\n borsh.publicKey(\"lendingMarketOwner\"),\n borsh.publicKey(\"lendingMarketOwnerCached\"),\n borsh.array(borsh.u8(), 32, \"quoteCurrency\"),\n borsh.u16(\"referralFeeBps\"),\n borsh.u8(\"emergencyMode\"),\n borsh.u8(\"autodeleverageEnabled\"),\n borsh.u8(\"borrowDisabled\"),\n borsh.u8(\"priceRefreshTriggerToMaxAgePct\"),\n borsh.u8(\"liquidationMaxDebtCloseFactorPct\"),\n borsh.u8(\"insolvencyRiskUnhealthyLtvPct\"),\n borsh.u64(\"minFullLiquidationValueThreshold\"),\n borsh.u64(\"maxLiquidatableDebtMarketValueAtOnce\"),\n borsh.u64(\"globalUnhealthyBorrowValue\"),\n borsh.u64(\"globalAllowedBorrowValue\"),\n borsh.publicKey(\"riskCouncil\"),\n borsh.array(borsh.u8(), 8, \"reserved1\"),\n borsh.array(types.ElevationGroup.layout(), 32, \"elevationGroups\"),\n borsh.array(borsh.u64(), 90, \"elevationGroupPadding\"),\n borsh.u128(\"minNetValueInObligationSf\"),\n borsh.u64(\"minValueSkipLiquidationLtvBfChecks\"),\n borsh.array(borsh.u64(), 177, \"padding1\"),\n ])\n\n constructor(fields: LendingMarketFields) {\n this.version = fields.version\n this.bumpSeed = fields.bumpSeed\n this.lendingMarketOwner = fields.lendingMarketOwner\n this.lendingMarketOwnerCached = fields.lendingMarketOwnerCached\n this.quoteCurrency = fields.quoteCurrency\n this.referralFeeBps = fields.referralFeeBps\n this.emergencyMode = fields.emergencyMode\n this.autodeleverageEnabled = fields.autodeleverageEnabled\n this.borrowDisabled = fields.borrowDisabled\n this.priceRefreshTriggerToMaxAgePct = fields.priceRefreshTriggerToMaxAgePct\n this.liquidationMaxDebtCloseFactorPct =\n fields.liquidationMaxDebtCloseFactorPct\n this.insolvencyRiskUnhealthyLtvPct = fields.insolvencyRiskUnhealthyLtvPct\n this.minFullLiquidationValueThreshold =\n fields.minFullLiquidationValueThreshold\n this.maxLiquidatableDebtMarketValueAtOnce =\n fields.maxLiquidatableDebtMarketValueAtOnce\n this.globalUnhealthyBorrowValue = fields.globalUnhealthyBorrowValue\n this.globalAllowedBorrowValue = fields.globalAllowedBorrowValue\n this.riskCouncil = fields.riskCouncil\n this.reserved1 = fields.reserved1\n this.elevationGroups = fields.elevationGroups.map(\n (item) => new types.ElevationGroup({ ...item })\n )\n this.elevationGroupPadding = fields.elevationGroupPadding\n this.minNetValueInObligationSf = fields.minNetValueInObligationSf\n this.minValueSkipLiquidationLtvBfChecks =\n fields.minValueSkipLiquidationLtvBfChecks\n this.padding1 = fields.padding1\n }\n\n static async fetch(\n c: Connection,\n address: PublicKey,\n programId: PublicKey = PROGRAM_ID\n ): Promise<LendingMarket | null> {\n const info = await c.getAccountInfo(address)\n\n if (info === null) {\n return null\n }\n if (!info.owner.equals(programId)) {\n throw new Error(\"account doesn't belong to this program\")\n }\n\n return this.decode(info.data)\n }\n\n static async fetchMultiple(\n c: Connection,\n addresses: PublicKey[],\n programId: PublicKey = PROGRAM_ID\n ): Promise<Array<LendingMarket | null>> {\n const infos = await c.getMultipleAccountsInfo(addresses)\n\n return infos.map((info) => {\n if (info === null) {\n return null\n }\n if (!info.owner.equals(programId)) {\n throw new Error(\"account doesn't belong to this program\")\n }\n\n return this.decode(info.data)\n })\n }\n\n static decode(data: Buffer): LendingMarket {\n if (!data.slice(0, 8).equals(LendingMarket.discriminator)) {\n throw new Error(\"invalid account discriminator\")\n }\n\n const dec = LendingMarket.layout.decode(data.slice(8))\n\n return new LendingMarket({\n version: dec.version,\n bumpSeed: dec.bumpSeed,\n lendingMarketOwner: dec.lendingMarketOwner,\n lendingMarketOwnerCached: dec.lendingMarketOwnerCached,\n quoteCurrency: dec.quoteCurrency,\n referralFeeBps: dec.referralFeeBps,\n emergencyMode: dec.emergencyMode,\n autodeleverageEnabled: dec.autodeleverageEnabled,\n borrowDisabled: dec.borrowDisabled,\n priceRefreshTriggerToMaxAgePct: dec.priceRefreshTriggerToMaxAgePct,\n liquidationMaxDebtCloseFactorPct: dec.liquidationMaxDebtCloseFactorPct,\n insolvencyRiskUnhealthyLtvPct: dec.insolvencyRiskUnhealthyLtvPct,\n minFullLiquidationValueThreshold: dec.minFullLiquidationValueThreshold,\n maxLiquidatableDebtMarketValueAtOnce:\n dec.maxLiquidatableDebtMarketValueAtOnce,\n globalUnhealthyBorrowValue: dec.globalUnhealthyBorrowValue,\n globalAllowedBorrowValue: dec.globalAllowedBorrowValue,\n riskCouncil: dec.riskCouncil,\n reserved1: dec.reserved1,\n elevationGroups: dec.elevationGroups.map(\n (\n item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */\n ) => types.ElevationGroup.fromDecoded(item)\n ),\n elevationGroupPadding: dec.elevationGroupPadding,\n minNetValueInObligationSf: dec.minNetValueInObligationSf,\n minValueSkipLiquidationLtvBfChecks:\n dec.minValueSkipLiquidationLtvBfChecks,\n padding1: dec.padding1,\n })\n }\n\n toJSON(): LendingMarketJSON {\n return {\n version: this.version.toString(),\n bumpSeed: this.bumpSeed.toString(),\n lendingMarketOwner: this.lendingMarketOwner.toString(),\n lendingMarketOwnerCached: this.lendingMarketOwnerCached.toString(),\n quoteCurrency: this.quoteCurrency,\n referralFeeBps: this.referralFeeBps,\n emergencyMode: this.emergencyMode,\n autodeleverageEnabled: this.autodeleverageEnabled,\n borrowDisabled: this.borrowDisabled,\n priceRefreshTriggerToMaxAgePct: this.priceRefreshTriggerToMaxAgePct,\n liquidationMaxDebtCloseFactorPct: this.liquidationMaxDebtCloseFactorPct,\n insolvencyRiskUnhealthyLtvPct: this.insolvencyRiskUnhealthyLtvPct,\n minFullLiquidationValueThreshold:\n this.minFullLiquidationValueThreshold.toString(),\n maxLiquidatableDebtMarketValueAtOnce:\n this.maxLiquidatableDebtMarketValueAtOnce.toString(),\n globalUnhealthyBorrowValue: this.globalUnhealthyBorrowValue.toString(),\n globalAllowedBorrowValue: this.globalAllowedBorrowValue.toString(),\n riskCouncil: this.riskCouncil.toString(),\n reserved1: this.reserved1,\n elevationGroups: this.elevationGroups.map((item) => item.toJSON()),\n elevationGroupPadding: this.elevationGroupPadding.map((item) =>\n item.toString()\n ),\n minNetValueInObligationSf: this.minNetValueInObligationSf.toString(),\n minValueSkipLiquidationLtvBfChecks:\n this.minValueSkipLiquidationLtvBfChecks.toString(),\n padding1: this.padding1.map((item) => item.toString()),\n }\n }\n\n static fromJSON(obj: LendingMarketJSON): LendingMarket {\n return new LendingMarket({\n version: new BN(obj.version),\n bumpSeed: new BN(obj.bumpSeed),\n lendingMarketOwner: new PublicKey(obj.lendingMarketOwner),\n lendingMarketOwnerCached: new PublicKey(obj.lendingMarketOwnerCached),\n quoteCurrency: obj.quoteCurrency,\n referralFeeBps: obj.referralFeeBps,\n emergencyMode: obj.emergencyMode,\n autodeleverageEnabled: obj.autodeleverageEnabled,\n borrowDisabled: obj.borrowDisabled,\n priceRefreshTriggerToMaxAgePct: obj.priceRefreshTriggerToMaxAgePct,\n liquidationMaxDebtCloseFactorPct: obj.liquidationMaxDebtCloseFactorPct,\n insolvencyRiskUnhealthyLtvPct: obj.insolvencyRiskUnhealthyLtvPct,\n minFullLiquidationValueThreshold: new BN(\n obj.minFullLiquidationValueThreshold\n ),\n maxLiquidatableDebtMarketValueAtOnce: new BN(\n obj.maxLiquidatableDebtMarketValueAtOnce\n ),\n globalUnhealthyBorrowValue: new BN(obj.globalUnhealthyBorrowValue),\n globalAllowedBorrowValue: new BN(obj.globalAllowedBorrowValue),\n riskCouncil: new PublicKey(obj.riskCouncil),\n reserved1: obj.reserved1,\n elevationGroups: obj.elevationGroups.map((item) =>\n types.ElevationGroup.fromJSON(item)\n ),\n elevationGroupPadding: obj.elevationGroupPadding.map(\n (item) => new BN(item)\n ),\n minNetValueInObligationSf: new BN(obj.minNetValueInObligationSf),\n minValueSkipLiquidationLtvBfChecks: new BN(\n obj.minValueSkipLiquidationLtvBfChecks\n ),\n padding1: obj.padding1.map((item) => new BN(item)),\n })\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- export type CustomError = InvalidMarketAuthority | InvalidMarketOwner | InvalidAccountOwner | InvalidAmount | InvalidConfig | InvalidSigner | InvalidAccountInput | MathOverflow | InsufficientLiquidity | ReserveStale | WithdrawTooSmall | WithdrawTooLarge | BorrowTooSmall | BorrowTooLarge | RepayTooSmall | LiquidationTooSmall | ObligationHealthy | ObligationStale | ObligationReserveLimit | InvalidObligationOwner | ObligationDepositsEmpty | ObligationBorrowsEmpty | ObligationDepositsZero | ObligationBorrowsZero | InvalidObligationCollateral | InvalidObligationLiquidity | ObligationCollateralEmpty | ObligationLiquidityEmpty | NegativeInterestRate | InvalidOracleConfig | InsufficientProtocolFeesToRedeem | FlashBorrowCpi | NoFlashRepayFound | InvalidFlashRepay | FlashRepayCpi | MultipleFlashBorrows | FlashLoansDisabled | SwitchboardV2Error | CouldNotDeserializeScope | PriceTooOld | PriceTooDivergentFromTwap | InvalidTwapPrice | GlobalEmergencyMode | InvalidFlag | PriceNotValid | PriceIsBiggerThanHeuristic | PriceIsLowerThanHeuristic | PriceIsZero | PriceConfidenceTooWide | IntegerOverflow | NoFarmForReserve | IncorrectInstructionInPosition | NoPriceFound | InvalidTwapConfig | InvalidPythPriceAccount | InvalidSwitchboardAccount | InvalidScopePriceAccount | ObligationCollateralLtvZero | InvalidObligationSeedsValue | InvalidObligationId | InvalidBorrowRateCurvePoint | InvalidUtilizationRate | CannotSocializeObligationWithCollateral | ObligationEmpty | WithdrawalCapReached | LastTimestampGreaterThanCurrent | LiquidationRewardTooSmall | IsolatedAssetTierViolation | InconsistentElevationGroup | InvalidElevationGroup | InvalidElevationGroupConfig | UnhealthyElevationGroupLtv | ElevationGroupNewLoansDisabled | ReserveDeprecated | ReferrerAccountNotInitialized | ReferrerAccountMintMissmatch | ReferrerAccountWrongAddress | ReferrerAccountReferrerMissmatch | ReferrerAccountMissing | InsufficientReferralFeesToRedeem | CpiDisabled | ShortUrlNotAsciiAlphanumeric | ReserveObsolete | ElevationGroupAlreadyActivated | ObligationInDeprecatedReserve | ReferrerStateOwnerMismatch | UserMetadataOwnerAlreadySet | CollateralNonLiquidatable | BorrowingDisabled | BorrowLimitExceeded | DepositLimitExceeded | BorrowingDisabledOutsideElevationGroup | NetValueRemainingTooSmall | WorseLTVBlocked | LiabilitiesBiggerThanAssets | ReserveTokenBalanceMismatch | ReserveVaultBalanceMismatch | ReserveAccountingMismatch | BorrowingAboveUtilizationRateDisabled | LiquidationBorrowFactorPriority | LiquidationLowestLTVPriority | ElevationGroupBorrowLimitExceeded | ElevationGroupWithoutDebtReserve | ElevationGroupMaxCollateralReserveZero | ElevationGroupHasAnotherDebtReserve | ElevationGroupDebtReserveAsCollateral | ObligationCollateralExceedsElevationGroupLimit | ObligationElevationGroupMultipleDebtReserve | UnsupportedTokenExtension;
1
+ export type CustomError = InvalidMarketAuthority | InvalidMarketOwner | InvalidAccountOwner | InvalidAmount | InvalidConfig | InvalidSigner | InvalidAccountInput | MathOverflow | InsufficientLiquidity | ReserveStale | WithdrawTooSmall | WithdrawTooLarge | BorrowTooSmall | BorrowTooLarge | RepayTooSmall | LiquidationTooSmall | ObligationHealthy | ObligationStale | ObligationReserveLimit | InvalidObligationOwner | ObligationDepositsEmpty | ObligationBorrowsEmpty | ObligationDepositsZero | ObligationBorrowsZero | InvalidObligationCollateral | InvalidObligationLiquidity | ObligationCollateralEmpty | ObligationLiquidityEmpty | NegativeInterestRate | InvalidOracleConfig | InsufficientProtocolFeesToRedeem | FlashBorrowCpi | NoFlashRepayFound | InvalidFlashRepay | FlashRepayCpi | MultipleFlashBorrows | FlashLoansDisabled | SwitchboardV2Error | CouldNotDeserializeScope | PriceTooOld | PriceTooDivergentFromTwap | InvalidTwapPrice | GlobalEmergencyMode | InvalidFlag | PriceNotValid | PriceIsBiggerThanHeuristic | PriceIsLowerThanHeuristic | PriceIsZero | PriceConfidenceTooWide | IntegerOverflow | NoFarmForReserve | IncorrectInstructionInPosition | NoPriceFound | InvalidTwapConfig | InvalidPythPriceAccount | InvalidSwitchboardAccount | InvalidScopePriceAccount | ObligationCollateralLtvZero | InvalidObligationSeedsValue | InvalidObligationId | InvalidBorrowRateCurvePoint | InvalidUtilizationRate | CannotSocializeObligationWithCollateral | ObligationEmpty | WithdrawalCapReached | LastTimestampGreaterThanCurrent | LiquidationRewardTooSmall | IsolatedAssetTierViolation | InconsistentElevationGroup | InvalidElevationGroup | InvalidElevationGroupConfig | UnhealthyElevationGroupLtv | ElevationGroupNewLoansDisabled | ReserveDeprecated | ReferrerAccountNotInitialized | ReferrerAccountMintMissmatch | ReferrerAccountWrongAddress | ReferrerAccountReferrerMissmatch | ReferrerAccountMissing | InsufficientReferralFeesToRedeem | CpiDisabled | ShortUrlNotAsciiAlphanumeric | ReserveObsolete | ElevationGroupAlreadyActivated | ObligationInDeprecatedReserve | ReferrerStateOwnerMismatch | UserMetadataOwnerAlreadySet | CollateralNonLiquidatable | BorrowingDisabled | BorrowLimitExceeded | DepositLimitExceeded | BorrowingDisabledOutsideElevationGroup | NetValueRemainingTooSmall | WorseLTVBlocked | LiabilitiesBiggerThanAssets | ReserveTokenBalanceMismatch | ReserveVaultBalanceMismatch | ReserveAccountingMismatch | BorrowingAboveUtilizationRateDisabled | LiquidationBorrowFactorPriority | LiquidationLowestLTVPriority | ElevationGroupBorrowLimitExceeded | ElevationGroupWithoutDebtReserve | ElevationGroupMaxCollateralReserveZero | ElevationGroupHasAnotherDebtReserve | ElevationGroupDebtReserveAsCollateral | ObligationCollateralExceedsElevationGroupLimit | ObligationElevationGroupMultipleDebtReserve | UnsupportedTokenExtension | InvalidTokenAccount | DepositDisabledOutsideElevationGroup | CannotCalculateReferralAmountDueToSlotsMismatch;
2
2
  export declare class InvalidMarketAuthority extends Error {
3
3
  readonly logs?: string[] | undefined;
4
4
  static readonly code = 6000;
@@ -871,4 +871,28 @@ export declare class UnsupportedTokenExtension extends Error {
871
871
  readonly msg = "Mint has a token (2022) extension that is not supported";
872
872
  constructor(logs?: string[] | undefined);
873
873
  }
874
+ export declare class InvalidTokenAccount extends Error {
875
+ readonly logs?: string[] | undefined;
876
+ static readonly code = 6109;
877
+ readonly code = 6109;
878
+ readonly name = "InvalidTokenAccount";
879
+ readonly msg = "Can't have an spl token mint with a t22 account";
880
+ constructor(logs?: string[] | undefined);
881
+ }
882
+ export declare class DepositDisabledOutsideElevationGroup extends Error {
883
+ readonly logs?: string[] | undefined;
884
+ static readonly code = 6110;
885
+ readonly code = 6110;
886
+ readonly name = "DepositDisabledOutsideElevationGroup";
887
+ readonly msg = "Can't deposit into this reserve outside elevation group";
888
+ constructor(logs?: string[] | undefined);
889
+ }
890
+ export declare class CannotCalculateReferralAmountDueToSlotsMismatch extends Error {
891
+ readonly logs?: string[] | undefined;
892
+ static readonly code = 6111;
893
+ readonly code = 6111;
894
+ readonly name = "CannotCalculateReferralAmountDueToSlotsMismatch";
895
+ readonly msg = "Cannot calculate referral amount due to slots mismatch";
896
+ constructor(logs?: string[] | undefined);
897
+ }
874
898
  export declare function fromCode(code: number, logs?: string[]): CustomError | null;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IntegerOverflow = exports.PriceConfidenceTooWide = exports.PriceIsZero = exports.PriceIsLowerThanHeuristic = exports.PriceIsBiggerThanHeuristic = exports.PriceNotValid = exports.InvalidFlag = exports.GlobalEmergencyMode = exports.InvalidTwapPrice = exports.PriceTooDivergentFromTwap = exports.PriceTooOld = exports.CouldNotDeserializeScope = exports.SwitchboardV2Error = exports.FlashLoansDisabled = exports.MultipleFlashBorrows = exports.FlashRepayCpi = exports.InvalidFlashRepay = exports.NoFlashRepayFound = exports.FlashBorrowCpi = exports.InsufficientProtocolFeesToRedeem = exports.InvalidOracleConfig = exports.NegativeInterestRate = exports.ObligationLiquidityEmpty = exports.ObligationCollateralEmpty = exports.InvalidObligationLiquidity = exports.InvalidObligationCollateral = exports.ObligationBorrowsZero = exports.ObligationDepositsZero = exports.ObligationBorrowsEmpty = exports.ObligationDepositsEmpty = exports.InvalidObligationOwner = exports.ObligationReserveLimit = exports.ObligationStale = exports.ObligationHealthy = exports.LiquidationTooSmall = exports.RepayTooSmall = exports.BorrowTooLarge = exports.BorrowTooSmall = exports.WithdrawTooLarge = exports.WithdrawTooSmall = exports.ReserveStale = exports.InsufficientLiquidity = exports.MathOverflow = exports.InvalidAccountInput = exports.InvalidSigner = exports.InvalidConfig = exports.InvalidAmount = exports.InvalidAccountOwner = exports.InvalidMarketOwner = exports.InvalidMarketAuthority = void 0;
4
4
  exports.LiquidationBorrowFactorPriority = exports.BorrowingAboveUtilizationRateDisabled = exports.ReserveAccountingMismatch = exports.ReserveVaultBalanceMismatch = exports.ReserveTokenBalanceMismatch = exports.LiabilitiesBiggerThanAssets = exports.WorseLTVBlocked = exports.NetValueRemainingTooSmall = exports.BorrowingDisabledOutsideElevationGroup = exports.DepositLimitExceeded = exports.BorrowLimitExceeded = exports.BorrowingDisabled = exports.CollateralNonLiquidatable = exports.UserMetadataOwnerAlreadySet = exports.ReferrerStateOwnerMismatch = exports.ObligationInDeprecatedReserve = exports.ElevationGroupAlreadyActivated = exports.ReserveObsolete = exports.ShortUrlNotAsciiAlphanumeric = exports.CpiDisabled = exports.InsufficientReferralFeesToRedeem = exports.ReferrerAccountMissing = exports.ReferrerAccountReferrerMissmatch = exports.ReferrerAccountWrongAddress = exports.ReferrerAccountMintMissmatch = exports.ReferrerAccountNotInitialized = exports.ReserveDeprecated = exports.ElevationGroupNewLoansDisabled = exports.UnhealthyElevationGroupLtv = exports.InvalidElevationGroupConfig = exports.InvalidElevationGroup = exports.InconsistentElevationGroup = exports.IsolatedAssetTierViolation = exports.LiquidationRewardTooSmall = exports.LastTimestampGreaterThanCurrent = exports.WithdrawalCapReached = exports.ObligationEmpty = exports.CannotSocializeObligationWithCollateral = exports.InvalidUtilizationRate = exports.InvalidBorrowRateCurvePoint = exports.InvalidObligationId = exports.InvalidObligationSeedsValue = exports.ObligationCollateralLtvZero = exports.InvalidScopePriceAccount = exports.InvalidSwitchboardAccount = exports.InvalidPythPriceAccount = exports.InvalidTwapConfig = exports.NoPriceFound = exports.IncorrectInstructionInPosition = exports.NoFarmForReserve = void 0;
5
- exports.UnsupportedTokenExtension = exports.ObligationElevationGroupMultipleDebtReserve = exports.ObligationCollateralExceedsElevationGroupLimit = exports.ElevationGroupDebtReserveAsCollateral = exports.ElevationGroupHasAnotherDebtReserve = exports.ElevationGroupMaxCollateralReserveZero = exports.ElevationGroupWithoutDebtReserve = exports.ElevationGroupBorrowLimitExceeded = exports.LiquidationLowestLTVPriority = void 0;
5
+ exports.CannotCalculateReferralAmountDueToSlotsMismatch = exports.DepositDisabledOutsideElevationGroup = exports.InvalidTokenAccount = exports.UnsupportedTokenExtension = exports.ObligationElevationGroupMultipleDebtReserve = exports.ObligationCollateralExceedsElevationGroupLimit = exports.ElevationGroupDebtReserveAsCollateral = exports.ElevationGroupHasAnotherDebtReserve = exports.ElevationGroupMaxCollateralReserveZero = exports.ElevationGroupWithoutDebtReserve = exports.ElevationGroupBorrowLimitExceeded = exports.LiquidationLowestLTVPriority = void 0;
6
6
  exports.fromCode = fromCode;
7
7
  class InvalidMarketAuthority extends Error {
8
8
  constructor(logs) {
@@ -1203,6 +1203,39 @@ class UnsupportedTokenExtension extends Error {
1203
1203
  }
1204
1204
  exports.UnsupportedTokenExtension = UnsupportedTokenExtension;
1205
1205
  UnsupportedTokenExtension.code = 6108;
1206
+ class InvalidTokenAccount extends Error {
1207
+ constructor(logs) {
1208
+ super("6109: Can't have an spl token mint with a t22 account");
1209
+ this.logs = logs;
1210
+ this.code = 6109;
1211
+ this.name = "InvalidTokenAccount";
1212
+ this.msg = "Can't have an spl token mint with a t22 account";
1213
+ }
1214
+ }
1215
+ exports.InvalidTokenAccount = InvalidTokenAccount;
1216
+ InvalidTokenAccount.code = 6109;
1217
+ class DepositDisabledOutsideElevationGroup extends Error {
1218
+ constructor(logs) {
1219
+ super("6110: Can't deposit into this reserve outside elevation group");
1220
+ this.logs = logs;
1221
+ this.code = 6110;
1222
+ this.name = "DepositDisabledOutsideElevationGroup";
1223
+ this.msg = "Can't deposit into this reserve outside elevation group";
1224
+ }
1225
+ }
1226
+ exports.DepositDisabledOutsideElevationGroup = DepositDisabledOutsideElevationGroup;
1227
+ DepositDisabledOutsideElevationGroup.code = 6110;
1228
+ class CannotCalculateReferralAmountDueToSlotsMismatch extends Error {
1229
+ constructor(logs) {
1230
+ super("6111: Cannot calculate referral amount due to slots mismatch");
1231
+ this.logs = logs;
1232
+ this.code = 6111;
1233
+ this.name = "CannotCalculateReferralAmountDueToSlotsMismatch";
1234
+ this.msg = "Cannot calculate referral amount due to slots mismatch";
1235
+ }
1236
+ }
1237
+ exports.CannotCalculateReferralAmountDueToSlotsMismatch = CannotCalculateReferralAmountDueToSlotsMismatch;
1238
+ CannotCalculateReferralAmountDueToSlotsMismatch.code = 6111;
1206
1239
  function fromCode(code, logs) {
1207
1240
  switch (code) {
1208
1241
  case 6000:
@@ -1423,6 +1456,12 @@ function fromCode(code, logs) {
1423
1456
  return new ObligationElevationGroupMultipleDebtReserve(logs);
1424
1457
  case 6108:
1425
1458
  return new UnsupportedTokenExtension(logs);
1459
+ case 6109:
1460
+ return new InvalidTokenAccount(logs);
1461
+ case 6110:
1462
+ return new DepositDisabledOutsideElevationGroup(logs);
1463
+ case 6111:
1464
+ return new CannotCalculateReferralAmountDueToSlotsMismatch(logs);
1426
1465
  }
1427
1466
  return null;
1428
1467
  }