@kamino-finance/klend-sdk 7.1.4-beta.0 → 7.1.5

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 (241) hide show
  1. package/dist/@codegen/klend/accounts/LendingMarket.d.ts +3 -144
  2. package/dist/@codegen/klend/accounts/LendingMarket.d.ts.map +1 -1
  3. package/dist/@codegen/klend/accounts/LendingMarket.js +3 -105
  4. package/dist/@codegen/klend/accounts/LendingMarket.js.map +1 -1
  5. package/dist/@codegen/klend/accounts/Obligation.d.ts +15 -30
  6. package/dist/@codegen/klend/accounts/Obligation.d.ts.map +1 -1
  7. package/dist/@codegen/klend/accounts/Obligation.js +21 -31
  8. package/dist/@codegen/klend/accounts/Obligation.js.map +1 -1
  9. package/dist/@codegen/klend/accounts/Reserve.d.ts +0 -6
  10. package/dist/@codegen/klend/accounts/Reserve.d.ts.map +1 -1
  11. package/dist/@codegen/klend/accounts/Reserve.js +2 -9
  12. package/dist/@codegen/klend/accounts/Reserve.js.map +1 -1
  13. package/dist/@codegen/klend/accounts/UserState.d.ts +75 -0
  14. package/dist/@codegen/klend/accounts/UserState.d.ts.map +1 -1
  15. package/dist/@codegen/klend/accounts/UserState.js +25 -0
  16. package/dist/@codegen/klend/accounts/UserState.js.map +1 -1
  17. package/dist/@codegen/klend/accounts/index.d.ts +0 -6
  18. package/dist/@codegen/klend/accounts/index.d.ts.map +1 -1
  19. package/dist/@codegen/klend/accounts/index.js +1 -7
  20. package/dist/@codegen/klend/accounts/index.js.map +1 -1
  21. package/dist/@codegen/klend/errors/custom.d.ts +2 -226
  22. package/dist/@codegen/klend/errors/custom.d.ts.map +1 -1
  23. package/dist/@codegen/klend/errors/custom.js +3 -396
  24. package/dist/@codegen/klend/errors/custom.js.map +1 -1
  25. package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts +2 -1
  26. package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts.map +1 -1
  27. package/dist/@codegen/klend/instructions/idlMissingTypes.js +2 -6
  28. package/dist/@codegen/klend/instructions/idlMissingTypes.js.map +1 -1
  29. package/dist/@codegen/klend/instructions/index.d.ts +0 -16
  30. package/dist/@codegen/klend/instructions/index.d.ts.map +1 -1
  31. package/dist/@codegen/klend/instructions/index.js +1 -18
  32. package/dist/@codegen/klend/instructions/index.js.map +1 -1
  33. package/dist/@codegen/klend/instructions/initReserve.d.ts +1 -1
  34. package/dist/@codegen/klend/instructions/initReserve.d.ts.map +1 -1
  35. package/dist/@codegen/klend/instructions/initReserve.js +5 -1
  36. package/dist/@codegen/klend/instructions/initReserve.js.map +1 -1
  37. package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.js +1 -1
  38. package/dist/@codegen/klend/instructions/updateGlobalConfig.d.ts +1 -1
  39. package/dist/@codegen/klend/instructions/updateGlobalConfig.d.ts.map +1 -1
  40. package/dist/@codegen/klend/instructions/updateGlobalConfig.js +0 -1
  41. package/dist/@codegen/klend/instructions/updateGlobalConfig.js.map +1 -1
  42. package/dist/@codegen/klend/instructions/updateReserveConfig.d.ts +1 -1
  43. package/dist/@codegen/klend/instructions/updateReserveConfig.d.ts.map +1 -1
  44. package/dist/@codegen/klend/instructions/updateReserveConfig.js +0 -1
  45. package/dist/@codegen/klend/instructions/updateReserveConfig.js.map +1 -1
  46. package/dist/@codegen/klend/instructions/withdrawObligationCollateral.js +1 -1
  47. package/dist/@codegen/klend/instructions/withdrawObligationCollateralV2.js +1 -1
  48. package/dist/@codegen/klend/types/AssetTier.d.ts +45 -0
  49. package/dist/@codegen/klend/types/AssetTier.d.ts.map +1 -0
  50. package/dist/@codegen/klend/types/AssetTier.js +132 -0
  51. package/dist/@codegen/klend/types/AssetTier.js.map +1 -0
  52. package/dist/@codegen/klend/types/ObligationLiquidity.d.ts +5 -35
  53. package/dist/@codegen/klend/types/ObligationLiquidity.d.ts.map +1 -1
  54. package/dist/@codegen/klend/types/ObligationLiquidity.js +7 -17
  55. package/dist/@codegen/klend/types/ObligationLiquidity.js.map +1 -1
  56. package/dist/@codegen/klend/types/ObligationOrder.d.ts +4 -4
  57. package/dist/@codegen/klend/types/ObligationOrder.js +2 -2
  58. package/dist/@codegen/klend/types/ReserveConfig.d.ts +29 -141
  59. package/dist/@codegen/klend/types/ReserveConfig.d.ts.map +1 -1
  60. package/dist/@codegen/klend/types/ReserveConfig.js +25 -89
  61. package/dist/@codegen/klend/types/ReserveConfig.js.map +1 -1
  62. package/dist/@codegen/klend/types/ReserveFees.d.ts +8 -8
  63. package/dist/@codegen/klend/types/ReserveFees.d.ts.map +1 -1
  64. package/dist/@codegen/klend/types/ReserveFees.js +8 -8
  65. package/dist/@codegen/klend/types/ReserveFees.js.map +1 -1
  66. package/dist/@codegen/klend/types/ReserveLiquidity.d.ts +8 -26
  67. package/dist/@codegen/klend/types/ReserveLiquidity.d.ts.map +1 -1
  68. package/dist/@codegen/klend/types/ReserveLiquidity.js +8 -14
  69. package/dist/@codegen/klend/types/ReserveLiquidity.js.map +1 -1
  70. package/dist/@codegen/klend/types/UpdateConfigMode.d.ts +14 -92
  71. package/dist/@codegen/klend/types/UpdateConfigMode.d.ts.map +1 -1
  72. package/dist/@codegen/klend/types/UpdateConfigMode.js +23 -168
  73. package/dist/@codegen/klend/types/UpdateConfigMode.js.map +1 -1
  74. package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts +0 -130
  75. package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts.map +1 -1
  76. package/dist/@codegen/klend/types/UpdateLendingMarketMode.js +1 -241
  77. package/dist/@codegen/klend/types/UpdateLendingMarketMode.js.map +1 -1
  78. package/dist/@codegen/klend/types/index.d.ts +8 -10
  79. package/dist/@codegen/klend/types/index.d.ts.map +1 -1
  80. package/dist/@codegen/klend/types/index.js +3 -7
  81. package/dist/@codegen/klend/types/index.js.map +1 -1
  82. package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts +4 -9
  83. package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts.map +1 -1
  84. package/dist/@codegen/klend/zero_padding/ObligationZP.js +13 -22
  85. package/dist/@codegen/klend/zero_padding/ObligationZP.js.map +1 -1
  86. package/dist/classes/action.d.ts +3 -30
  87. package/dist/classes/action.d.ts.map +1 -1
  88. package/dist/classes/action.js +10 -364
  89. package/dist/classes/action.js.map +1 -1
  90. package/dist/classes/manager.d.ts +3 -2
  91. package/dist/classes/manager.d.ts.map +1 -1
  92. package/dist/classes/manager.js +3 -12
  93. package/dist/classes/manager.js.map +1 -1
  94. package/dist/classes/market.d.ts +2 -6
  95. package/dist/classes/market.d.ts.map +1 -1
  96. package/dist/classes/market.js +6 -26
  97. package/dist/classes/market.js.map +1 -1
  98. package/dist/classes/obligation.js +1 -1
  99. package/dist/classes/obligation.js.map +1 -1
  100. package/dist/classes/reserve.d.ts.map +1 -1
  101. package/dist/classes/reserve.js +7 -13
  102. package/dist/classes/reserve.js.map +1 -1
  103. package/dist/classes/unstakingPool.d.ts +3 -20
  104. package/dist/classes/unstakingPool.d.ts.map +1 -1
  105. package/dist/classes/unstakingPool.js +8 -62
  106. package/dist/classes/unstakingPool.js.map +1 -1
  107. package/dist/classes/vault.d.ts +2 -1
  108. package/dist/classes/vault.d.ts.map +1 -1
  109. package/dist/classes/vault.js +59 -38
  110. package/dist/classes/vault.js.map +1 -1
  111. package/dist/idl/klend.json +293 -2186
  112. package/dist/lending_operations/index.d.ts +0 -1
  113. package/dist/lending_operations/index.d.ts.map +1 -1
  114. package/dist/lending_operations/index.js +0 -1
  115. package/dist/lending_operations/index.js.map +1 -1
  116. package/dist/manager/client_kamino_manager.js +9 -12
  117. package/dist/manager/client_kamino_manager.js.map +1 -1
  118. package/dist/utils/ata.d.ts +10 -1
  119. package/dist/utils/ata.d.ts.map +1 -1
  120. package/dist/utils/ata.js +47 -0
  121. package/dist/utils/ata.js.map +1 -1
  122. package/dist/utils/managerTypes.d.ts.map +1 -1
  123. package/dist/utils/managerTypes.js +4 -9
  124. package/dist/utils/managerTypes.js.map +1 -1
  125. package/dist/utils/seeds.d.ts +14 -10
  126. package/dist/utils/seeds.d.ts.map +1 -1
  127. package/dist/utils/seeds.js +22 -25
  128. package/dist/utils/seeds.js.map +1 -1
  129. package/package.json +1 -1
  130. package/src/@codegen/klend/accounts/LendingMarket.ts +5 -210
  131. package/src/@codegen/klend/accounts/Obligation.ts +31 -53
  132. package/src/@codegen/klend/accounts/Reserve.ts +2 -13
  133. package/src/@codegen/klend/accounts/UserState.ts +75 -0
  134. package/src/@codegen/klend/accounts/index.ts +0 -6
  135. package/src/@codegen/klend/errors/custom.ts +2 -427
  136. package/src/@codegen/klend/instructions/idlMissingTypes.ts +4 -7
  137. package/src/@codegen/klend/instructions/index.ts +0 -34
  138. package/src/@codegen/klend/instructions/initReserve.ts +6 -2
  139. package/src/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.ts +1 -1
  140. package/src/@codegen/klend/instructions/updateGlobalConfig.ts +1 -2
  141. package/src/@codegen/klend/instructions/updateReserveConfig.ts +1 -2
  142. package/src/@codegen/klend/instructions/withdrawObligationCollateral.ts +1 -1
  143. package/src/@codegen/klend/instructions/withdrawObligationCollateralV2.ts +1 -1
  144. package/src/@codegen/klend/types/AssetTier.ts +119 -0
  145. package/src/@codegen/klend/types/ObligationLiquidity.ts +9 -39
  146. package/src/@codegen/klend/types/ObligationOrder.ts +4 -4
  147. package/src/@codegen/klend/types/ReserveConfig.ts +39 -171
  148. package/src/@codegen/klend/types/ReserveFees.ts +12 -12
  149. package/src/@codegen/klend/types/ReserveLiquidity.ts +12 -30
  150. package/src/@codegen/klend/types/UpdateConfigMode.ts +26 -206
  151. package/src/@codegen/klend/types/UpdateLendingMarketMode.ts +0 -300
  152. package/src/@codegen/klend/types/index.ts +16 -45
  153. package/src/@codegen/klend/zero_padding/ObligationZP.ts +13 -22
  154. package/src/classes/action.ts +8 -577
  155. package/src/classes/manager.ts +7 -13
  156. package/src/classes/market.ts +5 -36
  157. package/src/classes/obligation.ts +1 -1
  158. package/src/classes/reserve.ts +8 -13
  159. package/src/classes/unstakingPool.ts +6 -83
  160. package/src/classes/vault.ts +75 -54
  161. package/src/idl/klend.json +294 -2187
  162. package/src/lending_operations/index.ts +0 -1
  163. package/src/manager/client_kamino_manager.ts +9 -13
  164. package/src/utils/ata.ts +79 -0
  165. package/src/utils/managerTypes.ts +4 -9
  166. package/src/utils/seeds.ts +26 -28
  167. package/dist/@codegen/klend/accounts/PoolState.d.ts +0 -53
  168. package/dist/@codegen/klend/accounts/PoolState.d.ts.map +0 -1
  169. package/dist/@codegen/klend/accounts/PoolState.js +0 -167
  170. package/dist/@codegen/klend/accounts/PoolState.js.map +0 -1
  171. package/dist/@codegen/klend/accounts/UnstakeTicket.d.ts +0 -41
  172. package/dist/@codegen/klend/accounts/UnstakeTicket.d.ts.map +0 -1
  173. package/dist/@codegen/klend/accounts/UnstakeTicket.js +0 -143
  174. package/dist/@codegen/klend/accounts/UnstakeTicket.js.map +0 -1
  175. package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts +0 -132
  176. package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts.map +0 -1
  177. package/dist/@codegen/klend/accounts/WithdrawTicket.js +0 -191
  178. package/dist/@codegen/klend/accounts/WithdrawTicket.js.map +0 -1
  179. package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts +0 -39
  180. package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts.map +0 -1
  181. package/dist/@codegen/klend/instructions/enqueueToWithdraw.js +0 -67
  182. package/dist/@codegen/klend/instructions/enqueueToWithdraw.js.map +0 -1
  183. package/dist/@codegen/klend/instructions/fillBorrowOrder.d.ts +0 -36
  184. package/dist/@codegen/klend/instructions/fillBorrowOrder.d.ts.map +0 -1
  185. package/dist/@codegen/klend/instructions/fillBorrowOrder.js +0 -49
  186. package/dist/@codegen/klend/instructions/fillBorrowOrder.js.map +0 -1
  187. package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts +0 -47
  188. package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts.map +0 -1
  189. package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js +0 -66
  190. package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js.map +0 -1
  191. package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts +0 -31
  192. package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts.map +0 -1
  193. package/dist/@codegen/klend/instructions/setBorrowOrder.js +0 -64
  194. package/dist/@codegen/klend/instructions/setBorrowOrder.js.map +0 -1
  195. package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.d.ts +0 -53
  196. package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.d.ts.map +0 -1
  197. package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.js +0 -190
  198. package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.js.map +0 -1
  199. package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.d.ts +0 -70
  200. package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.d.ts.map +0 -1
  201. package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.js +0 -261
  202. package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.js.map +0 -1
  203. package/dist/@codegen/klend/instructions/withdrawObligationUsol.d.ts +0 -41
  204. package/dist/@codegen/klend/instructions/withdrawObligationUsol.d.ts.map +0 -1
  205. package/dist/@codegen/klend/instructions/withdrawObligationUsol.js +0 -135
  206. package/dist/@codegen/klend/instructions/withdrawObligationUsol.js.map +0 -1
  207. package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts +0 -51
  208. package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts.map +0 -1
  209. package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js +0 -28
  210. package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js.map +0 -1
  211. package/dist/@codegen/klend/types/BorrowOrder.d.ts +0 -192
  212. package/dist/@codegen/klend/types/BorrowOrder.d.ts.map +0 -1
  213. package/dist/@codegen/klend/types/BorrowOrder.js +0 -194
  214. package/dist/@codegen/klend/types/BorrowOrder.js.map +0 -1
  215. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts +0 -39
  216. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts.map +0 -1
  217. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js +0 -100
  218. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js.map +0 -1
  219. package/dist/@codegen/klend/types/WithdrawQueue.d.ts +0 -64
  220. package/dist/@codegen/klend/types/WithdrawQueue.d.ts.map +0 -1
  221. package/dist/@codegen/klend/types/WithdrawQueue.js +0 -104
  222. package/dist/@codegen/klend/types/WithdrawQueue.js.map +0 -1
  223. package/dist/lending_operations/unstake_lst_collateral.d.ts +0 -12
  224. package/dist/lending_operations/unstake_lst_collateral.d.ts.map +0 -1
  225. package/dist/lending_operations/unstake_lst_collateral.js +0 -104
  226. package/dist/lending_operations/unstake_lst_collateral.js.map +0 -1
  227. package/src/@codegen/klend/accounts/PoolState.ts +0 -192
  228. package/src/@codegen/klend/accounts/UnstakeTicket.ts +0 -160
  229. package/src/@codegen/klend/accounts/WithdrawTicket.ts +0 -256
  230. package/src/@codegen/klend/instructions/enqueueToWithdraw.ts +0 -89
  231. package/src/@codegen/klend/instructions/fillBorrowOrder.ts +0 -96
  232. package/src/@codegen/klend/instructions/recoverInvalidTicketCollateral.ts +0 -96
  233. package/src/@codegen/klend/instructions/setBorrowOrder.ts +0 -77
  234. package/src/@codegen/klend/instructions/unstakeLstCollateralEnd.ts +0 -251
  235. package/src/@codegen/klend/instructions/unstakeLstCollateralStart.ts +0 -353
  236. package/src/@codegen/klend/instructions/withdrawObligationUsol.ts +0 -168
  237. package/src/@codegen/klend/instructions/withdrawQueuedLiquidity.ts +0 -92
  238. package/src/@codegen/klend/types/BorrowOrder.ts +0 -267
  239. package/src/@codegen/klend/types/BorrowOrderConfigArgs.ts +0 -87
  240. package/src/@codegen/klend/types/WithdrawQueue.ts +0 -117
  241. package/src/lending_operations/unstake_lst_collateral.ts +0 -174
@@ -11,9 +11,9 @@ export interface ReserveFeesFields {
11
11
  * clarity:
12
12
  * 1% = (1 << 60) / 100 = 11529215046068470
13
13
  * 0.01% (1 basis point) = 115292150460685
14
- * 0.00001% (Aave origination fee) = 115292150461
14
+ * 0.00001% (Aave borrow fee) = 115292150461
15
15
  */
16
- originationFeeSf: BN
16
+ borrowFeeSf: BN
17
17
  /**
18
18
  * Fee for flash loan, expressed as scaled fraction.
19
19
  * 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
@@ -30,9 +30,9 @@ export interface ReserveFeesJSON {
30
30
  * clarity:
31
31
  * 1% = (1 << 60) / 100 = 11529215046068470
32
32
  * 0.01% (1 basis point) = 115292150460685
33
- * 0.00001% (Aave origination fee) = 115292150461
33
+ * 0.00001% (Aave borrow fee) = 115292150461
34
34
  */
35
- originationFeeSf: string
35
+ borrowFeeSf: string
36
36
  /**
37
37
  * Fee for flash loan, expressed as scaled fraction.
38
38
  * 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
@@ -56,9 +56,9 @@ export class ReserveFees {
56
56
  * clarity:
57
57
  * 1% = (1 << 60) / 100 = 11529215046068470
58
58
  * 0.01% (1 basis point) = 115292150460685
59
- * 0.00001% (Aave origination fee) = 115292150461
59
+ * 0.00001% (Aave borrow fee) = 115292150461
60
60
  */
61
- readonly originationFeeSf: BN
61
+ readonly borrowFeeSf: BN
62
62
  /**
63
63
  * Fee for flash loan, expressed as scaled fraction.
64
64
  * 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
@@ -68,7 +68,7 @@ export class ReserveFees {
68
68
  readonly padding: Array<number>
69
69
 
70
70
  constructor(fields: ReserveFeesFields) {
71
- this.originationFeeSf = fields.originationFeeSf
71
+ this.borrowFeeSf = fields.borrowFeeSf
72
72
  this.flashLoanFeeSf = fields.flashLoanFeeSf
73
73
  this.padding = fields.padding
74
74
  }
@@ -76,7 +76,7 @@ export class ReserveFees {
76
76
  static layout(property?: string) {
77
77
  return borsh.struct(
78
78
  [
79
- borsh.u64("originationFeeSf"),
79
+ borsh.u64("borrowFeeSf"),
80
80
  borsh.u64("flashLoanFeeSf"),
81
81
  borsh.array(borsh.u8(), 8, "padding"),
82
82
  ],
@@ -87,7 +87,7 @@ export class ReserveFees {
87
87
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
88
  static fromDecoded(obj: any) {
89
89
  return new ReserveFees({
90
- originationFeeSf: obj.originationFeeSf,
90
+ borrowFeeSf: obj.borrowFeeSf,
91
91
  flashLoanFeeSf: obj.flashLoanFeeSf,
92
92
  padding: obj.padding,
93
93
  })
@@ -95,7 +95,7 @@ export class ReserveFees {
95
95
 
96
96
  static toEncodable(fields: ReserveFeesFields) {
97
97
  return {
98
- originationFeeSf: fields.originationFeeSf,
98
+ borrowFeeSf: fields.borrowFeeSf,
99
99
  flashLoanFeeSf: fields.flashLoanFeeSf,
100
100
  padding: fields.padding,
101
101
  }
@@ -103,7 +103,7 @@ export class ReserveFees {
103
103
 
104
104
  toJSON(): ReserveFeesJSON {
105
105
  return {
106
- originationFeeSf: this.originationFeeSf.toString(),
106
+ borrowFeeSf: this.borrowFeeSf.toString(),
107
107
  flashLoanFeeSf: this.flashLoanFeeSf.toString(),
108
108
  padding: this.padding,
109
109
  }
@@ -111,7 +111,7 @@ export class ReserveFees {
111
111
 
112
112
  static fromJSON(obj: ReserveFeesJSON): ReserveFees {
113
113
  return new ReserveFees({
114
- originationFeeSf: new BN(obj.originationFeeSf),
114
+ borrowFeeSf: new BN(obj.borrowFeeSf),
115
115
  flashLoanFeeSf: new BN(obj.flashLoanFeeSf),
116
116
  padding: obj.padding,
117
117
  })
@@ -11,14 +11,8 @@ export interface ReserveLiquidityFields {
11
11
  supplyVault: Address
12
12
  /** Reserve liquidity fee collection address */
13
13
  feeVault: Address
14
- /**
15
- * Total reserve liquidity available.
16
- *
17
- * Note: not all of this liquidity can be freely used for any purpose. Production code should
18
- * use the specialized getters - see e.g. [Reserve::total_available_liquidity_amount()],
19
- * [Reserve::freely_available_liquidity_amount()].
20
- */
21
- totalAvailableAmount: BN
14
+ /** Reserve liquidity available */
15
+ availableAmount: BN
22
16
  /** Reserve liquidity borrowed (scaled fraction) */
23
17
  borrowedAmountSf: BN
24
18
  /** Reserve liquidity market price in quote currency (scaled fraction) */
@@ -60,14 +54,8 @@ export interface ReserveLiquidityJSON {
60
54
  supplyVault: string
61
55
  /** Reserve liquidity fee collection address */
62
56
  feeVault: string
63
- /**
64
- * Total reserve liquidity available.
65
- *
66
- * Note: not all of this liquidity can be freely used for any purpose. Production code should
67
- * use the specialized getters - see e.g. [Reserve::total_available_liquidity_amount()],
68
- * [Reserve::freely_available_liquidity_amount()].
69
- */
70
- totalAvailableAmount: string
57
+ /** Reserve liquidity available */
58
+ availableAmount: string
71
59
  /** Reserve liquidity borrowed (scaled fraction) */
72
60
  borrowedAmountSf: string
73
61
  /** Reserve liquidity market price in quote currency (scaled fraction) */
@@ -110,14 +98,8 @@ export class ReserveLiquidity {
110
98
  readonly supplyVault: Address
111
99
  /** Reserve liquidity fee collection address */
112
100
  readonly feeVault: Address
113
- /**
114
- * Total reserve liquidity available.
115
- *
116
- * Note: not all of this liquidity can be freely used for any purpose. Production code should
117
- * use the specialized getters - see e.g. [Reserve::total_available_liquidity_amount()],
118
- * [Reserve::freely_available_liquidity_amount()].
119
- */
120
- readonly totalAvailableAmount: BN
101
+ /** Reserve liquidity available */
102
+ readonly availableAmount: BN
121
103
  /** Reserve liquidity borrowed (scaled fraction) */
122
104
  readonly borrowedAmountSf: BN
123
105
  /** Reserve liquidity market price in quote currency (scaled fraction) */
@@ -155,7 +137,7 @@ export class ReserveLiquidity {
155
137
  this.mintPubkey = fields.mintPubkey
156
138
  this.supplyVault = fields.supplyVault
157
139
  this.feeVault = fields.feeVault
158
- this.totalAvailableAmount = fields.totalAvailableAmount
140
+ this.availableAmount = fields.availableAmount
159
141
  this.borrowedAmountSf = fields.borrowedAmountSf
160
142
  this.marketPriceSf = fields.marketPriceSf
161
143
  this.marketPriceLastUpdatedTs = fields.marketPriceLastUpdatedTs
@@ -180,7 +162,7 @@ export class ReserveLiquidity {
180
162
  borshAddress("mintPubkey"),
181
163
  borshAddress("supplyVault"),
182
164
  borshAddress("feeVault"),
183
- borsh.u64("totalAvailableAmount"),
165
+ borsh.u64("availableAmount"),
184
166
  borsh.u128("borrowedAmountSf"),
185
167
  borsh.u128("marketPriceSf"),
186
168
  borsh.u64("marketPriceLastUpdatedTs"),
@@ -206,7 +188,7 @@ export class ReserveLiquidity {
206
188
  mintPubkey: obj.mintPubkey,
207
189
  supplyVault: obj.supplyVault,
208
190
  feeVault: obj.feeVault,
209
- totalAvailableAmount: obj.totalAvailableAmount,
191
+ availableAmount: obj.availableAmount,
210
192
  borrowedAmountSf: obj.borrowedAmountSf,
211
193
  marketPriceSf: obj.marketPriceSf,
212
194
  marketPriceLastUpdatedTs: obj.marketPriceLastUpdatedTs,
@@ -231,7 +213,7 @@ export class ReserveLiquidity {
231
213
  mintPubkey: fields.mintPubkey,
232
214
  supplyVault: fields.supplyVault,
233
215
  feeVault: fields.feeVault,
234
- totalAvailableAmount: fields.totalAvailableAmount,
216
+ availableAmount: fields.availableAmount,
235
217
  borrowedAmountSf: fields.borrowedAmountSf,
236
218
  marketPriceSf: fields.marketPriceSf,
237
219
  marketPriceLastUpdatedTs: fields.marketPriceLastUpdatedTs,
@@ -256,7 +238,7 @@ export class ReserveLiquidity {
256
238
  mintPubkey: this.mintPubkey,
257
239
  supplyVault: this.supplyVault,
258
240
  feeVault: this.feeVault,
259
- totalAvailableAmount: this.totalAvailableAmount.toString(),
241
+ availableAmount: this.availableAmount.toString(),
260
242
  borrowedAmountSf: this.borrowedAmountSf.toString(),
261
243
  marketPriceSf: this.marketPriceSf.toString(),
262
244
  marketPriceLastUpdatedTs: this.marketPriceLastUpdatedTs.toString(),
@@ -280,7 +262,7 @@ export class ReserveLiquidity {
280
262
  mintPubkey: address(obj.mintPubkey),
281
263
  supplyVault: address(obj.supplyVault),
282
264
  feeVault: address(obj.feeVault),
283
- totalAvailableAmount: new BN(obj.totalAvailableAmount),
265
+ availableAmount: new BN(obj.availableAmount),
284
266
  borrowedAmountSf: new BN(obj.borrowedAmountSf),
285
267
  marketPriceSf: new BN(obj.marketPriceSf),
286
268
  marketPriceLastUpdatedTs: new BN(obj.marketPriceLastUpdatedTs),
@@ -119,25 +119,25 @@ export class UpdateProtocolTakeRate {
119
119
  }
120
120
  }
121
121
 
122
- export interface UpdateFeesOriginationFeeJSON {
123
- kind: "UpdateFeesOriginationFee"
122
+ export interface UpdateFeesBorrowFeeJSON {
123
+ kind: "UpdateFeesBorrowFee"
124
124
  }
125
125
 
126
- export class UpdateFeesOriginationFee {
126
+ export class UpdateFeesBorrowFee {
127
127
  static readonly discriminator = 5
128
- static readonly kind = "UpdateFeesOriginationFee"
128
+ static readonly kind = "UpdateFeesBorrowFee"
129
129
  readonly discriminator = 5
130
- readonly kind = "UpdateFeesOriginationFee"
130
+ readonly kind = "UpdateFeesBorrowFee"
131
131
 
132
- toJSON(): UpdateFeesOriginationFeeJSON {
132
+ toJSON(): UpdateFeesBorrowFeeJSON {
133
133
  return {
134
- kind: "UpdateFeesOriginationFee",
134
+ kind: "UpdateFeesBorrowFee",
135
135
  }
136
136
  }
137
137
 
138
138
  toEncodable() {
139
139
  return {
140
- UpdateFeesOriginationFee: {},
140
+ UpdateFeesBorrowFee: {},
141
141
  }
142
142
  }
143
143
  }
@@ -763,25 +763,25 @@ export class UpdateBorrowFactor {
763
763
  }
764
764
  }
765
765
 
766
- export interface DeprecatedUpdateAssetTierJSON {
767
- kind: "DeprecatedUpdateAssetTier"
766
+ export interface UpdateAssetTierJSON {
767
+ kind: "UpdateAssetTier"
768
768
  }
769
769
 
770
- export class DeprecatedUpdateAssetTier {
770
+ export class UpdateAssetTier {
771
771
  static readonly discriminator = 33
772
- static readonly kind = "DeprecatedUpdateAssetTier"
772
+ static readonly kind = "UpdateAssetTier"
773
773
  readonly discriminator = 33
774
- readonly kind = "DeprecatedUpdateAssetTier"
774
+ readonly kind = "UpdateAssetTier"
775
775
 
776
- toJSON(): DeprecatedUpdateAssetTierJSON {
776
+ toJSON(): UpdateAssetTierJSON {
777
777
  return {
778
- kind: "DeprecatedUpdateAssetTier",
778
+ kind: "UpdateAssetTier",
779
779
  }
780
780
  }
781
781
 
782
782
  toEncodable() {
783
783
  return {
784
- DeprecatedUpdateAssetTier: {},
784
+ UpdateAssetTier: {},
785
785
  }
786
786
  }
787
787
  }
@@ -1154,144 +1154,6 @@ export class UpdateProtocolOrderExecutionFee {
1154
1154
  }
1155
1155
  }
1156
1156
 
1157
- export interface UpdateDebtMaturityTimestampJSON {
1158
- kind: "UpdateDebtMaturityTimestamp"
1159
- }
1160
-
1161
- export class UpdateDebtMaturityTimestamp {
1162
- static readonly discriminator = 50
1163
- static readonly kind = "UpdateDebtMaturityTimestamp"
1164
- readonly discriminator = 50
1165
- readonly kind = "UpdateDebtMaturityTimestamp"
1166
-
1167
- toJSON(): UpdateDebtMaturityTimestampJSON {
1168
- return {
1169
- kind: "UpdateDebtMaturityTimestamp",
1170
- }
1171
- }
1172
-
1173
- toEncodable() {
1174
- return {
1175
- UpdateDebtMaturityTimestamp: {},
1176
- }
1177
- }
1178
- }
1179
-
1180
- export interface UpdateDebtTermSecondsJSON {
1181
- kind: "UpdateDebtTermSeconds"
1182
- }
1183
-
1184
- export class UpdateDebtTermSeconds {
1185
- static readonly discriminator = 51
1186
- static readonly kind = "UpdateDebtTermSeconds"
1187
- readonly discriminator = 51
1188
- readonly kind = "UpdateDebtTermSeconds"
1189
-
1190
- toJSON(): UpdateDebtTermSecondsJSON {
1191
- return {
1192
- kind: "UpdateDebtTermSeconds",
1193
- }
1194
- }
1195
-
1196
- toEncodable() {
1197
- return {
1198
- UpdateDebtTermSeconds: {},
1199
- }
1200
- }
1201
- }
1202
-
1203
- export interface UpdateProposerAuthorityLockJSON {
1204
- kind: "UpdateProposerAuthorityLock"
1205
- }
1206
-
1207
- export class UpdateProposerAuthorityLock {
1208
- static readonly discriminator = 52
1209
- static readonly kind = "UpdateProposerAuthorityLock"
1210
- readonly discriminator = 52
1211
- readonly kind = "UpdateProposerAuthorityLock"
1212
-
1213
- toJSON(): UpdateProposerAuthorityLockJSON {
1214
- return {
1215
- kind: "UpdateProposerAuthorityLock",
1216
- }
1217
- }
1218
-
1219
- toEncodable() {
1220
- return {
1221
- UpdateProposerAuthorityLock: {},
1222
- }
1223
- }
1224
- }
1225
-
1226
- export interface UpdateMinDeleveragingBonusBpsJSON {
1227
- kind: "UpdateMinDeleveragingBonusBps"
1228
- }
1229
-
1230
- export class UpdateMinDeleveragingBonusBps {
1231
- static readonly discriminator = 53
1232
- static readonly kind = "UpdateMinDeleveragingBonusBps"
1233
- readonly discriminator = 53
1234
- readonly kind = "UpdateMinDeleveragingBonusBps"
1235
-
1236
- toJSON(): UpdateMinDeleveragingBonusBpsJSON {
1237
- return {
1238
- kind: "UpdateMinDeleveragingBonusBps",
1239
- }
1240
- }
1241
-
1242
- toEncodable() {
1243
- return {
1244
- UpdateMinDeleveragingBonusBps: {},
1245
- }
1246
- }
1247
- }
1248
-
1249
- export interface UpdateCanUnstakeLstCollateralJSON {
1250
- kind: "UpdateCanUnstakeLstCollateral"
1251
- }
1252
-
1253
- export class UpdateCanUnstakeLstCollateral {
1254
- static readonly discriminator = 54
1255
- static readonly kind = "UpdateCanUnstakeLstCollateral"
1256
- readonly discriminator = 54
1257
- readonly kind = "UpdateCanUnstakeLstCollateral"
1258
-
1259
- toJSON(): UpdateCanUnstakeLstCollateralJSON {
1260
- return {
1261
- kind: "UpdateCanUnstakeLstCollateral",
1262
- }
1263
- }
1264
-
1265
- toEncodable() {
1266
- return {
1267
- UpdateCanUnstakeLstCollateral: {},
1268
- }
1269
- }
1270
- }
1271
-
1272
- export interface UpdateLtvLamportsMarginJSON {
1273
- kind: "UpdateLtvLamportsMargin"
1274
- }
1275
-
1276
- export class UpdateLtvLamportsMargin {
1277
- static readonly discriminator = 55
1278
- static readonly kind = "UpdateLtvLamportsMargin"
1279
- readonly discriminator = 55
1280
- readonly kind = "UpdateLtvLamportsMargin"
1281
-
1282
- toJSON(): UpdateLtvLamportsMarginJSON {
1283
- return {
1284
- kind: "UpdateLtvLamportsMargin",
1285
- }
1286
- }
1287
-
1288
- toEncodable() {
1289
- return {
1290
- UpdateLtvLamportsMargin: {},
1291
- }
1292
- }
1293
- }
1294
-
1295
1157
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1296
1158
  export function fromDecoded(obj: any): types.UpdateConfigModeKind {
1297
1159
  if (typeof obj !== "object") {
@@ -1313,8 +1175,8 @@ export function fromDecoded(obj: any): types.UpdateConfigModeKind {
1313
1175
  if ("UpdateProtocolTakeRate" in obj) {
1314
1176
  return new UpdateProtocolTakeRate()
1315
1177
  }
1316
- if ("UpdateFeesOriginationFee" in obj) {
1317
- return new UpdateFeesOriginationFee()
1178
+ if ("UpdateFeesBorrowFee" in obj) {
1179
+ return new UpdateFeesBorrowFee()
1318
1180
  }
1319
1181
  if ("UpdateFeesFlashLoanFee" in obj) {
1320
1182
  return new UpdateFeesFlashLoanFee()
@@ -1397,8 +1259,8 @@ export function fromDecoded(obj: any): types.UpdateConfigModeKind {
1397
1259
  if ("UpdateBorrowFactor" in obj) {
1398
1260
  return new UpdateBorrowFactor()
1399
1261
  }
1400
- if ("DeprecatedUpdateAssetTier" in obj) {
1401
- return new DeprecatedUpdateAssetTier()
1262
+ if ("UpdateAssetTier" in obj) {
1263
+ return new UpdateAssetTier()
1402
1264
  }
1403
1265
  if ("UpdateElevationGroup" in obj) {
1404
1266
  return new UpdateElevationGroup()
@@ -1448,24 +1310,6 @@ export function fromDecoded(obj: any): types.UpdateConfigModeKind {
1448
1310
  if ("UpdateProtocolOrderExecutionFee" in obj) {
1449
1311
  return new UpdateProtocolOrderExecutionFee()
1450
1312
  }
1451
- if ("UpdateDebtMaturityTimestamp" in obj) {
1452
- return new UpdateDebtMaturityTimestamp()
1453
- }
1454
- if ("UpdateDebtTermSeconds" in obj) {
1455
- return new UpdateDebtTermSeconds()
1456
- }
1457
- if ("UpdateProposerAuthorityLock" in obj) {
1458
- return new UpdateProposerAuthorityLock()
1459
- }
1460
- if ("UpdateMinDeleveragingBonusBps" in obj) {
1461
- return new UpdateMinDeleveragingBonusBps()
1462
- }
1463
- if ("UpdateCanUnstakeLstCollateral" in obj) {
1464
- return new UpdateCanUnstakeLstCollateral()
1465
- }
1466
- if ("UpdateLtvLamportsMargin" in obj) {
1467
- return new UpdateLtvLamportsMargin()
1468
- }
1469
1313
 
1470
1314
  throw new Error("Invalid enum object")
1471
1315
  }
@@ -1489,8 +1333,8 @@ export function fromJSON(
1489
1333
  case "UpdateProtocolTakeRate": {
1490
1334
  return new UpdateProtocolTakeRate()
1491
1335
  }
1492
- case "UpdateFeesOriginationFee": {
1493
- return new UpdateFeesOriginationFee()
1336
+ case "UpdateFeesBorrowFee": {
1337
+ return new UpdateFeesBorrowFee()
1494
1338
  }
1495
1339
  case "UpdateFeesFlashLoanFee": {
1496
1340
  return new UpdateFeesFlashLoanFee()
@@ -1573,8 +1417,8 @@ export function fromJSON(
1573
1417
  case "UpdateBorrowFactor": {
1574
1418
  return new UpdateBorrowFactor()
1575
1419
  }
1576
- case "DeprecatedUpdateAssetTier": {
1577
- return new DeprecatedUpdateAssetTier()
1420
+ case "UpdateAssetTier": {
1421
+ return new UpdateAssetTier()
1578
1422
  }
1579
1423
  case "UpdateElevationGroup": {
1580
1424
  return new UpdateElevationGroup()
@@ -1624,24 +1468,6 @@ export function fromJSON(
1624
1468
  case "UpdateProtocolOrderExecutionFee": {
1625
1469
  return new UpdateProtocolOrderExecutionFee()
1626
1470
  }
1627
- case "UpdateDebtMaturityTimestamp": {
1628
- return new UpdateDebtMaturityTimestamp()
1629
- }
1630
- case "UpdateDebtTermSeconds": {
1631
- return new UpdateDebtTermSeconds()
1632
- }
1633
- case "UpdateProposerAuthorityLock": {
1634
- return new UpdateProposerAuthorityLock()
1635
- }
1636
- case "UpdateMinDeleveragingBonusBps": {
1637
- return new UpdateMinDeleveragingBonusBps()
1638
- }
1639
- case "UpdateCanUnstakeLstCollateral": {
1640
- return new UpdateCanUnstakeLstCollateral()
1641
- }
1642
- case "UpdateLtvLamportsMargin": {
1643
- return new UpdateLtvLamportsMargin()
1644
- }
1645
1471
  }
1646
1472
  }
1647
1473
 
@@ -1652,7 +1478,7 @@ export function layout(property?: string) {
1652
1478
  borsh.struct([], "UpdateLiquidationThresholdPct"),
1653
1479
  borsh.struct([], "UpdateProtocolLiquidationFee"),
1654
1480
  borsh.struct([], "UpdateProtocolTakeRate"),
1655
- borsh.struct([], "UpdateFeesOriginationFee"),
1481
+ borsh.struct([], "UpdateFeesBorrowFee"),
1656
1482
  borsh.struct([], "UpdateFeesFlashLoanFee"),
1657
1483
  borsh.struct([], "DeprecatedUpdateFeesReferralFeeBps"),
1658
1484
  borsh.struct([], "UpdateDepositLimit"),
@@ -1680,7 +1506,7 @@ export function layout(property?: string) {
1680
1506
  borsh.struct([], "UpdateMinLiquidationBonusBps"),
1681
1507
  borsh.struct([], "UpdateDeleveragingMarginCallPeriod"),
1682
1508
  borsh.struct([], "UpdateBorrowFactor"),
1683
- borsh.struct([], "DeprecatedUpdateAssetTier"),
1509
+ borsh.struct([], "UpdateAssetTier"),
1684
1510
  borsh.struct([], "UpdateElevationGroup"),
1685
1511
  borsh.struct([], "UpdateDeleveragingThresholdDecreaseBpsPerDay"),
1686
1512
  borsh.struct([], "DeprecatedUpdateMultiplierSideBoost"),
@@ -1697,12 +1523,6 @@ export function layout(property?: string) {
1697
1523
  borsh.struct([], "UpdateAutodeleverageEnabled"),
1698
1524
  borsh.struct([], "UpdateDeleveragingBonusIncreaseBpsPerDay"),
1699
1525
  borsh.struct([], "UpdateProtocolOrderExecutionFee"),
1700
- borsh.struct([], "UpdateDebtMaturityTimestamp"),
1701
- borsh.struct([], "UpdateDebtTermSeconds"),
1702
- borsh.struct([], "UpdateProposerAuthorityLock"),
1703
- borsh.struct([], "UpdateMinDeleveragingBonusBps"),
1704
- borsh.struct([], "UpdateCanUnstakeLstCollateral"),
1705
- borsh.struct([], "UpdateLtvLamportsMargin"),
1706
1526
  ])
1707
1527
  if (property !== undefined) {
1708
1528
  return ret.replicate(property)