@kamino-finance/klend-sdk 7.4.0-beta.1 → 7.4.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@codegen/klend/accounts/LendingMarket.d.ts +201 -6
- package/dist/@codegen/klend/accounts/LendingMarket.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/LendingMarket.js +130 -8
- package/dist/@codegen/klend/accounts/LendingMarket.js.map +1 -1
- package/dist/@codegen/klend/accounts/Obligation.d.ts +24 -15
- package/dist/@codegen/klend/accounts/Obligation.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/Obligation.js +24 -21
- package/dist/@codegen/klend/accounts/Obligation.js.map +1 -1
- package/dist/@codegen/klend/accounts/Reserve.d.ts +6 -0
- package/dist/@codegen/klend/accounts/Reserve.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/Reserve.js +9 -2
- package/dist/@codegen/klend/accounts/Reserve.js.map +1 -1
- package/dist/@codegen/klend/accounts/UserState.d.ts +0 -75
- package/dist/@codegen/klend/accounts/UserState.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/UserState.js +0 -25
- package/dist/@codegen/klend/accounts/UserState.js.map +1 -1
- package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts +144 -0
- package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts.map +1 -0
- package/dist/@codegen/klend/accounts/WithdrawTicket.js +205 -0
- package/dist/@codegen/klend/accounts/WithdrawTicket.js.map +1 -0
- package/dist/@codegen/klend/accounts/index.d.ts +2 -0
- package/dist/@codegen/klend/accounts/index.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/index.js +3 -1
- package/dist/@codegen/klend/accounts/index.js.map +1 -1
- package/dist/@codegen/klend/errors/custom.d.ts +169 -1
- package/dist/@codegen/klend/errors/custom.d.ts.map +1 -1
- package/dist/@codegen/klend/errors/custom.js +296 -1
- package/dist/@codegen/klend/errors/custom.js.map +1 -1
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts +62 -0
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.js +79 -0
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.js.map +1 -0
- package/dist/@codegen/klend/instructions/fillBorrowOrder.d.ts +36 -0
- package/dist/@codegen/klend/instructions/fillBorrowOrder.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/fillBorrowOrder.js +49 -0
- package/dist/@codegen/klend/instructions/fillBorrowOrder.js.map +1 -0
- package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts +0 -1
- package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/idlMissingTypes.js +0 -2
- package/dist/@codegen/klend/instructions/idlMissingTypes.js.map +1 -1
- package/dist/@codegen/klend/instructions/index.d.ts +10 -0
- package/dist/@codegen/klend/instructions/index.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/index.js +12 -1
- package/dist/@codegen/klend/instructions/index.js.map +1 -1
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts +54 -0
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js +66 -0
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js.map +1 -0
- package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts +33 -0
- package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/setBorrowOrder.js +66 -0
- package/dist/@codegen/klend/instructions/setBorrowOrder.js.map +1 -0
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts +66 -0
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js +41 -0
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js.map +1 -0
- package/dist/@codegen/klend/types/BorrowOrder.d.ts +192 -0
- package/dist/@codegen/klend/types/BorrowOrder.d.ts.map +1 -0
- package/dist/@codegen/klend/types/BorrowOrder.js +194 -0
- package/dist/@codegen/klend/types/BorrowOrder.js.map +1 -0
- package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts +39 -0
- package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts.map +1 -0
- package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js +100 -0
- package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js.map +1 -0
- package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.d.ts +145 -0
- package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.d.ts.map +1 -0
- package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.js +144 -0
- package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.js.map +1 -0
- package/dist/@codegen/klend/types/ObligationLiquidity.d.ts +64 -5
- package/dist/@codegen/klend/types/ObligationLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ObligationLiquidity.js +32 -8
- package/dist/@codegen/klend/types/ObligationLiquidity.js.map +1 -1
- package/dist/@codegen/klend/types/ObligationOrder.d.ts +4 -4
- package/dist/@codegen/klend/types/ObligationOrder.js +2 -2
- package/dist/@codegen/klend/types/ProgressCallbackType.d.ts +32 -0
- package/dist/@codegen/klend/types/ProgressCallbackType.d.ts.map +1 -0
- package/dist/@codegen/klend/types/{AssetTier.js → ProgressCallbackType.js} +24 -48
- package/dist/@codegen/klend/types/ProgressCallbackType.js.map +1 -0
- package/dist/@codegen/klend/types/ReserveConfig.d.ts +60 -5
- package/dist/@codegen/klend/types/ReserveConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ReserveConfig.js +36 -7
- package/dist/@codegen/klend/types/ReserveConfig.js.map +1 -1
- package/dist/@codegen/klend/types/ReserveLiquidity.d.ts +26 -8
- package/dist/@codegen/klend/types/ReserveLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ReserveLiquidity.js +14 -8
- package/dist/@codegen/klend/types/ReserveLiquidity.js.map +1 -1
- package/dist/@codegen/klend/types/UpdateConfigMode.d.ts +40 -14
- package/dist/@codegen/klend/types/UpdateConfigMode.d.ts.map +1 -1
- package/dist/@codegen/klend/types/UpdateConfigMode.js +72 -24
- package/dist/@codegen/klend/types/UpdateConfigMode.js.map +1 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts +130 -0
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts.map +1 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.js +241 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.js.map +1 -1
- package/dist/@codegen/klend/types/WithdrawQueue.d.ts +64 -0
- package/dist/@codegen/klend/types/WithdrawQueue.d.ts.map +1 -0
- package/dist/@codegen/klend/types/WithdrawQueue.js +104 -0
- package/dist/@codegen/klend/types/WithdrawQueue.js.map +1 -0
- package/dist/@codegen/klend/types/index.d.ts +27 -8
- package/dist/@codegen/klend/types/index.d.ts.map +1 -1
- package/dist/@codegen/klend/types/index.js +11 -3
- package/dist/@codegen/klend/types/index.js.map +1 -1
- package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts +8 -5
- package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts.map +1 -1
- package/dist/@codegen/klend/zero_padding/ObligationZP.js +17 -14
- package/dist/@codegen/klend/zero_padding/ObligationZP.js.map +1 -1
- package/dist/@codegen/kvault/accounts/LendingMarket.d.ts +480 -0
- package/dist/@codegen/kvault/accounts/LendingMarket.d.ts.map +1 -0
- package/dist/@codegen/kvault/accounts/LendingMarket.js +480 -0
- package/dist/@codegen/kvault/accounts/LendingMarket.js.map +1 -0
- package/dist/@codegen/kvault/accounts/Obligation.d.ts +208 -0
- package/dist/@codegen/kvault/accounts/Obligation.d.ts.map +1 -0
- package/dist/@codegen/kvault/accounts/Obligation.js +298 -0
- package/dist/@codegen/kvault/accounts/Obligation.js.map +1 -0
- package/dist/@codegen/kvault/accounts/ReferrerTokenState.d.ts +51 -0
- package/dist/@codegen/kvault/accounts/ReferrerTokenState.d.ts.map +1 -0
- package/dist/@codegen/kvault/accounts/ReferrerTokenState.js +137 -0
- package/dist/@codegen/kvault/accounts/ReferrerTokenState.js.map +1 -0
- package/dist/@codegen/kvault/accounts/Reserve.d.ts +6 -0
- package/dist/@codegen/kvault/accounts/Reserve.d.ts.map +1 -1
- package/dist/@codegen/kvault/accounts/Reserve.js +9 -2
- package/dist/@codegen/kvault/accounts/Reserve.js.map +1 -1
- package/dist/@codegen/kvault/accounts/VaultState.d.ts +45 -3
- package/dist/@codegen/kvault/accounts/VaultState.d.ts.map +1 -1
- package/dist/@codegen/kvault/accounts/VaultState.js +28 -4
- package/dist/@codegen/kvault/accounts/VaultState.js.map +1 -1
- package/dist/@codegen/kvault/accounts/WithdrawTicket.d.ts +144 -0
- package/dist/@codegen/kvault/accounts/WithdrawTicket.d.ts.map +1 -0
- package/dist/@codegen/kvault/accounts/WithdrawTicket.js +205 -0
- package/dist/@codegen/kvault/accounts/WithdrawTicket.js.map +1 -0
- package/dist/@codegen/kvault/accounts/index.d.ts +8 -0
- package/dist/@codegen/kvault/accounts/index.d.ts.map +1 -1
- package/dist/@codegen/kvault/accounts/index.js +9 -1
- package/dist/@codegen/kvault/accounts/index.js.map +1 -1
- package/dist/@codegen/kvault/errors/custom.d.ts +81 -1
- package/dist/@codegen/kvault/errors/custom.d.ts.map +1 -1
- package/dist/@codegen/kvault/errors/custom.js +141 -1
- package/dist/@codegen/kvault/errors/custom.js.map +1 -1
- package/dist/@codegen/kvault/instructions/index.d.ts +4 -0
- package/dist/@codegen/kvault/instructions/index.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/index.js +5 -1
- package/dist/@codegen/kvault/instructions/index.js.map +1 -1
- package/dist/@codegen/kvault/instructions/invest.d.ts +9 -0
- package/dist/@codegen/kvault/instructions/invest.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/invest.js +7 -0
- package/dist/@codegen/kvault/instructions/invest.js.map +1 -1
- package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillOrder.d.ts +51 -0
- package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillOrder.d.ts.map +1 -0
- package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillOrder.js +154 -0
- package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillOrder.js.map +1 -0
- package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillWithdrawalTicket.d.ts +54 -0
- package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillWithdrawalTicket.d.ts.map +1 -0
- package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillWithdrawalTicket.js +166 -0
- package/dist/@codegen/kvault/instructions/investInVirtualReserveAndFillWithdrawalTicket.js.map +1 -0
- package/dist/@codegen/kvault/instructions/updateKlendQueueAccounting.d.ts +1 -0
- package/dist/@codegen/kvault/instructions/updateKlendQueueAccounting.d.ts.map +1 -0
- package/dist/@codegen/kvault/instructions/updateKlendQueueAccounting.js +72 -0
- package/dist/@codegen/kvault/instructions/updateKlendQueueAccounting.js.map +1 -0
- package/dist/@codegen/kvault/instructions/updateReserveAllocation.d.ts +3 -1
- package/dist/@codegen/kvault/instructions/updateReserveAllocation.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/updateReserveAllocation.js +3 -0
- package/dist/@codegen/kvault/instructions/updateReserveAllocation.js.map +1 -1
- package/dist/@codegen/kvault/types/BorrowOrder.d.ts +192 -0
- package/dist/@codegen/kvault/types/BorrowOrder.d.ts.map +1 -0
- package/dist/@codegen/kvault/types/BorrowOrder.js +194 -0
- package/dist/@codegen/kvault/types/BorrowOrder.js.map +1 -0
- package/dist/@codegen/kvault/types/ElevationGroup.d.ts +67 -0
- package/dist/@codegen/kvault/types/ElevationGroup.d.ts.map +1 -0
- package/dist/@codegen/kvault/types/ElevationGroup.js +137 -0
- package/dist/@codegen/kvault/types/ElevationGroup.js.map +1 -0
- package/dist/@codegen/kvault/types/FixedTermBorrowRolloverConfig.d.ts +145 -0
- package/dist/@codegen/kvault/types/FixedTermBorrowRolloverConfig.d.ts.map +1 -0
- package/dist/@codegen/kvault/types/FixedTermBorrowRolloverConfig.js +144 -0
- package/dist/@codegen/kvault/types/FixedTermBorrowRolloverConfig.js.map +1 -0
- package/dist/@codegen/kvault/types/ObligationCollateral.d.ts +72 -0
- package/dist/@codegen/kvault/types/ObligationCollateral.d.ts.map +1 -0
- package/dist/@codegen/kvault/types/ObligationCollateral.js +119 -0
- package/dist/@codegen/kvault/types/ObligationCollateral.js.map +1 -0
- package/dist/@codegen/kvault/types/ObligationLiquidity.d.ts +143 -0
- package/dist/@codegen/kvault/types/ObligationLiquidity.d.ts.map +1 -0
- package/dist/@codegen/kvault/types/ObligationLiquidity.js +165 -0
- package/dist/@codegen/kvault/types/ObligationLiquidity.js.map +1 -0
- package/dist/@codegen/kvault/types/ObligationOrder.d.ts +284 -0
- package/dist/@codegen/kvault/types/ObligationOrder.d.ts.map +1 -0
- package/dist/@codegen/kvault/types/ObligationOrder.js +205 -0
- package/dist/@codegen/kvault/types/ObligationOrder.js.map +1 -0
- package/dist/@codegen/kvault/types/ReserveConfig.d.ts +60 -5
- package/dist/@codegen/kvault/types/ReserveConfig.d.ts.map +1 -1
- package/dist/@codegen/kvault/types/ReserveConfig.js +36 -7
- package/dist/@codegen/kvault/types/ReserveConfig.js.map +1 -1
- package/dist/@codegen/kvault/types/ReserveLiquidity.d.ts +26 -8
- package/dist/@codegen/kvault/types/ReserveLiquidity.d.ts.map +1 -1
- package/dist/@codegen/kvault/types/ReserveLiquidity.js +14 -8
- package/dist/@codegen/kvault/types/ReserveLiquidity.js.map +1 -1
- package/dist/@codegen/kvault/types/ReserveType.d.ts +32 -0
- package/dist/@codegen/kvault/types/ReserveType.d.ts.map +1 -0
- package/dist/@codegen/kvault/types/ReserveType.js +108 -0
- package/dist/@codegen/kvault/types/ReserveType.js.map +1 -0
- package/dist/@codegen/kvault/types/VaultAllocation.d.ts +60 -0
- package/dist/@codegen/kvault/types/VaultAllocation.d.ts.map +1 -1
- package/dist/@codegen/kvault/types/VaultAllocation.js +38 -2
- package/dist/@codegen/kvault/types/VaultAllocation.js.map +1 -1
- package/dist/@codegen/kvault/types/WithdrawQueue.d.ts +64 -0
- package/dist/@codegen/kvault/types/WithdrawQueue.d.ts.map +1 -0
- package/dist/@codegen/kvault/types/WithdrawQueue.js +104 -0
- package/dist/@codegen/kvault/types/WithdrawQueue.js.map +1 -0
- package/dist/@codegen/kvault/types/WithdrawTicketProgressEvent.d.ts +19 -0
- package/dist/@codegen/kvault/types/WithdrawTicketProgressEvent.d.ts.map +1 -0
- package/dist/@codegen/kvault/types/WithdrawTicketProgressEvent.js +82 -0
- package/dist/@codegen/kvault/types/WithdrawTicketProgressEvent.js.map +1 -0
- package/dist/@codegen/kvault/types/index.d.ts +34 -0
- package/dist/@codegen/kvault/types/index.d.ts.map +1 -1
- package/dist/@codegen/kvault/types/index.js +19 -1
- package/dist/@codegen/kvault/types/index.js.map +1 -1
- package/dist/classes/action.d.ts +11 -0
- package/dist/classes/action.d.ts.map +1 -1
- package/dist/classes/action.js +66 -0
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/actionTypes.d.ts +29 -0
- package/dist/classes/actionTypes.d.ts.map +1 -1
- package/dist/classes/manager.d.ts +1 -1
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +13 -8
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/market.d.ts +10 -5
- package/dist/classes/market.d.ts.map +1 -1
- package/dist/classes/market.js +22 -15
- package/dist/classes/market.js.map +1 -1
- package/dist/classes/obligation.d.ts +2 -2
- package/dist/classes/obligation.d.ts.map +1 -1
- package/dist/classes/obligation.js +9 -7
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/reserve.d.ts +2 -1
- package/dist/classes/reserve.d.ts.map +1 -1
- package/dist/classes/reserve.js +48 -32
- package/dist/classes/reserve.js.map +1 -1
- package/dist/classes/utils.d.ts +2 -0
- package/dist/classes/utils.d.ts.map +1 -1
- package/dist/classes/utils.js +12 -1
- package/dist/classes/utils.js.map +1 -1
- package/dist/classes/vault.d.ts +4 -2
- package/dist/classes/vault.d.ts.map +1 -1
- package/dist/classes/vault.js +12 -2
- package/dist/classes/vault.js.map +1 -1
- package/dist/idl/klend.json +1461 -106
- package/dist/manager/client_kamino_manager.js +14 -11
- package/dist/manager/client_kamino_manager.js.map +1 -1
- package/dist/obligation_orders/price_based.js +5 -4
- package/dist/obligation_orders/price_based.js.map +1 -1
- package/dist/utils/managerTypes.d.ts.map +1 -1
- package/dist/utils/managerTypes.js +3 -1
- package/dist/utils/managerTypes.js.map +1 -1
- package/dist/utils/seeds.d.ts +24 -0
- package/dist/utils/seeds.d.ts.map +1 -1
- package/dist/utils/seeds.js +41 -1
- package/dist/utils/seeds.js.map +1 -1
- package/dist/utils/validations.d.ts +1 -0
- package/dist/utils/validations.d.ts.map +1 -1
- package/dist/utils/validations.js +5 -0
- package/dist/utils/validations.js.map +1 -1
- package/dist/utils/vault.d.ts.map +1 -1
- package/dist/utils/vault.js +2 -0
- package/dist/utils/vault.js.map +1 -1
- package/package.json +1 -1
- package/src/@codegen/klend/accounts/LendingMarket.ts +284 -12
- package/src/@codegen/klend/accounts/Obligation.ts +42 -31
- package/src/@codegen/klend/accounts/Reserve.ts +13 -2
- package/src/@codegen/klend/accounts/UserState.ts +0 -75
- package/src/@codegen/klend/accounts/WithdrawTicket.ts +280 -0
- package/src/@codegen/klend/accounts/index.ts +2 -0
- package/src/@codegen/klend/errors/custom.ts +333 -0
- package/src/@codegen/klend/instructions/enqueueToWithdraw.ts +120 -0
- package/src/@codegen/klend/instructions/fillBorrowOrder.ts +96 -0
- package/src/@codegen/klend/instructions/idlMissingTypes.ts +0 -3
- package/src/@codegen/klend/instructions/index.ts +19 -0
- package/src/@codegen/klend/instructions/recoverInvalidTicketCollateral.ts +103 -0
- package/src/@codegen/klend/instructions/setBorrowOrder.ts +81 -0
- package/src/@codegen/klend/instructions/withdrawQueuedLiquidity.ts +118 -0
- package/src/@codegen/klend/types/BorrowOrder.ts +267 -0
- package/src/@codegen/klend/types/BorrowOrderConfigArgs.ts +87 -0
- package/src/@codegen/klend/types/FixedTermBorrowRolloverConfig.ts +199 -0
- package/src/@codegen/klend/types/ObligationLiquidity.ts +76 -10
- package/src/@codegen/klend/types/ObligationOrder.ts +4 -4
- package/src/@codegen/klend/types/ProgressCallbackType.ts +91 -0
- package/src/@codegen/klend/types/ReserveConfig.ts +72 -9
- package/src/@codegen/klend/types/ReserveLiquidity.ts +30 -12
- package/src/@codegen/klend/types/UpdateConfigMode.ts +86 -26
- package/src/@codegen/klend/types/UpdateLendingMarketMode.ts +300 -0
- package/src/@codegen/klend/types/WithdrawQueue.ts +117 -0
- package/src/@codegen/klend/types/index.ts +63 -16
- package/src/@codegen/klend/zero_padding/ObligationZP.ts +17 -14
- package/src/@codegen/kvault/accounts/LendingMarket.ts +837 -0
- package/src/@codegen/kvault/accounts/Obligation.ts +459 -0
- package/src/@codegen/kvault/accounts/ReferrerTokenState.ts +160 -0
- package/src/@codegen/kvault/accounts/Reserve.ts +13 -2
- package/src/@codegen/kvault/accounts/VaultState.ts +59 -7
- package/src/@codegen/kvault/accounts/WithdrawTicket.ts +280 -0
- package/src/@codegen/kvault/accounts/index.ts +11 -0
- package/src/@codegen/kvault/errors/custom.ts +152 -0
- package/src/@codegen/kvault/instructions/index.ts +10 -0
- package/src/@codegen/kvault/instructions/invest.ts +16 -0
- package/src/@codegen/kvault/instructions/investInVirtualReserveAndFillOrder.ts +189 -0
- package/src/@codegen/kvault/instructions/investInVirtualReserveAndFillWithdrawalTicket.ts +205 -0
- package/src/@codegen/kvault/instructions/updateKlendQueueAccounting.ts +76 -0
- package/src/@codegen/kvault/instructions/updateReserveAllocation.ts +4 -1
- package/src/@codegen/kvault/types/BorrowOrder.ts +267 -0
- package/src/@codegen/kvault/types/ElevationGroup.ts +134 -0
- package/src/@codegen/kvault/types/FixedTermBorrowRolloverConfig.ts +199 -0
- package/src/@codegen/kvault/types/ObligationCollateral.ts +129 -0
- package/src/@codegen/kvault/types/ObligationLiquidity.ts +226 -0
- package/src/@codegen/kvault/types/ObligationOrder.ts +348 -0
- package/src/@codegen/kvault/types/ReserveConfig.ts +72 -9
- package/src/@codegen/kvault/types/ReserveLiquidity.ts +30 -12
- package/src/@codegen/kvault/types/ReserveType.ts +89 -0
- package/src/@codegen/kvault/types/VaultAllocation.ts +74 -2
- package/src/@codegen/kvault/types/WithdrawQueue.ts +117 -0
- package/src/@codegen/kvault/types/WithdrawTicketProgressEvent.ts +59 -0
- package/src/@codegen/kvault/types/index.ts +52 -0
- package/src/classes/action.ts +115 -1
- package/src/classes/actionTypes.ts +31 -0
- package/src/classes/manager.ts +24 -27
- package/src/classes/market.ts +34 -17
- package/src/classes/obligation.ts +9 -7
- package/src/classes/reserve.ts +48 -45
- package/src/classes/utils.ts +8 -0
- package/src/classes/vault.ts +35 -4
- package/src/idl/klend.json +1461 -106
- package/src/idl/kvault.json +2336 -299
- package/src/manager/client_kamino_manager.ts +14 -12
- package/src/obligation_orders/price_based.ts +7 -6
- package/src/utils/managerTypes.ts +3 -1
- package/src/utils/seeds.ts +49 -0
- package/src/utils/validations.ts +5 -0
- package/src/utils/vault.ts +2 -0
- package/dist/@codegen/klend/types/AssetTier.d.ts +0 -45
- package/dist/@codegen/klend/types/AssetTier.d.ts.map +0 -1
- package/dist/@codegen/klend/types/AssetTier.js.map +0 -1
- package/src/@codegen/klend/types/AssetTier.ts +0 -119
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { address, Address } from "@solana/kit" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as borsh from "@coral-xyz/borsh"
|
|
5
|
+
import { borshAddress } from "../utils"
|
|
6
|
+
|
|
7
|
+
export interface FixedTermBorrowRolloverConfigFields {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the borrow can be permissionlessly prolonged under the following *joint* conditions:
|
|
10
|
+
*
|
|
11
|
+
* The reserve used to re-borrow the liquidity must have:
|
|
12
|
+
* A) the exact same maximum borrow rate as the current one,
|
|
13
|
+
* B) the exact same debt term as the current one,
|
|
14
|
+
* C) sufficient available liquidity (including no withdraw tickets waiting in its queue).
|
|
15
|
+
*
|
|
16
|
+
* The time left until the current debt term expires must be:
|
|
17
|
+
* D) less than [LendingMarket::fixed_rollover_window_duration_seconds].
|
|
18
|
+
*
|
|
19
|
+
* Note: the other settings are only effective when this one is `1`.
|
|
20
|
+
*/
|
|
21
|
+
autoRolloverEnabled: number
|
|
22
|
+
/**
|
|
23
|
+
* When `1`, partially lifts the condition *B* from [Self::auto_rollover_enabled]: additionally
|
|
24
|
+
* allows to use a variable (indefinite) debt term if less than
|
|
25
|
+
* [LendingMarket::variable_rollover_window_duration_seconds] is left until expiration.
|
|
26
|
+
*
|
|
27
|
+
* Note: typically this flag should be used together with [Self::max_borrow_rate_bps] set to
|
|
28
|
+
* `u32::MAX` (to denote a variable-rate reserve).
|
|
29
|
+
*/
|
|
30
|
+
openTermAllowed: number
|
|
31
|
+
/** Internal alignment padding (free to reuse). */
|
|
32
|
+
alignmentPadding: Array<number>
|
|
33
|
+
/**
|
|
34
|
+
* A customization setting that can lift the condition *A* from [Self::auto_rollover_enabled]:
|
|
35
|
+
* when not zeroed, the rollover may use a reserve with a maximum borrow rate equal or lower
|
|
36
|
+
* than the given one.
|
|
37
|
+
*/
|
|
38
|
+
maxBorrowRateBps: number
|
|
39
|
+
/**
|
|
40
|
+
* A customization setting that can lift the condition *B* from [Self::auto_rollover_enabled]:
|
|
41
|
+
* when not zeroed, the rollover may use a reserve with a *fixed* debt term equal or longer
|
|
42
|
+
* than the given one.
|
|
43
|
+
*/
|
|
44
|
+
minDebtTermSeconds: BN
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface FixedTermBorrowRolloverConfigJSON {
|
|
48
|
+
/**
|
|
49
|
+
* Whether the borrow can be permissionlessly prolonged under the following *joint* conditions:
|
|
50
|
+
*
|
|
51
|
+
* The reserve used to re-borrow the liquidity must have:
|
|
52
|
+
* A) the exact same maximum borrow rate as the current one,
|
|
53
|
+
* B) the exact same debt term as the current one,
|
|
54
|
+
* C) sufficient available liquidity (including no withdraw tickets waiting in its queue).
|
|
55
|
+
*
|
|
56
|
+
* The time left until the current debt term expires must be:
|
|
57
|
+
* D) less than [LendingMarket::fixed_rollover_window_duration_seconds].
|
|
58
|
+
*
|
|
59
|
+
* Note: the other settings are only effective when this one is `1`.
|
|
60
|
+
*/
|
|
61
|
+
autoRolloverEnabled: number
|
|
62
|
+
/**
|
|
63
|
+
* When `1`, partially lifts the condition *B* from [Self::auto_rollover_enabled]: additionally
|
|
64
|
+
* allows to use a variable (indefinite) debt term if less than
|
|
65
|
+
* [LendingMarket::variable_rollover_window_duration_seconds] is left until expiration.
|
|
66
|
+
*
|
|
67
|
+
* Note: typically this flag should be used together with [Self::max_borrow_rate_bps] set to
|
|
68
|
+
* `u32::MAX` (to denote a variable-rate reserve).
|
|
69
|
+
*/
|
|
70
|
+
openTermAllowed: number
|
|
71
|
+
/** Internal alignment padding (free to reuse). */
|
|
72
|
+
alignmentPadding: Array<number>
|
|
73
|
+
/**
|
|
74
|
+
* A customization setting that can lift the condition *A* from [Self::auto_rollover_enabled]:
|
|
75
|
+
* when not zeroed, the rollover may use a reserve with a maximum borrow rate equal or lower
|
|
76
|
+
* than the given one.
|
|
77
|
+
*/
|
|
78
|
+
maxBorrowRateBps: number
|
|
79
|
+
/**
|
|
80
|
+
* A customization setting that can lift the condition *B* from [Self::auto_rollover_enabled]:
|
|
81
|
+
* when not zeroed, the rollover may use a reserve with a *fixed* debt term equal or longer
|
|
82
|
+
* than the given one.
|
|
83
|
+
*/
|
|
84
|
+
minDebtTermSeconds: string
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Settings driving the auto-rollover of an [ObligationLiquidity] that uses a fixed-term [Reserve]
|
|
89
|
+
* and approaches the end of its [ReserveConfig::debt_term_seconds].
|
|
90
|
+
*
|
|
91
|
+
* By its nature (not a special case), the zeroed struct mean "no auto-rollover".
|
|
92
|
+
*/
|
|
93
|
+
export class FixedTermBorrowRolloverConfig {
|
|
94
|
+
/**
|
|
95
|
+
* Whether the borrow can be permissionlessly prolonged under the following *joint* conditions:
|
|
96
|
+
*
|
|
97
|
+
* The reserve used to re-borrow the liquidity must have:
|
|
98
|
+
* A) the exact same maximum borrow rate as the current one,
|
|
99
|
+
* B) the exact same debt term as the current one,
|
|
100
|
+
* C) sufficient available liquidity (including no withdraw tickets waiting in its queue).
|
|
101
|
+
*
|
|
102
|
+
* The time left until the current debt term expires must be:
|
|
103
|
+
* D) less than [LendingMarket::fixed_rollover_window_duration_seconds].
|
|
104
|
+
*
|
|
105
|
+
* Note: the other settings are only effective when this one is `1`.
|
|
106
|
+
*/
|
|
107
|
+
readonly autoRolloverEnabled: number
|
|
108
|
+
/**
|
|
109
|
+
* When `1`, partially lifts the condition *B* from [Self::auto_rollover_enabled]: additionally
|
|
110
|
+
* allows to use a variable (indefinite) debt term if less than
|
|
111
|
+
* [LendingMarket::variable_rollover_window_duration_seconds] is left until expiration.
|
|
112
|
+
*
|
|
113
|
+
* Note: typically this flag should be used together with [Self::max_borrow_rate_bps] set to
|
|
114
|
+
* `u32::MAX` (to denote a variable-rate reserve).
|
|
115
|
+
*/
|
|
116
|
+
readonly openTermAllowed: number
|
|
117
|
+
/** Internal alignment padding (free to reuse). */
|
|
118
|
+
readonly alignmentPadding: Array<number>
|
|
119
|
+
/**
|
|
120
|
+
* A customization setting that can lift the condition *A* from [Self::auto_rollover_enabled]:
|
|
121
|
+
* when not zeroed, the rollover may use a reserve with a maximum borrow rate equal or lower
|
|
122
|
+
* than the given one.
|
|
123
|
+
*/
|
|
124
|
+
readonly maxBorrowRateBps: number
|
|
125
|
+
/**
|
|
126
|
+
* A customization setting that can lift the condition *B* from [Self::auto_rollover_enabled]:
|
|
127
|
+
* when not zeroed, the rollover may use a reserve with a *fixed* debt term equal or longer
|
|
128
|
+
* than the given one.
|
|
129
|
+
*/
|
|
130
|
+
readonly minDebtTermSeconds: BN
|
|
131
|
+
|
|
132
|
+
constructor(fields: FixedTermBorrowRolloverConfigFields) {
|
|
133
|
+
this.autoRolloverEnabled = fields.autoRolloverEnabled
|
|
134
|
+
this.openTermAllowed = fields.openTermAllowed
|
|
135
|
+
this.alignmentPadding = fields.alignmentPadding
|
|
136
|
+
this.maxBorrowRateBps = fields.maxBorrowRateBps
|
|
137
|
+
this.minDebtTermSeconds = fields.minDebtTermSeconds
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
static layout(property?: string) {
|
|
141
|
+
return borsh.struct(
|
|
142
|
+
[
|
|
143
|
+
borsh.u8("autoRolloverEnabled"),
|
|
144
|
+
borsh.u8("openTermAllowed"),
|
|
145
|
+
borsh.array(borsh.u8(), 2, "alignmentPadding"),
|
|
146
|
+
borsh.u32("maxBorrowRateBps"),
|
|
147
|
+
borsh.u64("minDebtTermSeconds"),
|
|
148
|
+
],
|
|
149
|
+
property
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
154
|
+
static fromDecoded(obj: any) {
|
|
155
|
+
return new FixedTermBorrowRolloverConfig({
|
|
156
|
+
autoRolloverEnabled: obj.autoRolloverEnabled,
|
|
157
|
+
openTermAllowed: obj.openTermAllowed,
|
|
158
|
+
alignmentPadding: obj.alignmentPadding,
|
|
159
|
+
maxBorrowRateBps: obj.maxBorrowRateBps,
|
|
160
|
+
minDebtTermSeconds: obj.minDebtTermSeconds,
|
|
161
|
+
})
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
static toEncodable(fields: FixedTermBorrowRolloverConfigFields) {
|
|
165
|
+
return {
|
|
166
|
+
autoRolloverEnabled: fields.autoRolloverEnabled,
|
|
167
|
+
openTermAllowed: fields.openTermAllowed,
|
|
168
|
+
alignmentPadding: fields.alignmentPadding,
|
|
169
|
+
maxBorrowRateBps: fields.maxBorrowRateBps,
|
|
170
|
+
minDebtTermSeconds: fields.minDebtTermSeconds,
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
toJSON(): FixedTermBorrowRolloverConfigJSON {
|
|
175
|
+
return {
|
|
176
|
+
autoRolloverEnabled: this.autoRolloverEnabled,
|
|
177
|
+
openTermAllowed: this.openTermAllowed,
|
|
178
|
+
alignmentPadding: this.alignmentPadding,
|
|
179
|
+
maxBorrowRateBps: this.maxBorrowRateBps,
|
|
180
|
+
minDebtTermSeconds: this.minDebtTermSeconds.toString(),
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
static fromJSON(
|
|
185
|
+
obj: FixedTermBorrowRolloverConfigJSON
|
|
186
|
+
): FixedTermBorrowRolloverConfig {
|
|
187
|
+
return new FixedTermBorrowRolloverConfig({
|
|
188
|
+
autoRolloverEnabled: obj.autoRolloverEnabled,
|
|
189
|
+
openTermAllowed: obj.openTermAllowed,
|
|
190
|
+
alignmentPadding: obj.alignmentPadding,
|
|
191
|
+
maxBorrowRateBps: obj.maxBorrowRateBps,
|
|
192
|
+
minDebtTermSeconds: new BN(obj.minDebtTermSeconds),
|
|
193
|
+
})
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
toEncodable() {
|
|
197
|
+
return FixedTermBorrowRolloverConfig.toEncodable(this)
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -9,7 +9,17 @@ export interface ObligationLiquidityFields {
|
|
|
9
9
|
borrowReserve: Address
|
|
10
10
|
/** Borrow rate used for calculating interest (big scaled fraction) */
|
|
11
11
|
cumulativeBorrowRateBsf: types.BigFractionBytesFields
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The timestamp at which this debt was taken.
|
|
14
|
+
* More specifically: when the *first* borrow operation from this reserve happened.
|
|
15
|
+
* This means that:
|
|
16
|
+
* - adding debt of the same reserve does *not* change this timestamp,
|
|
17
|
+
* - repaying the entire debt of this reserve *does* reset this timestamp.
|
|
18
|
+
*
|
|
19
|
+
* Note: this field is *not* only metadata: it is used in the logic, e.g. for enforcing the
|
|
20
|
+
* fixed-term borrows (i.e. those induced by [ReserveConfig::debt_term_seconds]).
|
|
21
|
+
*/
|
|
22
|
+
firstBorrowedAtTimestamp: BN
|
|
13
23
|
/** Amount of liquidity borrowed plus interest (scaled fraction) */
|
|
14
24
|
borrowedAmountSf: BN
|
|
15
25
|
/** Liquidity market value in quote currency (scaled fraction) */
|
|
@@ -18,6 +28,11 @@ export interface ObligationLiquidityFields {
|
|
|
18
28
|
borrowFactorAdjustedMarketValueSf: BN
|
|
19
29
|
/** Amount of liquidity borrowed outside of an elevation group */
|
|
20
30
|
borrowedAmountOutsideElevationGroups: BN
|
|
31
|
+
/**
|
|
32
|
+
* The user's auto-rollover opt-ins - only effective when this borrow is fixed-term (i.e. its
|
|
33
|
+
* reserve has a non-zero [ReserveConfig::debt_term_seconds]).
|
|
34
|
+
*/
|
|
35
|
+
fixedTermBorrowRolloverConfig: types.FixedTermBorrowRolloverConfigFields
|
|
21
36
|
padding2: Array<BN>
|
|
22
37
|
}
|
|
23
38
|
|
|
@@ -26,7 +41,17 @@ export interface ObligationLiquidityJSON {
|
|
|
26
41
|
borrowReserve: string
|
|
27
42
|
/** Borrow rate used for calculating interest (big scaled fraction) */
|
|
28
43
|
cumulativeBorrowRateBsf: types.BigFractionBytesJSON
|
|
29
|
-
|
|
44
|
+
/**
|
|
45
|
+
* The timestamp at which this debt was taken.
|
|
46
|
+
* More specifically: when the *first* borrow operation from this reserve happened.
|
|
47
|
+
* This means that:
|
|
48
|
+
* - adding debt of the same reserve does *not* change this timestamp,
|
|
49
|
+
* - repaying the entire debt of this reserve *does* reset this timestamp.
|
|
50
|
+
*
|
|
51
|
+
* Note: this field is *not* only metadata: it is used in the logic, e.g. for enforcing the
|
|
52
|
+
* fixed-term borrows (i.e. those induced by [ReserveConfig::debt_term_seconds]).
|
|
53
|
+
*/
|
|
54
|
+
firstBorrowedAtTimestamp: string
|
|
30
55
|
/** Amount of liquidity borrowed plus interest (scaled fraction) */
|
|
31
56
|
borrowedAmountSf: string
|
|
32
57
|
/** Liquidity market value in quote currency (scaled fraction) */
|
|
@@ -35,6 +60,11 @@ export interface ObligationLiquidityJSON {
|
|
|
35
60
|
borrowFactorAdjustedMarketValueSf: string
|
|
36
61
|
/** Amount of liquidity borrowed outside of an elevation group */
|
|
37
62
|
borrowedAmountOutsideElevationGroups: string
|
|
63
|
+
/**
|
|
64
|
+
* The user's auto-rollover opt-ins - only effective when this borrow is fixed-term (i.e. its
|
|
65
|
+
* reserve has a non-zero [ReserveConfig::debt_term_seconds]).
|
|
66
|
+
*/
|
|
67
|
+
fixedTermBorrowRolloverConfig: types.FixedTermBorrowRolloverConfigJSON
|
|
38
68
|
padding2: Array<string>
|
|
39
69
|
}
|
|
40
70
|
|
|
@@ -44,7 +74,17 @@ export class ObligationLiquidity {
|
|
|
44
74
|
readonly borrowReserve: Address
|
|
45
75
|
/** Borrow rate used for calculating interest (big scaled fraction) */
|
|
46
76
|
readonly cumulativeBorrowRateBsf: types.BigFractionBytes
|
|
47
|
-
|
|
77
|
+
/**
|
|
78
|
+
* The timestamp at which this debt was taken.
|
|
79
|
+
* More specifically: when the *first* borrow operation from this reserve happened.
|
|
80
|
+
* This means that:
|
|
81
|
+
* - adding debt of the same reserve does *not* change this timestamp,
|
|
82
|
+
* - repaying the entire debt of this reserve *does* reset this timestamp.
|
|
83
|
+
*
|
|
84
|
+
* Note: this field is *not* only metadata: it is used in the logic, e.g. for enforcing the
|
|
85
|
+
* fixed-term borrows (i.e. those induced by [ReserveConfig::debt_term_seconds]).
|
|
86
|
+
*/
|
|
87
|
+
readonly firstBorrowedAtTimestamp: BN
|
|
48
88
|
/** Amount of liquidity borrowed plus interest (scaled fraction) */
|
|
49
89
|
readonly borrowedAmountSf: BN
|
|
50
90
|
/** Liquidity market value in quote currency (scaled fraction) */
|
|
@@ -53,6 +93,11 @@ export class ObligationLiquidity {
|
|
|
53
93
|
readonly borrowFactorAdjustedMarketValueSf: BN
|
|
54
94
|
/** Amount of liquidity borrowed outside of an elevation group */
|
|
55
95
|
readonly borrowedAmountOutsideElevationGroups: BN
|
|
96
|
+
/**
|
|
97
|
+
* The user's auto-rollover opt-ins - only effective when this borrow is fixed-term (i.e. its
|
|
98
|
+
* reserve has a non-zero [ReserveConfig::debt_term_seconds]).
|
|
99
|
+
*/
|
|
100
|
+
readonly fixedTermBorrowRolloverConfig: types.FixedTermBorrowRolloverConfig
|
|
56
101
|
readonly padding2: Array<BN>
|
|
57
102
|
|
|
58
103
|
constructor(fields: ObligationLiquidityFields) {
|
|
@@ -60,13 +105,17 @@ export class ObligationLiquidity {
|
|
|
60
105
|
this.cumulativeBorrowRateBsf = new types.BigFractionBytes({
|
|
61
106
|
...fields.cumulativeBorrowRateBsf,
|
|
62
107
|
})
|
|
63
|
-
this.
|
|
108
|
+
this.firstBorrowedAtTimestamp = fields.firstBorrowedAtTimestamp
|
|
64
109
|
this.borrowedAmountSf = fields.borrowedAmountSf
|
|
65
110
|
this.marketValueSf = fields.marketValueSf
|
|
66
111
|
this.borrowFactorAdjustedMarketValueSf =
|
|
67
112
|
fields.borrowFactorAdjustedMarketValueSf
|
|
68
113
|
this.borrowedAmountOutsideElevationGroups =
|
|
69
114
|
fields.borrowedAmountOutsideElevationGroups
|
|
115
|
+
this.fixedTermBorrowRolloverConfig =
|
|
116
|
+
new types.FixedTermBorrowRolloverConfig({
|
|
117
|
+
...fields.fixedTermBorrowRolloverConfig,
|
|
118
|
+
})
|
|
70
119
|
this.padding2 = fields.padding2
|
|
71
120
|
}
|
|
72
121
|
|
|
@@ -75,12 +124,15 @@ export class ObligationLiquidity {
|
|
|
75
124
|
[
|
|
76
125
|
borshAddress("borrowReserve"),
|
|
77
126
|
types.BigFractionBytes.layout("cumulativeBorrowRateBsf"),
|
|
78
|
-
borsh.u64("
|
|
127
|
+
borsh.u64("firstBorrowedAtTimestamp"),
|
|
79
128
|
borsh.u128("borrowedAmountSf"),
|
|
80
129
|
borsh.u128("marketValueSf"),
|
|
81
130
|
borsh.u128("borrowFactorAdjustedMarketValueSf"),
|
|
82
131
|
borsh.u64("borrowedAmountOutsideElevationGroups"),
|
|
83
|
-
|
|
132
|
+
types.FixedTermBorrowRolloverConfig.layout(
|
|
133
|
+
"fixedTermBorrowRolloverConfig"
|
|
134
|
+
),
|
|
135
|
+
borsh.array(borsh.u64(), 5, "padding2"),
|
|
84
136
|
],
|
|
85
137
|
property
|
|
86
138
|
)
|
|
@@ -93,12 +145,16 @@ export class ObligationLiquidity {
|
|
|
93
145
|
cumulativeBorrowRateBsf: types.BigFractionBytes.fromDecoded(
|
|
94
146
|
obj.cumulativeBorrowRateBsf
|
|
95
147
|
),
|
|
96
|
-
|
|
148
|
+
firstBorrowedAtTimestamp: obj.firstBorrowedAtTimestamp,
|
|
97
149
|
borrowedAmountSf: obj.borrowedAmountSf,
|
|
98
150
|
marketValueSf: obj.marketValueSf,
|
|
99
151
|
borrowFactorAdjustedMarketValueSf: obj.borrowFactorAdjustedMarketValueSf,
|
|
100
152
|
borrowedAmountOutsideElevationGroups:
|
|
101
153
|
obj.borrowedAmountOutsideElevationGroups,
|
|
154
|
+
fixedTermBorrowRolloverConfig:
|
|
155
|
+
types.FixedTermBorrowRolloverConfig.fromDecoded(
|
|
156
|
+
obj.fixedTermBorrowRolloverConfig
|
|
157
|
+
),
|
|
102
158
|
padding2: obj.padding2,
|
|
103
159
|
})
|
|
104
160
|
}
|
|
@@ -109,13 +165,17 @@ export class ObligationLiquidity {
|
|
|
109
165
|
cumulativeBorrowRateBsf: types.BigFractionBytes.toEncodable(
|
|
110
166
|
fields.cumulativeBorrowRateBsf
|
|
111
167
|
),
|
|
112
|
-
|
|
168
|
+
firstBorrowedAtTimestamp: fields.firstBorrowedAtTimestamp,
|
|
113
169
|
borrowedAmountSf: fields.borrowedAmountSf,
|
|
114
170
|
marketValueSf: fields.marketValueSf,
|
|
115
171
|
borrowFactorAdjustedMarketValueSf:
|
|
116
172
|
fields.borrowFactorAdjustedMarketValueSf,
|
|
117
173
|
borrowedAmountOutsideElevationGroups:
|
|
118
174
|
fields.borrowedAmountOutsideElevationGroups,
|
|
175
|
+
fixedTermBorrowRolloverConfig:
|
|
176
|
+
types.FixedTermBorrowRolloverConfig.toEncodable(
|
|
177
|
+
fields.fixedTermBorrowRolloverConfig
|
|
178
|
+
),
|
|
119
179
|
padding2: fields.padding2,
|
|
120
180
|
}
|
|
121
181
|
}
|
|
@@ -124,13 +184,15 @@ export class ObligationLiquidity {
|
|
|
124
184
|
return {
|
|
125
185
|
borrowReserve: this.borrowReserve,
|
|
126
186
|
cumulativeBorrowRateBsf: this.cumulativeBorrowRateBsf.toJSON(),
|
|
127
|
-
|
|
187
|
+
firstBorrowedAtTimestamp: this.firstBorrowedAtTimestamp.toString(),
|
|
128
188
|
borrowedAmountSf: this.borrowedAmountSf.toString(),
|
|
129
189
|
marketValueSf: this.marketValueSf.toString(),
|
|
130
190
|
borrowFactorAdjustedMarketValueSf:
|
|
131
191
|
this.borrowFactorAdjustedMarketValueSf.toString(),
|
|
132
192
|
borrowedAmountOutsideElevationGroups:
|
|
133
193
|
this.borrowedAmountOutsideElevationGroups.toString(),
|
|
194
|
+
fixedTermBorrowRolloverConfig:
|
|
195
|
+
this.fixedTermBorrowRolloverConfig.toJSON(),
|
|
134
196
|
padding2: this.padding2.map((item) => item.toString()),
|
|
135
197
|
}
|
|
136
198
|
}
|
|
@@ -141,7 +203,7 @@ export class ObligationLiquidity {
|
|
|
141
203
|
cumulativeBorrowRateBsf: types.BigFractionBytes.fromJSON(
|
|
142
204
|
obj.cumulativeBorrowRateBsf
|
|
143
205
|
),
|
|
144
|
-
|
|
206
|
+
firstBorrowedAtTimestamp: new BN(obj.firstBorrowedAtTimestamp),
|
|
145
207
|
borrowedAmountSf: new BN(obj.borrowedAmountSf),
|
|
146
208
|
marketValueSf: new BN(obj.marketValueSf),
|
|
147
209
|
borrowFactorAdjustedMarketValueSf: new BN(
|
|
@@ -150,6 +212,10 @@ export class ObligationLiquidity {
|
|
|
150
212
|
borrowedAmountOutsideElevationGroups: new BN(
|
|
151
213
|
obj.borrowedAmountOutsideElevationGroups
|
|
152
214
|
),
|
|
215
|
+
fixedTermBorrowRolloverConfig:
|
|
216
|
+
types.FixedTermBorrowRolloverConfig.fromJSON(
|
|
217
|
+
obj.fixedTermBorrowRolloverConfig
|
|
218
|
+
),
|
|
153
219
|
padding2: obj.padding2.map((item) => new BN(item)),
|
|
154
220
|
})
|
|
155
221
|
}
|
|
@@ -77,7 +77,7 @@ export interface ObligationOrderFields {
|
|
|
77
77
|
*/
|
|
78
78
|
opportunityType: number
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
80
|
+
* Alignment padding.
|
|
81
81
|
* The fields above take up 2+2+1+1 bytes = 48 bits, which means we need 80 bits = 10 bytes to
|
|
82
82
|
* align with `u128`s.
|
|
83
83
|
*/
|
|
@@ -162,7 +162,7 @@ export interface ObligationOrderJSON {
|
|
|
162
162
|
*/
|
|
163
163
|
opportunityType: number
|
|
164
164
|
/**
|
|
165
|
-
*
|
|
165
|
+
* Alignment padding.
|
|
166
166
|
* The fields above take up 2+2+1+1 bytes = 48 bits, which means we need 80 bits = 10 bytes to
|
|
167
167
|
* align with `u128`s.
|
|
168
168
|
*/
|
|
@@ -176,7 +176,7 @@ export interface ObligationOrderJSON {
|
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
178
|
* A single obligation order.
|
|
179
|
-
* See [Obligation::
|
|
179
|
+
* See [Obligation::obligation_orders].
|
|
180
180
|
*/
|
|
181
181
|
export class ObligationOrder {
|
|
182
182
|
/**
|
|
@@ -251,7 +251,7 @@ export class ObligationOrder {
|
|
|
251
251
|
*/
|
|
252
252
|
readonly opportunityType: number
|
|
253
253
|
/**
|
|
254
|
-
*
|
|
254
|
+
* Alignment padding.
|
|
255
255
|
* The fields above take up 2+2+1+1 bytes = 48 bits, which means we need 80 bits = 10 bytes to
|
|
256
256
|
* align with `u128`s.
|
|
257
257
|
*/
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { address, Address } from "@solana/kit" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as borsh from "@coral-xyz/borsh"
|
|
5
|
+
import { borshAddress } from "../utils"
|
|
6
|
+
|
|
7
|
+
export interface NoneJSON {
|
|
8
|
+
kind: "None"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class None {
|
|
12
|
+
static readonly discriminator = 0
|
|
13
|
+
static readonly kind = "None"
|
|
14
|
+
readonly discriminator = 0
|
|
15
|
+
readonly kind = "None"
|
|
16
|
+
|
|
17
|
+
toJSON(): NoneJSON {
|
|
18
|
+
return {
|
|
19
|
+
kind: "None",
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
toEncodable() {
|
|
24
|
+
return {
|
|
25
|
+
None: {},
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface KlendQueueAccountingHandlerOnKvaultJSON {
|
|
31
|
+
kind: "KlendQueueAccountingHandlerOnKvault"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class KlendQueueAccountingHandlerOnKvault {
|
|
35
|
+
static readonly discriminator = 1
|
|
36
|
+
static readonly kind = "KlendQueueAccountingHandlerOnKvault"
|
|
37
|
+
readonly discriminator = 1
|
|
38
|
+
readonly kind = "KlendQueueAccountingHandlerOnKvault"
|
|
39
|
+
|
|
40
|
+
toJSON(): KlendQueueAccountingHandlerOnKvaultJSON {
|
|
41
|
+
return {
|
|
42
|
+
kind: "KlendQueueAccountingHandlerOnKvault",
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
toEncodable() {
|
|
47
|
+
return {
|
|
48
|
+
KlendQueueAccountingHandlerOnKvault: {},
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
+
export function fromDecoded(obj: any): types.ProgressCallbackTypeKind {
|
|
55
|
+
if (typeof obj !== "object") {
|
|
56
|
+
throw new Error("Invalid enum object")
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if ("None" in obj) {
|
|
60
|
+
return new None()
|
|
61
|
+
}
|
|
62
|
+
if ("KlendQueueAccountingHandlerOnKvault" in obj) {
|
|
63
|
+
return new KlendQueueAccountingHandlerOnKvault()
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
throw new Error("Invalid enum object")
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function fromJSON(
|
|
70
|
+
obj: types.ProgressCallbackTypeJSON
|
|
71
|
+
): types.ProgressCallbackTypeKind {
|
|
72
|
+
switch (obj.kind) {
|
|
73
|
+
case "None": {
|
|
74
|
+
return new None()
|
|
75
|
+
}
|
|
76
|
+
case "KlendQueueAccountingHandlerOnKvault": {
|
|
77
|
+
return new KlendQueueAccountingHandlerOnKvault()
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function layout(property?: string) {
|
|
83
|
+
const ret = borsh.rustEnum([
|
|
84
|
+
borsh.struct([], "None"),
|
|
85
|
+
borsh.struct([], "KlendQueueAccountingHandlerOnKvault"),
|
|
86
|
+
])
|
|
87
|
+
if (property !== undefined) {
|
|
88
|
+
return ret.replicate(property)
|
|
89
|
+
}
|
|
90
|
+
return ret
|
|
91
|
+
}
|