@kamino-finance/klend-sdk 7.2.6-beta.0 → 7.2.6-beta.1

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 (89) hide show
  1. package/README.md +0 -1
  2. package/dist/@codegen/klend/accounts/LendingMarket.d.ts +0 -33
  3. package/dist/@codegen/klend/accounts/LendingMarket.d.ts.map +1 -1
  4. package/dist/@codegen/klend/accounts/LendingMarket.js +2 -24
  5. package/dist/@codegen/klend/accounts/LendingMarket.js.map +1 -1
  6. package/dist/@codegen/klend/errors/custom.d.ts +2 -26
  7. package/dist/@codegen/klend/errors/custom.d.ts.map +1 -1
  8. package/dist/@codegen/klend/errors/custom.js +3 -45
  9. package/dist/@codegen/klend/errors/custom.js.map +1 -1
  10. package/dist/@codegen/klend/instructions/index.d.ts +0 -2
  11. package/dist/@codegen/klend/instructions/index.d.ts.map +1 -1
  12. package/dist/@codegen/klend/instructions/index.js +1 -3
  13. package/dist/@codegen/klend/instructions/index.js.map +1 -1
  14. package/dist/@codegen/klend/instructions/initReserve.d.ts +1 -1
  15. package/dist/@codegen/klend/instructions/initReserve.d.ts.map +1 -1
  16. package/dist/@codegen/klend/instructions/initReserve.js +5 -1
  17. package/dist/@codegen/klend/instructions/initReserve.js.map +1 -1
  18. package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateralV2.js +1 -1
  19. package/dist/@codegen/klend/instructions/withdrawObligationCollateral.js +1 -1
  20. package/dist/@codegen/klend/instructions/withdrawObligationCollateralV2.js +1 -1
  21. package/dist/@codegen/klend/types/ReserveConfig.d.ts +24 -58
  22. package/dist/@codegen/klend/types/ReserveConfig.d.ts.map +1 -1
  23. package/dist/@codegen/klend/types/ReserveConfig.js +18 -40
  24. package/dist/@codegen/klend/types/ReserveConfig.js.map +1 -1
  25. package/dist/@codegen/klend/types/ReserveFees.d.ts +8 -8
  26. package/dist/@codegen/klend/types/ReserveFees.d.ts.map +1 -1
  27. package/dist/@codegen/klend/types/ReserveFees.js +8 -8
  28. package/dist/@codegen/klend/types/ReserveFees.js.map +1 -1
  29. package/dist/@codegen/klend/types/UpdateConfigMode.d.ts +7 -46
  30. package/dist/@codegen/klend/types/UpdateConfigMode.d.ts.map +1 -1
  31. package/dist/@codegen/klend/types/UpdateConfigMode.js +12 -85
  32. package/dist/@codegen/klend/types/UpdateConfigMode.js.map +1 -1
  33. package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts +0 -26
  34. package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts.map +1 -1
  35. package/dist/@codegen/klend/types/UpdateLendingMarketMode.js +1 -49
  36. package/dist/@codegen/klend/types/UpdateLendingMarketMode.js.map +1 -1
  37. package/dist/@codegen/klend/types/index.d.ts +4 -4
  38. package/dist/@codegen/klend/types/index.d.ts.map +1 -1
  39. package/dist/@codegen/klend/types/index.js.map +1 -1
  40. package/dist/classes/manager.d.ts.map +1 -1
  41. package/dist/classes/manager.js +0 -2
  42. package/dist/classes/manager.js.map +1 -1
  43. package/dist/classes/market.d.ts.map +1 -1
  44. package/dist/classes/market.js +4 -0
  45. package/dist/classes/market.js.map +1 -1
  46. package/dist/classes/reserve.d.ts.map +1 -1
  47. package/dist/classes/reserve.js +4 -7
  48. package/dist/classes/reserve.js.map +1 -1
  49. package/dist/idl/klend.json +59 -129
  50. package/dist/manager/client_kamino_manager.js +3 -5
  51. package/dist/manager/client_kamino_manager.js.map +1 -1
  52. package/dist/utils/index.d.ts +1 -0
  53. package/dist/utils/index.d.ts.map +1 -1
  54. package/dist/utils/index.js +1 -0
  55. package/dist/utils/index.js.map +1 -1
  56. package/dist/utils/managerTypes.d.ts +1 -1
  57. package/dist/utils/managerTypes.d.ts.map +1 -1
  58. package/dist/utils/managerTypes.js +3 -5
  59. package/dist/utils/managerTypes.js.map +1 -1
  60. package/dist/utils/seeds.d.ts +5 -5
  61. package/dist/utils/seeds.d.ts.map +1 -1
  62. package/dist/utils/seeds.js +13 -13
  63. package/dist/utils/seeds.js.map +1 -1
  64. package/package.json +1 -1
  65. package/src/@codegen/klend/accounts/LendingMarket.ts +2 -46
  66. package/src/@codegen/klend/errors/custom.ts +2 -47
  67. package/src/@codegen/klend/instructions/index.ts +0 -2
  68. package/src/@codegen/klend/instructions/initReserve.ts +6 -2
  69. package/src/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateralV2.ts +1 -1
  70. package/src/@codegen/klend/instructions/withdrawObligationCollateral.ts +1 -1
  71. package/src/@codegen/klend/instructions/withdrawObligationCollateralV2.ts +1 -1
  72. package/src/@codegen/klend/types/ReserveConfig.ts +30 -72
  73. package/src/@codegen/klend/types/ReserveFees.ts +12 -12
  74. package/src/@codegen/klend/types/UpdateConfigMode.ts +13 -103
  75. package/src/@codegen/klend/types/UpdateLendingMarketMode.ts +0 -60
  76. package/src/@codegen/klend/types/index.ts +2 -12
  77. package/src/classes/manager.ts +0 -2
  78. package/src/classes/market.ts +4 -0
  79. package/src/classes/reserve.ts +5 -7
  80. package/src/idl/klend.json +60 -130
  81. package/src/manager/client_kamino_manager.ts +3 -5
  82. package/src/utils/index.ts +1 -0
  83. package/src/utils/managerTypes.ts +4 -6
  84. package/src/utils/seeds.ts +17 -13
  85. package/dist/@codegen/klend/instructions/seedDepositOnInitReserve.d.ts +0 -13
  86. package/dist/@codegen/klend/instructions/seedDepositOnInitReserve.d.ts.map +0 -1
  87. package/dist/@codegen/klend/instructions/seedDepositOnInitReserve.js +0 -24
  88. package/dist/@codegen/klend/instructions/seedDepositOnInitReserve.js.map +0 -1
  89. package/src/@codegen/klend/instructions/seedDepositOnInitReserve.ts +0 -50
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.12.6",
2
+ "version": "1.11.0",
3
3
  "name": "kamino_lending",
4
4
  "instructions": [
5
5
  {
@@ -93,7 +93,7 @@
93
93
  "name": "initReserve",
94
94
  "accounts": [
95
95
  {
96
- "name": "signer",
96
+ "name": "lendingMarketOwner",
97
97
  "isMut": true,
98
98
  "isSigner": true
99
99
  },
@@ -359,47 +359,6 @@
359
359
  }
360
360
  ]
361
361
  },
362
- {
363
- "name": "seedDepositOnInitReserve",
364
- "accounts": [
365
- {
366
- "name": "signer",
367
- "isMut": false,
368
- "isSigner": true
369
- },
370
- {
371
- "name": "lendingMarket",
372
- "isMut": false,
373
- "isSigner": false
374
- },
375
- {
376
- "name": "reserve",
377
- "isMut": true,
378
- "isSigner": false
379
- },
380
- {
381
- "name": "reserveLiquidityMint",
382
- "isMut": false,
383
- "isSigner": false
384
- },
385
- {
386
- "name": "reserveLiquiditySupply",
387
- "isMut": true,
388
- "isSigner": false
389
- },
390
- {
391
- "name": "initialLiquiditySource",
392
- "isMut": true,
393
- "isSigner": false
394
- },
395
- {
396
- "name": "liquidityTokenProgram",
397
- "isMut": false,
398
- "isSigner": false
399
- }
400
- ],
401
- "args": []
402
- },
403
362
  {
404
363
  "name": "socializeLoss",
405
364
  "accounts": [
@@ -1067,7 +1026,7 @@
1067
1026
  "accounts": [
1068
1027
  {
1069
1028
  "name": "owner",
1070
- "isMut": true,
1029
+ "isMut": false,
1071
1030
  "isSigner": true
1072
1031
  },
1073
1032
  {
@@ -1126,7 +1085,7 @@
1126
1085
  "accounts": [
1127
1086
  {
1128
1087
  "name": "owner",
1129
- "isMut": true,
1088
+ "isMut": false,
1130
1089
  "isSigner": true
1131
1090
  },
1132
1091
  {
@@ -2426,7 +2385,7 @@
2426
2385
  },
2427
2386
  {
2428
2387
  "name": "lendingMarketAuthority",
2429
- "isMut": false,
2388
+ "isMut": true,
2430
2389
  "isSigner": false
2431
2390
  },
2432
2391
  {
@@ -3144,6 +3103,9 @@
3144
3103
  },
3145
3104
  {
3146
3105
  "name": "isFarmDelegated",
3106
+ "docs": [
3107
+ "Indicate if this user state is part of a delegated farm"
3108
+ ],
3147
3109
  "type": "u8"
3148
3110
  },
3149
3111
  {
@@ -3157,6 +3119,10 @@
3157
3119
  },
3158
3120
  {
3159
3121
  "name": "rewardsTallyScaled",
3122
+ "docs": [
3123
+ "Rewards tally used for computation of gained rewards",
3124
+ "(scaled from `Decimal` representation)."
3125
+ ],
3160
3126
  "type": {
3161
3127
  "array": [
3162
3128
  "u128",
@@ -3166,6 +3132,9 @@
3166
3132
  },
3167
3133
  {
3168
3134
  "name": "rewardsIssuedUnclaimed",
3135
+ "docs": [
3136
+ "Number of reward tokens ready for claim"
3137
+ ],
3169
3138
  "type": {
3170
3139
  "array": [
3171
3140
  "u64",
@@ -3184,30 +3153,55 @@
3184
3153
  },
3185
3154
  {
3186
3155
  "name": "activeStakeScaled",
3156
+ "docs": [
3157
+ "User stake deposited and usable, generating rewards and fees.",
3158
+ "(scaled from `Decimal` representation)."
3159
+ ],
3187
3160
  "type": "u128"
3188
3161
  },
3189
3162
  {
3190
3163
  "name": "pendingDepositStakeScaled",
3164
+ "docs": [
3165
+ "User stake deposited but not usable and not generating rewards yet.",
3166
+ "(scaled from `Decimal` representation)."
3167
+ ],
3191
3168
  "type": "u128"
3192
3169
  },
3193
3170
  {
3194
3171
  "name": "pendingDepositStakeTs",
3172
+ "docs": [
3173
+ "After this timestamp, pending user stake can be moved to user stake",
3174
+ "Initialized to now() + delayed user stake period"
3175
+ ],
3195
3176
  "type": "u64"
3196
3177
  },
3197
3178
  {
3198
3179
  "name": "pendingWithdrawalUnstakeScaled",
3180
+ "docs": [
3181
+ "User deposits unstaked, pending for withdrawal, not usable and not generating rewards.",
3182
+ "(scaled from `Decimal` representation)."
3183
+ ],
3199
3184
  "type": "u128"
3200
3185
  },
3201
3186
  {
3202
3187
  "name": "pendingWithdrawalUnstakeTs",
3188
+ "docs": [
3189
+ "After this timestamp, user can withdraw their deposit."
3190
+ ],
3203
3191
  "type": "u64"
3204
3192
  },
3205
3193
  {
3206
3194
  "name": "bump",
3195
+ "docs": [
3196
+ "User bump used for account address validation"
3197
+ ],
3207
3198
  "type": "u64"
3208
3199
  },
3209
3200
  {
3210
3201
  "name": "delegatee",
3202
+ "docs": [
3203
+ "Delegatee used for initialisation - useful to check against"
3204
+ ],
3211
3205
  "type": "publicKey"
3212
3206
  },
3213
3207
  {
@@ -3507,40 +3501,21 @@
3507
3501
  ],
3508
3502
  "type": "u8"
3509
3503
  },
3510
- {
3511
- "name": "priceTriggeredLiquidationDisabled",
3512
- "docs": [
3513
- "Whether the liquidation operations that are triggered by price changes should be disabled.",
3514
- "This includes regular liquidation (i.e. LTV exceeding the unhealthy threshold) and some",
3515
- "obligation orders' execution.",
3516
- "",
3517
- "*Caution:* this flag is *disabling* the liquidations when `1` - contrary to all the other",
3518
- "liquidation-driving flags (see e.g. [Self::autodeleverage_enabled])."
3519
- ],
3520
- "type": "u8"
3521
- },
3522
3504
  {
3523
3505
  "name": "padding2",
3524
3506
  "type": {
3525
3507
  "array": [
3526
3508
  "u8",
3527
- 4
3509
+ 5
3528
3510
  ]
3529
3511
  }
3530
3512
  },
3531
- {
3532
- "name": "proposerAuthority",
3533
- "docs": [
3534
- "Authority that can propose creating of new reserves but cannot enable them."
3535
- ],
3536
- "type": "publicKey"
3537
- },
3538
3513
  {
3539
3514
  "name": "padding1",
3540
3515
  "type": {
3541
3516
  "array": [
3542
3517
  "u64",
3543
- 165
3518
+ 169
3544
3519
  ]
3545
3520
  }
3546
3521
  }
@@ -4070,7 +4045,7 @@
4070
4045
  "name": "UpdateProtocolTakeRate"
4071
4046
  },
4072
4047
  {
4073
- "name": "UpdateFeesOriginationFee"
4048
+ "name": "UpdateFeesBorrowFee"
4074
4049
  },
4075
4050
  {
4076
4051
  "name": "UpdateFeesFlashLoanFee"
@@ -4203,15 +4178,6 @@
4203
4178
  },
4204
4179
  {
4205
4180
  "name": "UpdateProtocolOrderExecutionFee"
4206
- },
4207
- {
4208
- "name": "UpdateProposerAuthorityLock"
4209
- },
4210
- {
4211
- "name": "UpdateMinDeleveragingBonusBps"
4212
- },
4213
- {
4214
- "name": "UpdateBlockCTokenUsage"
4215
4181
  }
4216
4182
  ]
4217
4183
  }
@@ -4369,12 +4335,6 @@
4369
4335
  },
4370
4336
  {
4371
4337
  "name": "UpdateObligationOrderCreationEnabled"
4372
- },
4373
- {
4374
- "name": "UpdateProposerAuthority"
4375
- },
4376
- {
4377
- "name": "UpdatePriceTriggeredLiquidationDisabled"
4378
4338
  }
4379
4339
  ]
4380
4340
  }
@@ -4889,30 +4849,17 @@
4889
4849
  "type": "u16"
4890
4850
  },
4891
4851
  {
4892
- "name": "minDeleveragingBonusBps",
4893
- "docs": [
4894
- "Starting bonus for deleveraging-related liquidations, in bps."
4895
- ],
4896
- "type": "u16"
4897
- },
4898
- {
4899
- "name": "blockCtokenUsage",
4852
+ "name": "reserved2",
4900
4853
  "docs": [
4901
- "Boolean flag to block minting/redeeming of ctokens",
4902
- "Blocks usage of ctokens (minting or withdrawing from obligation)",
4903
- "Effectively blocks deposit_reserve_liquidity and withdraw_obligation_collateral"
4904
- ],
4905
- "type": "u8"
4906
- },
4907
- {
4908
- "name": "reserved1",
4909
- "docs": [
4910
- "Past reserved space - feel free to reuse."
4854
+ "[DEPRECATED] Space that used to hold 2 fields:",
4855
+ "- Boost for side (debt or collateral)",
4856
+ "- Reward points multiplier per obligation type",
4857
+ "Can be re-used after making sure all underlying production account data is zeroed."
4911
4858
  ],
4912
4859
  "type": {
4913
4860
  "array": [
4914
4861
  "u8",
4915
- 6
4862
+ 9
4916
4863
  ]
4917
4864
  }
4918
4865
  },
@@ -5088,15 +5035,13 @@
5088
5035
  "type": "u8"
5089
5036
  },
5090
5037
  {
5091
- "name": "proposerAuthorityLocked",
5092
- "docs": [
5093
- "Boolean flag indicating whether the reserve is locked for the proposer authority.",
5094
- "",
5095
- "Once the proposer have finished preparing the reserve, it must be locked to prevent",
5096
- "further changes to the reserve configuration allowing review and voting on the proposal",
5097
- "without alteration during the voting period."
5098
- ],
5099
- "type": "u8"
5038
+ "name": "reserved1",
5039
+ "type": {
5040
+ "array": [
5041
+ "u8",
5042
+ 1
5043
+ ]
5044
+ }
5100
5045
  },
5101
5046
  {
5102
5047
  "name": "borrowLimitOutsideElevationGroup",
@@ -5160,14 +5105,14 @@
5160
5105
  "kind": "struct",
5161
5106
  "fields": [
5162
5107
  {
5163
- "name": "originationFeeSf",
5108
+ "name": "borrowFeeSf",
5164
5109
  "docs": [
5165
5110
  "Fee assessed on `BorrowObligationLiquidity`, as scaled fraction (60 bits fractional part)",
5166
5111
  "Must be between `0` and `2^60`, such that `2^60 = 1`. A few examples for",
5167
5112
  "clarity:",
5168
5113
  "1% = (1 << 60) / 100 = 11529215046068470",
5169
5114
  "0.01% (1 basis point) = 115292150460685",
5170
- "0.00001% (Aave origination fee) = 115292150461"
5115
+ "0.00001% (Aave borrow fee) = 115292150461"
5171
5116
  ],
5172
5117
  "type": "u64"
5173
5118
  },
@@ -5643,7 +5588,7 @@
5643
5588
  {
5644
5589
  "code": 6005,
5645
5590
  "name": "InvalidSigner",
5646
- "msg": "Signer is not allowed to perform this action"
5591
+ "msg": "Input account must be a signer"
5647
5592
  },
5648
5593
  {
5649
5594
  "code": 6006,
@@ -6264,21 +6209,6 @@
6264
6209
  "code": 6129,
6265
6210
  "name": "NoUpgradeAuthority",
6266
6211
  "msg": "Cannot initialize global config because there is no upgrade authority to the program"
6267
- },
6268
- {
6269
- "code": 6130,
6270
- "name": "InitialAdminDepositExecuted",
6271
- "msg": "Initial admin deposit in reserve already executed"
6272
- },
6273
- {
6274
- "code": 6131,
6275
- "name": "ReserveHasNotReceivedInitialDeposit",
6276
- "msg": "Reserve has not received the initial deposit, cannot update config"
6277
- },
6278
- {
6279
- "code": 6132,
6280
- "name": "CTokenUsageBlocked",
6281
- "msg": "CToken minting/redeeming is blocked for this reserve"
6282
6212
  }
6283
6213
  ]
6284
- }
6214
+ }
@@ -2157,7 +2157,7 @@ function parseReserveConfigFromFile(reserveConfigFromFile: any): ReserveConfig {
2157
2157
  maxLiquidationBonusBps: reserveConfigFromFile.maxLiquidationBonusBps,
2158
2158
  badDebtLiquidationBonusBps: reserveConfigFromFile.badDebtLiquidationBonusBps,
2159
2159
  fees: {
2160
- originationFeeSf: Fraction.fromDecimal(new Decimal(reserveConfigFromFile.fees.borrowFee)).valueSf,
2160
+ borrowFeeSf: Fraction.fromDecimal(new Decimal(reserveConfigFromFile.fees.borrowFee)).valueSf,
2161
2161
  flashLoanFeeSf: Fraction.fromDecimal(new Decimal(reserveConfigFromFile.fees.flashLoanFee)).valueSf,
2162
2162
  padding: Array(8).fill(0),
2163
2163
  },
@@ -2203,9 +2203,7 @@ function parseReserveConfigFromFile(reserveConfigFromFile: any): ReserveConfig {
2203
2203
  borrowLimitAgainstThisCollateralInElevationGroup: parseReserveBorrowLimitAgainstCollInEmode(reserveConfigFromFile),
2204
2204
  deleveragingBonusIncreaseBpsPerDay: new BN(reserveConfigFromFile.deleveragingBonusIncreaseBpsPerDay),
2205
2205
  reserved1: Array(1).fill(0),
2206
- minDeleveragingBonusBps: 0,
2207
- proposerAuthorityLocked: 0,
2208
- blockCtokenUsage: 0
2206
+ reserved2: Array(9).fill(0),
2209
2207
  };
2210
2208
 
2211
2209
  return new ReserveConfig(reserveConfigFields);
@@ -2289,7 +2287,7 @@ function parseReserveConfigToFile(reserveConfig: ReserveConfig) {
2289
2287
  maxLiquidationBonusBps: reserveConfig.maxLiquidationBonusBps,
2290
2288
  badDebtLiquidationBonusBps: reserveConfig.badDebtLiquidationBonusBps,
2291
2289
  fees: {
2292
- borrowFee: new Fraction(reserveConfig.fees.originationFeeSf).toDecimal().toString(),
2290
+ borrowFee: new Fraction(reserveConfig.fees.borrowFeeSf).toDecimal().toString(),
2293
2291
  flashLoanFee: new Fraction(reserveConfig.fees.flashLoanFeeSf).toDecimal().toString(),
2294
2292
  padding: Array(8).fill(0),
2295
2293
  },
@@ -15,3 +15,4 @@ export * from './managerTypes';
15
15
  export * from './fuzz';
16
16
  export * from './rpc';
17
17
  export * from './map';
18
+ export * from './obligations'
@@ -243,7 +243,7 @@ export type AssetReserveConfigParams = {
243
243
  minLiquidationBonusBps: number;
244
244
  badDebtLiquidationBonusBps: number;
245
245
  liquidationThresholdPct: number;
246
- originationFeeSf: Fraction;
246
+ borrowFeeSf: Fraction;
247
247
  flashLoanFeeSf: Fraction;
248
248
  protocolTakeRate: number;
249
249
  elevationGroups: number[];
@@ -260,7 +260,7 @@ export const getDefaultConfigParams = (): AssetReserveConfigParams => {
260
260
  minLiquidationBonusBps: 200,
261
261
  badDebtLiquidationBonusBps: 10,
262
262
  liquidationThresholdPct: 75,
263
- originationFeeSf: ZERO_FRACTION,
263
+ borrowFeeSf: ZERO_FRACTION,
264
264
  flashLoanFeeSf: ZERO_FRACTION,
265
265
  protocolTakeRate: 0,
266
266
  elevationGroups: new Array(20).fill(0),
@@ -310,7 +310,7 @@ function buildReserveConfig(fields: {
310
310
  maxLiquidationBonusBps: fields.configParams.maxLiquidationBonusBps,
311
311
  badDebtLiquidationBonusBps: fields.configParams.badDebtLiquidationBonusBps,
312
312
  fees: {
313
- originationFeeSf: fields.configParams.originationFeeSf.getValue(),
313
+ borrowFeeSf: fields.configParams.borrowFeeSf.getValue(),
314
314
  flashLoanFeeSf: fields.configParams.flashLoanFeeSf.getValue(),
315
315
  padding: Array(6).fill(0),
316
316
  },
@@ -370,9 +370,7 @@ function buildReserveConfig(fields: {
370
370
  borrowLimitAgainstThisCollateralInElevationGroup: Array(32).fill(new BN(0)),
371
371
  deleveragingBonusIncreaseBpsPerDay: new BN(100),
372
372
  reserved1: Array(1).fill(0),
373
- minDeleveragingBonusBps: 0,
374
- proposerAuthorityLocked: 0,
375
- blockCtokenUsage: 0
373
+ reserved2: Array(9).fill(0),
376
374
  };
377
375
 
378
376
  return new ReserveConfig(reserveConfigFields);
@@ -73,12 +73,12 @@ export interface ReservePdas {
73
73
  * @param mint
74
74
  * @returns ReservePdas
75
75
  */
76
- export async function reservePdas(programId: Address, reserve: Address): Promise<ReservePdas> {
76
+ export async function reservePdas(programId: Address, market: Address, mint: Address): Promise<ReservePdas> {
77
77
  const [[liquiditySupplyVault], [collateralMint], [collateralSupplyVault], [feeVault]] = await Promise.all([
78
- reserveLiqSupplyPda(reserve, programId),
79
- reserveCollateralMintPda(reserve, programId),
80
- reserveCollateralSupplyPda(reserve, programId),
81
- reserveFeeVaultPda(reserve, programId),
78
+ reserveLiqSupplyPda(market, mint, programId),
79
+ reserveCollateralMintPda(market, mint, programId),
80
+ reserveCollateralSupplyPda(market, mint, programId),
81
+ reserveFeeVaultPda(market, mint, programId),
82
82
  ]);
83
83
  return {
84
84
  liquiditySupplyVault,
@@ -112,11 +112,12 @@ export function lendingMarketAuthPda(
112
112
  * @returns [pda, bump]
113
113
  */
114
114
  export async function reserveLiqSupplyPda(
115
- reserve: Address,
115
+ lendingMarket: Address,
116
+ mint: Address,
116
117
  programId: Address = PROGRAM_ID
117
118
  ): Promise<ProgramDerivedAddress> {
118
119
  return getProgramDerivedAddress({
119
- seeds: [Buffer.from(RESERVE_LIQ_SUPPLY_SEED), addressEncoder.encode(reserve)],
120
+ seeds: [Buffer.from(RESERVE_LIQ_SUPPLY_SEED), addressEncoder.encode(lendingMarket), addressEncoder.encode(mint)],
120
121
  programAddress: programId,
121
122
  });
122
123
  }
@@ -129,11 +130,12 @@ export async function reserveLiqSupplyPda(
129
130
  * @returns [vaultPda, bump]
130
131
  */
131
132
  export async function reserveFeeVaultPda(
132
- reserve: Address,
133
+ lendingMarket: Address,
134
+ mint: Address,
133
135
  programId: Address = PROGRAM_ID
134
136
  ): Promise<ProgramDerivedAddress> {
135
137
  return getProgramDerivedAddress({
136
- seeds: [Buffer.from(FEE_RECEIVER_SEED), addressEncoder.encode(reserve)],
138
+ seeds: [Buffer.from(FEE_RECEIVER_SEED), addressEncoder.encode(lendingMarket), addressEncoder.encode(mint)],
137
139
  programAddress: programId,
138
140
  });
139
141
  }
@@ -146,11 +148,12 @@ export async function reserveFeeVaultPda(
146
148
  * @returns [mintPda, bump]
147
149
  */
148
150
  export async function reserveCollateralMintPda(
149
- reserve: Address,
151
+ lendingMarket: Address,
152
+ mint: Address,
150
153
  programId: Address = PROGRAM_ID
151
154
  ): Promise<ProgramDerivedAddress> {
152
155
  return getProgramDerivedAddress({
153
- seeds: [Buffer.from(RESERVE_COLL_MINT_SEED), addressEncoder.encode(reserve)],
156
+ seeds: [Buffer.from(RESERVE_COLL_MINT_SEED), addressEncoder.encode(lendingMarket), addressEncoder.encode(mint)],
154
157
  programAddress: programId,
155
158
  });
156
159
  }
@@ -163,11 +166,12 @@ export async function reserveCollateralMintPda(
163
166
  * @returns [pda, bump]
164
167
  */
165
168
  export function reserveCollateralSupplyPda(
166
- reserve: Address,
169
+ lendingMarket: Address,
170
+ mint: Address,
167
171
  programId: Address = PROGRAM_ID
168
172
  ): Promise<ProgramDerivedAddress> {
169
173
  return getProgramDerivedAddress({
170
- seeds: [Buffer.from(RESERVE_COLL_SUPPLY_SEED), addressEncoder.encode(reserve)],
174
+ seeds: [Buffer.from(RESERVE_COLL_SUPPLY_SEED), addressEncoder.encode(lendingMarket), addressEncoder.encode(mint)],
171
175
  programAddress: programId,
172
176
  });
173
177
  }
@@ -1,13 +0,0 @@
1
- import { Address, AccountMeta, AccountSignerMeta, Instruction, TransactionSigner } from "@solana/kit";
2
- export declare const DISCRIMINATOR: Buffer<ArrayBuffer>;
3
- export interface SeedDepositOnInitReserveAccounts {
4
- signer: TransactionSigner;
5
- lendingMarket: Address;
6
- reserve: Address;
7
- reserveLiquidityMint: Address;
8
- reserveLiquiditySupply: Address;
9
- initialLiquiditySource: Address;
10
- liquidityTokenProgram: Address;
11
- }
12
- export declare function seedDepositOnInitReserve(accounts: SeedDepositOnInitReserveAccounts, remainingAccounts?: Array<AccountMeta | AccountSignerMeta>, programAddress?: Address): Instruction<string, readonly (AccountMeta<string> | import("@solana/kit").AccountLookupMeta<string, string>)[]>;
13
- //# sourceMappingURL=seedDepositOnInitReserve.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seedDepositOnInitReserve.d.ts","sourceRoot":"","sources":["../../../../src/@codegen/klend/instructions/seedDepositOnInitReserve.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EAEP,WAAW,EACX,iBAAiB,EACjB,WAAW,EAEX,iBAAiB,EAClB,MAAM,aAAa,CAAA;AAQpB,eAAO,MAAM,aAAa,qBAExB,CAAA;AAEF,MAAM,WAAW,gCAAgC;IAC/C,MAAM,EAAE,iBAAiB,CAAA;IACzB,aAAa,EAAE,OAAO,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;IAChB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,sBAAsB,EAAE,OAAO,CAAA;IAC/B,sBAAsB,EAAE,OAAO,CAAA;IAC/B,qBAAqB,EAAE,OAAO,CAAA;CAC/B;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,gCAAgC,EAC1C,iBAAiB,GAAE,KAAK,CAAC,WAAW,GAAG,iBAAiB,CAAM,EAC9D,cAAc,GAAE,OAAoB,mHAerC"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DISCRIMINATOR = void 0;
4
- exports.seedDepositOnInitReserve = seedDepositOnInitReserve;
5
- const programId_1 = require("../programId");
6
- exports.DISCRIMINATOR = Buffer.from([
7
- 254, 197, 228, 118, 183, 206, 62, 226,
8
- ]);
9
- function seedDepositOnInitReserve(accounts, remainingAccounts = [], programAddress = programId_1.PROGRAM_ID) {
10
- const keys = [
11
- { address: accounts.signer.address, role: 2, signer: accounts.signer },
12
- { address: accounts.lendingMarket, role: 0 },
13
- { address: accounts.reserve, role: 1 },
14
- { address: accounts.reserveLiquidityMint, role: 0 },
15
- { address: accounts.reserveLiquiditySupply, role: 1 },
16
- { address: accounts.initialLiquiditySource, role: 1 },
17
- { address: accounts.liquidityTokenProgram, role: 0 },
18
- ...remainingAccounts,
19
- ];
20
- const data = exports.DISCRIMINATOR;
21
- const ix = { accounts: keys, programAddress, data };
22
- return ix;
23
- }
24
- //# sourceMappingURL=seedDepositOnInitReserve.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seedDepositOnInitReserve.js","sourceRoot":"","sources":["../../../../src/@codegen/klend/instructions/seedDepositOnInitReserve.ts"],"names":[],"mappings":";;;AA+BA,4DAkBC;AAlCD,4CAAyC;AAE5B,QAAA,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC;IACvC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG;CACtC,CAAC,CAAA;AAYF,SAAgB,wBAAwB,CACtC,QAA0C,EAC1C,oBAA4D,EAAE,EAC9D,iBAA0B,sBAAU;IAEpC,MAAM,IAAI,GAA2C;QACnD,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE;QACtE,EAAE,OAAO,EAAE,QAAQ,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE;QAC5C,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE;QACtC,EAAE,OAAO,EAAE,QAAQ,CAAC,oBAAoB,EAAE,IAAI,EAAE,CAAC,EAAE;QACnD,EAAE,OAAO,EAAE,QAAQ,CAAC,sBAAsB,EAAE,IAAI,EAAE,CAAC,EAAE;QACrD,EAAE,OAAO,EAAE,QAAQ,CAAC,sBAAsB,EAAE,IAAI,EAAE,CAAC,EAAE;QACrD,EAAE,OAAO,EAAE,QAAQ,CAAC,qBAAqB,EAAE,IAAI,EAAE,CAAC,EAAE;QACpD,GAAG,iBAAiB;KACrB,CAAA;IACD,MAAM,IAAI,GAAG,qBAAa,CAAA;IAC1B,MAAM,EAAE,GAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC"}
@@ -1,50 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-unused-vars */
2
- import {
3
- Address,
4
- isSome,
5
- AccountMeta,
6
- AccountSignerMeta,
7
- Instruction,
8
- Option,
9
- TransactionSigner,
10
- } from "@solana/kit"
11
- /* eslint-enable @typescript-eslint/no-unused-vars */
12
- import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
13
- import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
14
- import { borshAddress } from "../utils" // eslint-disable-line @typescript-eslint/no-unused-vars
15
- import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
16
- import { PROGRAM_ID } from "../programId"
17
-
18
- export const DISCRIMINATOR = Buffer.from([
19
- 254, 197, 228, 118, 183, 206, 62, 226,
20
- ])
21
-
22
- export interface SeedDepositOnInitReserveAccounts {
23
- signer: TransactionSigner
24
- lendingMarket: Address
25
- reserve: Address
26
- reserveLiquidityMint: Address
27
- reserveLiquiditySupply: Address
28
- initialLiquiditySource: Address
29
- liquidityTokenProgram: Address
30
- }
31
-
32
- export function seedDepositOnInitReserve(
33
- accounts: SeedDepositOnInitReserveAccounts,
34
- remainingAccounts: Array<AccountMeta | AccountSignerMeta> = [],
35
- programAddress: Address = PROGRAM_ID
36
- ) {
37
- const keys: Array<AccountMeta | AccountSignerMeta> = [
38
- { address: accounts.signer.address, role: 2, signer: accounts.signer },
39
- { address: accounts.lendingMarket, role: 0 },
40
- { address: accounts.reserve, role: 1 },
41
- { address: accounts.reserveLiquidityMint, role: 0 },
42
- { address: accounts.reserveLiquiditySupply, role: 1 },
43
- { address: accounts.initialLiquiditySource, role: 1 },
44
- { address: accounts.liquidityTokenProgram, role: 0 },
45
- ...remainingAccounts,
46
- ]
47
- const data = DISCRIMINATOR
48
- const ix: Instruction = { accounts: keys, programAddress, data }
49
- return ix
50
- }