@kamino-finance/klend-sdk 7.4.0-beta.5 → 7.4.0-beta.6

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 (72) hide show
  1. package/dist/@codegen/klend/accounts/LendingMarket.d.ts +18 -18
  2. package/dist/@codegen/klend/accounts/LendingMarket.d.ts.map +1 -1
  3. package/dist/@codegen/klend/accounts/LendingMarket.js +18 -18
  4. package/dist/@codegen/klend/accounts/LendingMarket.js.map +1 -1
  5. package/dist/@codegen/klend/errors/custom.d.ts +73 -1
  6. package/dist/@codegen/klend/errors/custom.d.ts.map +1 -1
  7. package/dist/@codegen/klend/errors/custom.js +127 -1
  8. package/dist/@codegen/klend/errors/custom.js.map +1 -1
  9. package/dist/@codegen/klend/instructions/index.d.ts +4 -0
  10. package/dist/@codegen/klend/instructions/index.d.ts.map +1 -1
  11. package/dist/@codegen/klend/instructions/index.js +6 -2
  12. package/dist/@codegen/klend/instructions/index.js.map +1 -1
  13. package/dist/@codegen/klend/instructions/rolloverFixedTermBorrow.d.ts +36 -0
  14. package/dist/@codegen/klend/instructions/rolloverFixedTermBorrow.d.ts.map +1 -0
  15. package/dist/@codegen/klend/instructions/rolloverFixedTermBorrow.js +62 -0
  16. package/dist/@codegen/klend/instructions/rolloverFixedTermBorrow.js.map +1 -0
  17. package/dist/@codegen/klend/instructions/updateObligationConfig.d.ts +30 -0
  18. package/dist/@codegen/klend/instructions/updateObligationConfig.d.ts.map +1 -0
  19. package/dist/@codegen/klend/instructions/updateObligationConfig.js +70 -0
  20. package/dist/@codegen/klend/instructions/updateObligationConfig.js.map +1 -0
  21. package/dist/@codegen/klend/types/BorrowOrder.d.ts +62 -0
  22. package/dist/@codegen/klend/types/BorrowOrder.d.ts.map +1 -1
  23. package/dist/@codegen/klend/types/BorrowOrder.js +28 -1
  24. package/dist/@codegen/klend/types/BorrowOrder.js.map +1 -1
  25. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts +5 -0
  26. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts.map +1 -1
  27. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js +8 -0
  28. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js.map +1 -1
  29. package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.d.ts +6 -6
  30. package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.js +2 -2
  31. package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts +14 -14
  32. package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts.map +1 -1
  33. package/dist/@codegen/klend/types/UpdateLendingMarketMode.js +23 -23
  34. package/dist/@codegen/klend/types/UpdateLendingMarketMode.js.map +1 -1
  35. package/dist/@codegen/klend/types/UpdateObligationConfigMode.d.ts +58 -0
  36. package/dist/@codegen/klend/types/UpdateObligationConfigMode.d.ts.map +1 -0
  37. package/dist/@codegen/klend/types/UpdateObligationConfigMode.js +156 -0
  38. package/dist/@codegen/klend/types/UpdateObligationConfigMode.js.map +1 -0
  39. package/dist/@codegen/klend/types/index.d.ts +16 -2
  40. package/dist/@codegen/klend/types/index.d.ts.map +1 -1
  41. package/dist/@codegen/klend/types/index.js +3 -1
  42. package/dist/@codegen/klend/types/index.js.map +1 -1
  43. package/dist/classes/action.d.ts +1 -0
  44. package/dist/classes/action.d.ts.map +1 -1
  45. package/dist/classes/action.js +44 -1
  46. package/dist/classes/action.js.map +1 -1
  47. package/dist/classes/actionTypes.d.ts +1 -0
  48. package/dist/classes/actionTypes.d.ts.map +1 -1
  49. package/dist/classes/manager.js +2 -2
  50. package/dist/classes/manager.js.map +1 -1
  51. package/dist/classes/reserve.d.ts +4 -4
  52. package/dist/classes/reserve.d.ts.map +1 -1
  53. package/dist/classes/reserve.js +9 -4
  54. package/dist/classes/reserve.js.map +1 -1
  55. package/dist/idl/klend.json +309 -12
  56. package/package.json +1 -1
  57. package/src/@codegen/klend/accounts/LendingMarket.ts +36 -36
  58. package/src/@codegen/klend/errors/custom.ts +147 -0
  59. package/src/@codegen/klend/instructions/index.ts +7 -0
  60. package/src/@codegen/klend/instructions/rolloverFixedTermBorrow.ts +109 -0
  61. package/src/@codegen/klend/instructions/updateObligationConfig.ts +84 -0
  62. package/src/@codegen/klend/types/BorrowOrder.ts +69 -1
  63. package/src/@codegen/klend/types/BorrowOrderConfigArgs.ts +11 -0
  64. package/src/@codegen/klend/types/FixedTermBorrowRolloverConfig.ts +6 -6
  65. package/src/@codegen/klend/types/UpdateLendingMarketMode.ts +26 -26
  66. package/src/@codegen/klend/types/UpdateObligationConfigMode.ts +151 -0
  67. package/src/@codegen/klend/types/index.ts +28 -4
  68. package/src/classes/action.ts +76 -1
  69. package/src/classes/actionTypes.ts +1 -0
  70. package/src/classes/manager.ts +2 -2
  71. package/src/classes/reserve.ts +9 -4
  72. package/src/idl/klend.json +309 -12
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.13.1",
2
+ "version": "1.13.2",
3
3
  "name": "kamino_lending",
4
4
  "instructions": [
5
5
  {
@@ -3051,6 +3051,201 @@
3051
3051
  }
3052
3052
  ]
3053
3053
  },
3054
+ {
3055
+ "name": "updateObligationConfig",
3056
+ "accounts": [
3057
+ {
3058
+ "name": "owner",
3059
+ "isMut": false,
3060
+ "isSigner": true,
3061
+ "docs": [
3062
+ "Obligation's owner (signer - only the owner can modify the obligation's configuration)."
3063
+ ]
3064
+ },
3065
+ {
3066
+ "name": "obligation",
3067
+ "isMut": true,
3068
+ "isSigner": false,
3069
+ "docs": [
3070
+ "The obligation to update."
3071
+ ]
3072
+ },
3073
+ {
3074
+ "name": "borrowReserve",
3075
+ "isMut": false,
3076
+ "isSigner": false,
3077
+ "isOptional": true,
3078
+ "docs": [
3079
+ "The reserve of a selected one among the [Obligation::borrows].",
3080
+ "",
3081
+ "Required only if the config update affects a single borrow (for validating its new config)."
3082
+ ]
3083
+ },
3084
+ {
3085
+ "name": "depositReserve",
3086
+ "isMut": false,
3087
+ "isSigner": false,
3088
+ "isOptional": true,
3089
+ "docs": [
3090
+ "The reserve of a selected one among the [Obligation::deposits].",
3091
+ "",
3092
+ "Required only if the config update affects a single deposit (for validating its new config)."
3093
+ ]
3094
+ },
3095
+ {
3096
+ "name": "lendingMarket",
3097
+ "isMut": false,
3098
+ "isSigner": false,
3099
+ "docs": [
3100
+ "The lending market (for validating the obligation's new config)."
3101
+ ]
3102
+ }
3103
+ ],
3104
+ "args": [
3105
+ {
3106
+ "name": "mode",
3107
+ "type": {
3108
+ "defined": "UpdateObligationConfigMode"
3109
+ }
3110
+ },
3111
+ {
3112
+ "name": "value",
3113
+ "type": "bytes"
3114
+ }
3115
+ ]
3116
+ },
3117
+ {
3118
+ "name": "rolloverFixedTermBorrow",
3119
+ "accounts": [
3120
+ {
3121
+ "name": "rolloverAccounts",
3122
+ "accounts": [
3123
+ {
3124
+ "name": "payer",
3125
+ "isMut": false,
3126
+ "isSigner": true
3127
+ },
3128
+ {
3129
+ "name": "obligation",
3130
+ "isMut": true,
3131
+ "isSigner": false,
3132
+ "docs": [
3133
+ "The obligation with a fixed-term borrow."
3134
+ ]
3135
+ },
3136
+ {
3137
+ "name": "lendingMarket",
3138
+ "isMut": false,
3139
+ "isSigner": false,
3140
+ "docs": [
3141
+ "The [Self::obligation]'s market, needed for validations against the market-wide",
3142
+ "configuration."
3143
+ ]
3144
+ },
3145
+ {
3146
+ "name": "lendingMarketAuthority",
3147
+ "isMut": false,
3148
+ "isSigner": false,
3149
+ "docs": [
3150
+ "The [Self::lending_market]'s authority, needed to transfer the newly-borrowed funds out of",
3151
+ "the [Self::reserve_source_liquidity]."
3152
+ ]
3153
+ },
3154
+ {
3155
+ "name": "sourceBorrowReserve",
3156
+ "isMut": true,
3157
+ "isSigner": false,
3158
+ "docs": [
3159
+ "The fixed-term reserve used by the existing [Self::obligation]'s borrow that approaches its",
3160
+ "debt term and needs to rollover from."
3161
+ ]
3162
+ },
3163
+ {
3164
+ "name": "targetBorrowReserve",
3165
+ "isMut": true,
3166
+ "isSigner": false,
3167
+ "docs": [
3168
+ "The reserve to rollover the borrow into - possibly (but not necessarily) the same as",
3169
+ "[Self::source_borrow_reserve]'s (but definitely of the same liquidity mint)."
3170
+ ]
3171
+ },
3172
+ {
3173
+ "name": "liquidityMint",
3174
+ "isMut": false,
3175
+ "isSigner": false,
3176
+ "docs": [
3177
+ "The mint of [Self::source_borrow_reserve] and [Self::target_borrow_reserve], needed to",
3178
+ "transfer funds between them."
3179
+ ]
3180
+ },
3181
+ {
3182
+ "name": "sourceBorrowReserveLiquidity",
3183
+ "isMut": true,
3184
+ "isSigner": false,
3185
+ "docs": [
3186
+ "The vault of [Self::source_borrow_reserve], from which the funds are transferred."
3187
+ ]
3188
+ },
3189
+ {
3190
+ "name": "targetBorrowReserveLiquidity",
3191
+ "isMut": true,
3192
+ "isSigner": false,
3193
+ "docs": [
3194
+ "The vault of [Self::target_borrow_reserve], from which the funds are transferred."
3195
+ ]
3196
+ },
3197
+ {
3198
+ "name": "tokenProgram",
3199
+ "isMut": false,
3200
+ "isSigner": false,
3201
+ "docs": [
3202
+ "The token program of [Self::liquidity_mint] - needed to execute the transfer."
3203
+ ]
3204
+ }
3205
+ ]
3206
+ },
3207
+ {
3208
+ "name": "sourceFarmsAccounts",
3209
+ "accounts": [
3210
+ {
3211
+ "name": "obligationFarmUserState",
3212
+ "isMut": true,
3213
+ "isSigner": false,
3214
+ "isOptional": true
3215
+ },
3216
+ {
3217
+ "name": "reserveFarmState",
3218
+ "isMut": true,
3219
+ "isSigner": false,
3220
+ "isOptional": true
3221
+ }
3222
+ ]
3223
+ },
3224
+ {
3225
+ "name": "targetFarmsAccounts",
3226
+ "accounts": [
3227
+ {
3228
+ "name": "obligationFarmUserState",
3229
+ "isMut": true,
3230
+ "isSigner": false,
3231
+ "isOptional": true
3232
+ },
3233
+ {
3234
+ "name": "reserveFarmState",
3235
+ "isMut": true,
3236
+ "isSigner": false,
3237
+ "isOptional": true
3238
+ }
3239
+ ]
3240
+ },
3241
+ {
3242
+ "name": "farmsProgram",
3243
+ "isMut": false,
3244
+ "isSigner": false
3245
+ }
3246
+ ],
3247
+ "args": []
3248
+ },
3054
3249
  {
3055
3250
  "name": "fillBorrowOrder",
3056
3251
  "accounts": [
@@ -4185,8 +4380,8 @@
4185
4380
  "Whether the owners can enable the \"fixed term borrow rollover\" on their obligations.",
4186
4381
  "",
4187
4382
  "*Note 1:* the actual execution of (different kinds of) rollovers can be disabled by zeroing",
4188
- "[Self::fixed_rollover_window_duration_seconds] and",
4189
- "[Self::variable_rollover_window_duration_seconds].",
4383
+ "[Self::fixed_term_rollover_window_duration_seconds] and",
4384
+ "[Self::open_term_rollover_window_duration_seconds].",
4190
4385
  "",
4191
4386
  "*Note 2:* when this configuration is disabled, the obligation owners can still disable their",
4192
4387
  "rollover (i.e. set the obligation's flags to zeroes)."
@@ -4211,7 +4406,7 @@
4211
4406
  "type": "u64"
4212
4407
  },
4213
4408
  {
4214
- "name": "fixedRolloverWindowDurationSeconds",
4409
+ "name": "fixedTermRolloverWindowDurationSeconds",
4215
4410
  "docs": [
4216
4411
  "A configurable time window (right before the end of a fixed debt term) during which an",
4217
4412
  "auto-rollover into another *fixed* rate/term can happen.",
@@ -4223,15 +4418,15 @@
4223
4418
  "type": "u64"
4224
4419
  },
4225
4420
  {
4226
- "name": "variableRolloverWindowDurationSeconds",
4421
+ "name": "openTermRolloverWindowDurationSeconds",
4227
4422
  "docs": [
4228
4423
  "A configurable time window (right before the end of a fixed debt term) during which an",
4229
4424
  "auto-rollover into a *variable* (indefinite) rate/term can happen.",
4230
4425
  "",
4231
4426
  "When zeroed, this rollover mode is effectively disabled.",
4232
4427
  "",
4233
- "This will typically be shorter than [Self::fixed_rollover_window_duration_seconds], acting",
4234
- "as a fallback if a fixed reserve liquidity remains unavailable for considerable time."
4428
+ "This will typically be shorter than [Self::fixed_term_rollover_window_duration_seconds],",
4429
+ "acting as a fallback if a fixed reserve liquidity remains unavailable for considerable time."
4235
4430
  ],
4236
4431
  "type": "u64"
4237
4432
  },
@@ -4906,6 +5101,10 @@
4906
5101
  {
4907
5102
  "name": "fillableUntilTimestamp",
4908
5103
  "type": "u64"
5104
+ },
5105
+ {
5106
+ "name": "enableAutoRolloverOnFilledBorrows",
5107
+ "type": "bool"
4909
5108
  }
4910
5109
  ]
4911
5110
  }
@@ -5265,10 +5464,10 @@
5265
5464
  "name": "UpdateMinWithdrawQueuedLiquidityValue"
5266
5465
  },
5267
5466
  {
5268
- "name": "UpdateFixedRolloverWindowDurationSeconds"
5467
+ "name": "UpdateFixedTermRolloverWindowDurationSeconds"
5269
5468
  },
5270
5469
  {
5271
- "name": "UpdateVariableRolloverWindowDurationSeconds"
5470
+ "name": "UpdateOpenTermRolloverWindowDurationSeconds"
5272
5471
  },
5273
5472
  {
5274
5473
  "name": "UpdateObligationBorrowRolloverConfigurationEnabled"
@@ -5470,6 +5669,29 @@
5470
5669
  ],
5471
5670
  "type": "u32"
5472
5671
  },
5672
+ {
5673
+ "name": "enableAutoRolloverOnFilledBorrows",
5674
+ "docs": [
5675
+ "When `1`, all [Obligation::borrows] that get filled by this order will have their",
5676
+ "[FixedTermBorrowRolloverConfig::auto_rollover_enabled] flag set.",
5677
+ "",
5678
+ "Additionally, their rollover customizations:",
5679
+ "- will exactly match this order's constraints regarding [Self::min_debt_term_seconds] and",
5680
+ "[Self::max_borrow_rate_bps];",
5681
+ "- will use the [FixedTermBorrowRolloverConfig::open_term_allowed] fallback.",
5682
+ "",
5683
+ "See [BorrowOrder::get_rollover_config_for_filled_borrow()].",
5684
+ "",
5685
+ "Clarification note: when `0`, this setting has no effect on any borrow (i.e. if an existing",
5686
+ "borrow was independently marked for auto-rollover, it will *not* be unmarked when filled by",
5687
+ "this order).",
5688
+ "",
5689
+ "Feature flag note: when [LendingMarket::obligation_borrow_rollover_configuration_enabled] is",
5690
+ "disabled, this setting has no effect on any borrow (i.e. the fill will be successful, but",
5691
+ "the borrow will not be marked for auto-rollover."
5692
+ ],
5693
+ "type": "u8"
5694
+ },
5473
5695
  {
5474
5696
  "name": "padding1",
5475
5697
  "docs": [
@@ -5478,7 +5700,7 @@
5478
5700
  "type": {
5479
5701
  "array": [
5480
5702
  "u8",
5481
- 4
5703
+ 3
5482
5704
  ]
5483
5705
  }
5484
5706
  },
@@ -5519,7 +5741,7 @@
5519
5741
  "C) sufficient available liquidity (including no withdraw tickets waiting in its queue).",
5520
5742
  "",
5521
5743
  "The time left until the current debt term expires must be:",
5522
- "D) less than [LendingMarket::fixed_rollover_window_duration_seconds].",
5744
+ "D) less than [LendingMarket::fixed_term_rollover_window_duration_seconds].",
5523
5745
  "",
5524
5746
  "Note: the other settings are only effective when this one is `1`."
5525
5747
  ],
@@ -5530,7 +5752,7 @@
5530
5752
  "docs": [
5531
5753
  "When `1`, partially lifts the condition *B* from [Self::auto_rollover_enabled]: additionally",
5532
5754
  "allows to use a variable (indefinite) debt term if less than",
5533
- "[LendingMarket::variable_rollover_window_duration_seconds] is left until expiration.",
5755
+ "[LendingMarket::open_term_rollover_window_duration_seconds] is left until expiration.",
5534
5756
  "",
5535
5757
  "Note: typically this flag should be used together with [Self::max_borrow_rate_bps] set to",
5536
5758
  "`u32::MAX` (to denote a variable-rate reserve)."
@@ -5853,6 +6075,36 @@
5853
6075
  ]
5854
6076
  }
5855
6077
  },
6078
+ {
6079
+ "name": "UpdateObligationConfigMode",
6080
+ "docs": [
6081
+ "A discriminator of a user-configurable piece of [Obligation].",
6082
+ "",
6083
+ "Implementation note: due to TS-side codegen quirks (and a \"convention\" currently seen e.g.",
6084
+ "within reserve and market update operations), this is not a true Rust enum. The new value of",
6085
+ "a config item is provided in a separate handler argument (borsh-serialized), and its expected",
6086
+ "type is defined by each discriminator here. Additionally, each update mode acts on a specific",
6087
+ "[ObligationConfigUpdateSubject] (e.g. the auto-rollover of fixed-term borrows is configured on",
6088
+ "a per-borrow basis), which is also specified by separate handler arguments."
6089
+ ],
6090
+ "type": {
6091
+ "kind": "enum",
6092
+ "variants": [
6093
+ {
6094
+ "name": "FixedTermRolloverEnabled"
6095
+ },
6096
+ {
6097
+ "name": "FixedTermRolloverMaxBorrowRateBps"
6098
+ },
6099
+ {
6100
+ "name": "FixedTermRolloverMinDebtTermSeconds"
6101
+ },
6102
+ {
6103
+ "name": "FixedTermRolloverOpenTermAllowed"
6104
+ }
6105
+ ]
6106
+ }
6107
+ },
5856
6108
  {
5857
6109
  "name": "BigFractionBytes",
5858
6110
  "type": {
@@ -7634,6 +7886,51 @@
7634
7886
  "code": 6153,
7635
7887
  "name": "WithdrawTicketProgressCallbackAccountsMissing",
7636
7888
  "msg": "One or more accounts required by the ticket's configured progress callback are missing"
7889
+ },
7890
+ {
7891
+ "code": 6154,
7892
+ "name": "BorrowRolloverConfigurationDisabled",
7893
+ "msg": "Configuring auto-rollover on loans is disabled by market owner"
7894
+ },
7895
+ {
7896
+ "code": 6155,
7897
+ "name": "InvalidObligationConfigUpdateSubject",
7898
+ "msg": "Invalid specification of the Obligation's part to be configured"
7899
+ },
7900
+ {
7901
+ "code": 6156,
7902
+ "name": "BorrowRolloverLiquidityMintMismatch",
7903
+ "msg": "Auto-rollover must use a target reserve of the same token"
7904
+ },
7905
+ {
7906
+ "code": 6157,
7907
+ "name": "ObligationBorrowRolloverNotApplicable",
7908
+ "msg": "The given borrow is not fixed-term and does not require rolling over"
7909
+ },
7910
+ {
7911
+ "code": 6158,
7912
+ "name": "ObligationBorrowOutsideRolloverWindow",
7913
+ "msg": "The given borrow is outside the corresponding market-configured rollover window"
7914
+ },
7915
+ {
7916
+ "code": 6159,
7917
+ "name": "ObligationBorrowRolloverNotEnabledByOwner",
7918
+ "msg": "Obligation's owner did not opt-in for auto-rollover of the given borrow"
7919
+ },
7920
+ {
7921
+ "code": 6160,
7922
+ "name": "ObligationBorrowRolloverTargetReserveMismatch",
7923
+ "msg": "Obligation's owner did not allow to roll over into terms offered by the given reserve"
7924
+ },
7925
+ {
7926
+ "code": 6161,
7927
+ "name": "BorrowRolloverExecutionDisabled",
7928
+ "msg": "Executing auto-rollover is disabled by market owner"
7929
+ },
7930
+ {
7931
+ "code": 6162,
7932
+ "name": "ObligationAccountingMismatch",
7933
+ "msg": "Obligation internal state accounting has been unexpectedly modified"
7637
7934
  }
7638
7935
  ]
7639
7936
  }