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

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 (240) hide show
  1. package/dist/@codegen/klend/accounts/LendingMarket.d.ts +3 -144
  2. package/dist/@codegen/klend/accounts/LendingMarket.d.ts.map +1 -1
  3. package/dist/@codegen/klend/accounts/LendingMarket.js +3 -105
  4. package/dist/@codegen/klend/accounts/LendingMarket.js.map +1 -1
  5. package/dist/@codegen/klend/accounts/Obligation.d.ts +15 -30
  6. package/dist/@codegen/klend/accounts/Obligation.d.ts.map +1 -1
  7. package/dist/@codegen/klend/accounts/Obligation.js +21 -31
  8. package/dist/@codegen/klend/accounts/Obligation.js.map +1 -1
  9. package/dist/@codegen/klend/accounts/Reserve.d.ts +0 -6
  10. package/dist/@codegen/klend/accounts/Reserve.d.ts.map +1 -1
  11. package/dist/@codegen/klend/accounts/Reserve.js +2 -9
  12. package/dist/@codegen/klend/accounts/Reserve.js.map +1 -1
  13. package/dist/@codegen/klend/accounts/UserState.d.ts +75 -0
  14. package/dist/@codegen/klend/accounts/UserState.d.ts.map +1 -1
  15. package/dist/@codegen/klend/accounts/UserState.js +25 -0
  16. package/dist/@codegen/klend/accounts/UserState.js.map +1 -1
  17. package/dist/@codegen/klend/accounts/index.d.ts +0 -6
  18. package/dist/@codegen/klend/accounts/index.d.ts.map +1 -1
  19. package/dist/@codegen/klend/accounts/index.js +1 -7
  20. package/dist/@codegen/klend/accounts/index.js.map +1 -1
  21. package/dist/@codegen/klend/errors/custom.d.ts +2 -226
  22. package/dist/@codegen/klend/errors/custom.d.ts.map +1 -1
  23. package/dist/@codegen/klend/errors/custom.js +3 -396
  24. package/dist/@codegen/klend/errors/custom.js.map +1 -1
  25. package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts +2 -1
  26. package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts.map +1 -1
  27. package/dist/@codegen/klend/instructions/idlMissingTypes.js +2 -6
  28. package/dist/@codegen/klend/instructions/idlMissingTypes.js.map +1 -1
  29. package/dist/@codegen/klend/instructions/index.d.ts +0 -16
  30. package/dist/@codegen/klend/instructions/index.d.ts.map +1 -1
  31. package/dist/@codegen/klend/instructions/index.js +1 -18
  32. package/dist/@codegen/klend/instructions/index.js.map +1 -1
  33. package/dist/@codegen/klend/instructions/initReserve.d.ts +1 -1
  34. package/dist/@codegen/klend/instructions/initReserve.d.ts.map +1 -1
  35. package/dist/@codegen/klend/instructions/initReserve.js +5 -1
  36. package/dist/@codegen/klend/instructions/initReserve.js.map +1 -1
  37. package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.js +1 -1
  38. package/dist/@codegen/klend/instructions/updateGlobalConfig.d.ts +1 -1
  39. package/dist/@codegen/klend/instructions/updateGlobalConfig.d.ts.map +1 -1
  40. package/dist/@codegen/klend/instructions/updateGlobalConfig.js +0 -1
  41. package/dist/@codegen/klend/instructions/updateGlobalConfig.js.map +1 -1
  42. package/dist/@codegen/klend/instructions/updateReserveConfig.d.ts +1 -1
  43. package/dist/@codegen/klend/instructions/updateReserveConfig.d.ts.map +1 -1
  44. package/dist/@codegen/klend/instructions/updateReserveConfig.js +0 -1
  45. package/dist/@codegen/klend/instructions/updateReserveConfig.js.map +1 -1
  46. package/dist/@codegen/klend/instructions/withdrawObligationCollateral.js +1 -1
  47. package/dist/@codegen/klend/instructions/withdrawObligationCollateralV2.js +1 -1
  48. package/dist/@codegen/klend/types/AssetTier.d.ts +45 -0
  49. package/dist/@codegen/klend/types/AssetTier.d.ts.map +1 -0
  50. package/dist/@codegen/klend/types/AssetTier.js +132 -0
  51. package/dist/@codegen/klend/types/AssetTier.js.map +1 -0
  52. package/dist/@codegen/klend/types/ObligationLiquidity.d.ts +5 -35
  53. package/dist/@codegen/klend/types/ObligationLiquidity.d.ts.map +1 -1
  54. package/dist/@codegen/klend/types/ObligationLiquidity.js +7 -17
  55. package/dist/@codegen/klend/types/ObligationLiquidity.js.map +1 -1
  56. package/dist/@codegen/klend/types/ObligationOrder.d.ts +4 -4
  57. package/dist/@codegen/klend/types/ObligationOrder.js +2 -2
  58. package/dist/@codegen/klend/types/ReserveConfig.d.ts +29 -141
  59. package/dist/@codegen/klend/types/ReserveConfig.d.ts.map +1 -1
  60. package/dist/@codegen/klend/types/ReserveConfig.js +25 -89
  61. package/dist/@codegen/klend/types/ReserveConfig.js.map +1 -1
  62. package/dist/@codegen/klend/types/ReserveFees.d.ts +8 -8
  63. package/dist/@codegen/klend/types/ReserveFees.d.ts.map +1 -1
  64. package/dist/@codegen/klend/types/ReserveFees.js +8 -8
  65. package/dist/@codegen/klend/types/ReserveFees.js.map +1 -1
  66. package/dist/@codegen/klend/types/ReserveLiquidity.d.ts +8 -26
  67. package/dist/@codegen/klend/types/ReserveLiquidity.d.ts.map +1 -1
  68. package/dist/@codegen/klend/types/ReserveLiquidity.js +8 -14
  69. package/dist/@codegen/klend/types/ReserveLiquidity.js.map +1 -1
  70. package/dist/@codegen/klend/types/UpdateConfigMode.d.ts +14 -92
  71. package/dist/@codegen/klend/types/UpdateConfigMode.d.ts.map +1 -1
  72. package/dist/@codegen/klend/types/UpdateConfigMode.js +23 -168
  73. package/dist/@codegen/klend/types/UpdateConfigMode.js.map +1 -1
  74. package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts +0 -130
  75. package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts.map +1 -1
  76. package/dist/@codegen/klend/types/UpdateLendingMarketMode.js +1 -241
  77. package/dist/@codegen/klend/types/UpdateLendingMarketMode.js.map +1 -1
  78. package/dist/@codegen/klend/types/index.d.ts +8 -10
  79. package/dist/@codegen/klend/types/index.d.ts.map +1 -1
  80. package/dist/@codegen/klend/types/index.js +3 -7
  81. package/dist/@codegen/klend/types/index.js.map +1 -1
  82. package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts +4 -9
  83. package/dist/@codegen/klend/zero_padding/ObligationZP.d.ts.map +1 -1
  84. package/dist/@codegen/klend/zero_padding/ObligationZP.js +13 -22
  85. package/dist/@codegen/klend/zero_padding/ObligationZP.js.map +1 -1
  86. package/dist/classes/action.d.ts +3 -30
  87. package/dist/classes/action.d.ts.map +1 -1
  88. package/dist/classes/action.js +10 -364
  89. package/dist/classes/action.js.map +1 -1
  90. package/dist/classes/manager.d.ts.map +1 -1
  91. package/dist/classes/manager.js +0 -10
  92. package/dist/classes/manager.js.map +1 -1
  93. package/dist/classes/market.d.ts +2 -6
  94. package/dist/classes/market.d.ts.map +1 -1
  95. package/dist/classes/market.js +6 -26
  96. package/dist/classes/market.js.map +1 -1
  97. package/dist/classes/obligation.js +1 -1
  98. package/dist/classes/obligation.js.map +1 -1
  99. package/dist/classes/reserve.d.ts.map +1 -1
  100. package/dist/classes/reserve.js +7 -13
  101. package/dist/classes/reserve.js.map +1 -1
  102. package/dist/classes/unstakingPool.d.ts +3 -20
  103. package/dist/classes/unstakingPool.d.ts.map +1 -1
  104. package/dist/classes/unstakingPool.js +8 -62
  105. package/dist/classes/unstakingPool.js.map +1 -1
  106. package/dist/classes/vault.d.ts +1 -1
  107. package/dist/classes/vault.d.ts.map +1 -1
  108. package/dist/classes/vault.js +46 -28
  109. package/dist/classes/vault.js.map +1 -1
  110. package/dist/idl/klend.json +293 -2186
  111. package/dist/lending_operations/index.d.ts +0 -1
  112. package/dist/lending_operations/index.d.ts.map +1 -1
  113. package/dist/lending_operations/index.js +0 -1
  114. package/dist/lending_operations/index.js.map +1 -1
  115. package/dist/manager/client_kamino_manager.js +9 -12
  116. package/dist/manager/client_kamino_manager.js.map +1 -1
  117. package/dist/utils/ata.d.ts +10 -1
  118. package/dist/utils/ata.d.ts.map +1 -1
  119. package/dist/utils/ata.js +47 -0
  120. package/dist/utils/ata.js.map +1 -1
  121. package/dist/utils/managerTypes.d.ts.map +1 -1
  122. package/dist/utils/managerTypes.js +4 -9
  123. package/dist/utils/managerTypes.js.map +1 -1
  124. package/dist/utils/seeds.d.ts +14 -10
  125. package/dist/utils/seeds.d.ts.map +1 -1
  126. package/dist/utils/seeds.js +22 -25
  127. package/dist/utils/seeds.js.map +1 -1
  128. package/package.json +1 -1
  129. package/src/@codegen/klend/accounts/LendingMarket.ts +5 -210
  130. package/src/@codegen/klend/accounts/Obligation.ts +31 -53
  131. package/src/@codegen/klend/accounts/Reserve.ts +2 -13
  132. package/src/@codegen/klend/accounts/UserState.ts +75 -0
  133. package/src/@codegen/klend/accounts/index.ts +0 -6
  134. package/src/@codegen/klend/errors/custom.ts +2 -427
  135. package/src/@codegen/klend/instructions/idlMissingTypes.ts +4 -7
  136. package/src/@codegen/klend/instructions/index.ts +0 -34
  137. package/src/@codegen/klend/instructions/initReserve.ts +6 -2
  138. package/src/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.ts +1 -1
  139. package/src/@codegen/klend/instructions/updateGlobalConfig.ts +1 -2
  140. package/src/@codegen/klend/instructions/updateReserveConfig.ts +1 -2
  141. package/src/@codegen/klend/instructions/withdrawObligationCollateral.ts +1 -1
  142. package/src/@codegen/klend/instructions/withdrawObligationCollateralV2.ts +1 -1
  143. package/src/@codegen/klend/types/AssetTier.ts +119 -0
  144. package/src/@codegen/klend/types/ObligationLiquidity.ts +9 -39
  145. package/src/@codegen/klend/types/ObligationOrder.ts +4 -4
  146. package/src/@codegen/klend/types/ReserveConfig.ts +39 -171
  147. package/src/@codegen/klend/types/ReserveFees.ts +12 -12
  148. package/src/@codegen/klend/types/ReserveLiquidity.ts +12 -30
  149. package/src/@codegen/klend/types/UpdateConfigMode.ts +26 -206
  150. package/src/@codegen/klend/types/UpdateLendingMarketMode.ts +0 -300
  151. package/src/@codegen/klend/types/index.ts +16 -45
  152. package/src/@codegen/klend/zero_padding/ObligationZP.ts +13 -22
  153. package/src/classes/action.ts +8 -577
  154. package/src/classes/manager.ts +0 -11
  155. package/src/classes/market.ts +5 -36
  156. package/src/classes/obligation.ts +1 -1
  157. package/src/classes/reserve.ts +8 -13
  158. package/src/classes/unstakingPool.ts +6 -83
  159. package/src/classes/vault.ts +57 -38
  160. package/src/idl/klend.json +294 -2187
  161. package/src/lending_operations/index.ts +0 -1
  162. package/src/manager/client_kamino_manager.ts +9 -13
  163. package/src/utils/ata.ts +79 -0
  164. package/src/utils/managerTypes.ts +4 -9
  165. package/src/utils/seeds.ts +26 -28
  166. package/dist/@codegen/klend/accounts/PoolState.d.ts +0 -53
  167. package/dist/@codegen/klend/accounts/PoolState.d.ts.map +0 -1
  168. package/dist/@codegen/klend/accounts/PoolState.js +0 -167
  169. package/dist/@codegen/klend/accounts/PoolState.js.map +0 -1
  170. package/dist/@codegen/klend/accounts/UnstakeTicket.d.ts +0 -41
  171. package/dist/@codegen/klend/accounts/UnstakeTicket.d.ts.map +0 -1
  172. package/dist/@codegen/klend/accounts/UnstakeTicket.js +0 -143
  173. package/dist/@codegen/klend/accounts/UnstakeTicket.js.map +0 -1
  174. package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts +0 -132
  175. package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts.map +0 -1
  176. package/dist/@codegen/klend/accounts/WithdrawTicket.js +0 -191
  177. package/dist/@codegen/klend/accounts/WithdrawTicket.js.map +0 -1
  178. package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts +0 -39
  179. package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts.map +0 -1
  180. package/dist/@codegen/klend/instructions/enqueueToWithdraw.js +0 -67
  181. package/dist/@codegen/klend/instructions/enqueueToWithdraw.js.map +0 -1
  182. package/dist/@codegen/klend/instructions/fillBorrowOrder.d.ts +0 -36
  183. package/dist/@codegen/klend/instructions/fillBorrowOrder.d.ts.map +0 -1
  184. package/dist/@codegen/klend/instructions/fillBorrowOrder.js +0 -49
  185. package/dist/@codegen/klend/instructions/fillBorrowOrder.js.map +0 -1
  186. package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts +0 -47
  187. package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts.map +0 -1
  188. package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js +0 -66
  189. package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js.map +0 -1
  190. package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts +0 -31
  191. package/dist/@codegen/klend/instructions/setBorrowOrder.d.ts.map +0 -1
  192. package/dist/@codegen/klend/instructions/setBorrowOrder.js +0 -64
  193. package/dist/@codegen/klend/instructions/setBorrowOrder.js.map +0 -1
  194. package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.d.ts +0 -53
  195. package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.d.ts.map +0 -1
  196. package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.js +0 -190
  197. package/dist/@codegen/klend/instructions/unstakeLstCollateralEnd.js.map +0 -1
  198. package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.d.ts +0 -70
  199. package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.d.ts.map +0 -1
  200. package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.js +0 -261
  201. package/dist/@codegen/klend/instructions/unstakeLstCollateralStart.js.map +0 -1
  202. package/dist/@codegen/klend/instructions/withdrawObligationUsol.d.ts +0 -41
  203. package/dist/@codegen/klend/instructions/withdrawObligationUsol.d.ts.map +0 -1
  204. package/dist/@codegen/klend/instructions/withdrawObligationUsol.js +0 -135
  205. package/dist/@codegen/klend/instructions/withdrawObligationUsol.js.map +0 -1
  206. package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts +0 -51
  207. package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts.map +0 -1
  208. package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js +0 -28
  209. package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js.map +0 -1
  210. package/dist/@codegen/klend/types/BorrowOrder.d.ts +0 -192
  211. package/dist/@codegen/klend/types/BorrowOrder.d.ts.map +0 -1
  212. package/dist/@codegen/klend/types/BorrowOrder.js +0 -194
  213. package/dist/@codegen/klend/types/BorrowOrder.js.map +0 -1
  214. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts +0 -39
  215. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.d.ts.map +0 -1
  216. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js +0 -100
  217. package/dist/@codegen/klend/types/BorrowOrderConfigArgs.js.map +0 -1
  218. package/dist/@codegen/klend/types/WithdrawQueue.d.ts +0 -64
  219. package/dist/@codegen/klend/types/WithdrawQueue.d.ts.map +0 -1
  220. package/dist/@codegen/klend/types/WithdrawQueue.js +0 -104
  221. package/dist/@codegen/klend/types/WithdrawQueue.js.map +0 -1
  222. package/dist/lending_operations/unstake_lst_collateral.d.ts +0 -12
  223. package/dist/lending_operations/unstake_lst_collateral.d.ts.map +0 -1
  224. package/dist/lending_operations/unstake_lst_collateral.js +0 -104
  225. package/dist/lending_operations/unstake_lst_collateral.js.map +0 -1
  226. package/src/@codegen/klend/accounts/PoolState.ts +0 -192
  227. package/src/@codegen/klend/accounts/UnstakeTicket.ts +0 -160
  228. package/src/@codegen/klend/accounts/WithdrawTicket.ts +0 -256
  229. package/src/@codegen/klend/instructions/enqueueToWithdraw.ts +0 -89
  230. package/src/@codegen/klend/instructions/fillBorrowOrder.ts +0 -96
  231. package/src/@codegen/klend/instructions/recoverInvalidTicketCollateral.ts +0 -96
  232. package/src/@codegen/klend/instructions/setBorrowOrder.ts +0 -77
  233. package/src/@codegen/klend/instructions/unstakeLstCollateralEnd.ts +0 -251
  234. package/src/@codegen/klend/instructions/unstakeLstCollateralStart.ts +0 -353
  235. package/src/@codegen/klend/instructions/withdrawObligationUsol.ts +0 -168
  236. package/src/@codegen/klend/instructions/withdrawQueuedLiquidity.ts +0 -92
  237. package/src/@codegen/klend/types/BorrowOrder.ts +0 -267
  238. package/src/@codegen/klend/types/BorrowOrderConfigArgs.ts +0 -87
  239. package/src/@codegen/klend/types/WithdrawQueue.ts +0 -117
  240. package/src/lending_operations/unstake_lst_collateral.ts +0 -174
@@ -1,143 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.UnstakeTicket = void 0;
40
- /* eslint-disable @typescript-eslint/no-unused-vars */
41
- const kit_1 = require("@solana/kit");
42
- /* eslint-enable @typescript-eslint/no-unused-vars */
43
- const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
44
- const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
45
- const utils_1 = require("../utils"); // eslint-disable-line @typescript-eslint/no-unused-vars
46
- const programId_1 = require("../programId");
47
- class UnstakeTicket {
48
- authority;
49
- poolState;
50
- obligationMetadata;
51
- initialUsol;
52
- remainingUsol;
53
- minimumEpochToBurn;
54
- padding0;
55
- padding;
56
- static discriminator = Buffer.from([
57
- 131, 84, 209, 38, 145, 157, 181, 127,
58
- ]);
59
- static layout = borsh.struct([
60
- (0, utils_1.borshAddress)("authority"),
61
- (0, utils_1.borshAddress)("poolState"),
62
- (0, utils_1.borshAddress)("obligationMetadata"),
63
- borsh.u64("initialUsol"),
64
- borsh.u64("remainingUsol"),
65
- borsh.u64("minimumEpochToBurn"),
66
- borsh.array(borsh.u64(), 1, "padding0"),
67
- borsh.array(borsh.u128(), 16, "padding"),
68
- ]);
69
- constructor(fields) {
70
- this.authority = fields.authority;
71
- this.poolState = fields.poolState;
72
- this.obligationMetadata = fields.obligationMetadata;
73
- this.initialUsol = fields.initialUsol;
74
- this.remainingUsol = fields.remainingUsol;
75
- this.minimumEpochToBurn = fields.minimumEpochToBurn;
76
- this.padding0 = fields.padding0;
77
- this.padding = fields.padding;
78
- }
79
- static async fetch(rpc, address, programId = programId_1.PROGRAM_ID) {
80
- const info = await (0, kit_1.fetchEncodedAccount)(rpc, address);
81
- if (!info.exists) {
82
- return null;
83
- }
84
- if (info.programAddress !== programId) {
85
- throw new Error(`UnstakeTicketFields account ${address} belongs to wrong program ${info.programAddress}, expected ${programId}`);
86
- }
87
- return this.decode(Buffer.from(info.data));
88
- }
89
- static async fetchMultiple(rpc, addresses, programId = programId_1.PROGRAM_ID) {
90
- const infos = await (0, kit_1.fetchEncodedAccounts)(rpc, addresses);
91
- return infos.map((info) => {
92
- if (!info.exists) {
93
- return null;
94
- }
95
- if (info.programAddress !== programId) {
96
- throw new Error(`UnstakeTicketFields account ${info.address} belongs to wrong program ${info.programAddress}, expected ${programId}`);
97
- }
98
- return this.decode(Buffer.from(info.data));
99
- });
100
- }
101
- static decode(data) {
102
- if (!data.slice(0, 8).equals(UnstakeTicket.discriminator)) {
103
- throw new Error("invalid account discriminator");
104
- }
105
- const dec = UnstakeTicket.layout.decode(data.slice(8));
106
- return new UnstakeTicket({
107
- authority: dec.authority,
108
- poolState: dec.poolState,
109
- obligationMetadata: dec.obligationMetadata,
110
- initialUsol: dec.initialUsol,
111
- remainingUsol: dec.remainingUsol,
112
- minimumEpochToBurn: dec.minimumEpochToBurn,
113
- padding0: dec.padding0,
114
- padding: dec.padding,
115
- });
116
- }
117
- toJSON() {
118
- return {
119
- authority: this.authority,
120
- poolState: this.poolState,
121
- obligationMetadata: this.obligationMetadata,
122
- initialUsol: this.initialUsol.toString(),
123
- remainingUsol: this.remainingUsol.toString(),
124
- minimumEpochToBurn: this.minimumEpochToBurn.toString(),
125
- padding0: this.padding0.map((item) => item.toString()),
126
- padding: this.padding.map((item) => item.toString()),
127
- };
128
- }
129
- static fromJSON(obj) {
130
- return new UnstakeTicket({
131
- authority: (0, kit_1.address)(obj.authority),
132
- poolState: (0, kit_1.address)(obj.poolState),
133
- obligationMetadata: (0, kit_1.address)(obj.obligationMetadata),
134
- initialUsol: new bn_js_1.default(obj.initialUsol),
135
- remainingUsol: new bn_js_1.default(obj.remainingUsol),
136
- minimumEpochToBurn: new bn_js_1.default(obj.minimumEpochToBurn),
137
- padding0: obj.padding0.map((item) => new bn_js_1.default(item)),
138
- padding: obj.padding.map((item) => new bn_js_1.default(item)),
139
- });
140
- }
141
- }
142
- exports.UnstakeTicket = UnstakeTicket;
143
- //# sourceMappingURL=UnstakeTicket.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UnstakeTicket.js","sourceRoot":"","sources":["../../../../src/@codegen/klend/accounts/UnstakeTicket.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAsD;AACtD,qCAQoB;AACpB,qDAAqD;AACrD,kDAAsB,CAAC,wDAAwD;AAC/E,wDAAyC,CAAC,wDAAwD;AAClG,oCAAuC,CAAC,wD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AC;SACrD,CAAA;IACH,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAsB;QACpC,OAAO,IAAI,aAAa,CAAC;YACvB,SAAS,EAAE,IAAA,aAAO,EAAC,GAAG,CAAC,SAAS,CAAC;YACjC,SAAS,EAAE,IAAA,aAAO,EAAC,GAAG,CAAC,SAAS,CAAC;YACjC,kBAAkB,EAAE,IAAA,aAAO,EAAC,GAAG,CAAC,kBAAkB,CAAC;YACnD,WAAW,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,WAAW,CAAC;YACpC,aAAa,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,aAAa,CAAC;YACxC,kBAAkB,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC;YAClD,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,eAAE,CAAC,IAAI,CAAC,CAAC;YAClD,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,eAAE,CAAC,IAAI,CAAC,CAAC;SACjD,CAAC,CAAA;IACJ,CAAC;;AAvHH,sCAwHC"}
@@ -1,132 +0,0 @@
1
- import { Address, GetAccountInfoApi, GetMultipleAccountsApi, Rpc } from "@solana/kit";
2
- import BN from "bn.js";
3
- export interface WithdrawTicketFields {
4
- /** This ticket's place in the queue; the same as used for PDA derivation. */
5
- sequenceNumber: BN;
6
- /** The funds' owner (the user who called the `enqueue_to_withdraw` handler). */
7
- owner: Address;
8
- /** The reserve to withdraw from. */
9
- reserve: Address;
10
- /**
11
- * The token account to which the finally-available liquidity should be transferred (by the
12
- * `withdraw_queued_liquidity` handler).
13
- */
14
- userDestinationLiquidityTa: Address;
15
- /** The amount of collateral still waiting to be withdrawn using this ticket. */
16
- queuedCollateralAmount: BN;
17
- /**
18
- * The timestamp at which the queue was entered.
19
- *
20
- * This is currently only a piece of metadata, not used by the logic.
21
- */
22
- createdAtTimestamp: BN;
23
- /**
24
- * Whether the ticket has been found to be invalid (e.g. the [Self::user_destination_liquidity]
25
- * has been repurposed) by the `withdraw_queued_liquidity` handler.
26
- * To be specific: valid = `0`, invalid = `1`.
27
- *
28
- * An invalid ticket cannot be made valid again, and can only be passed to the
29
- * `recover_invalid_ticket_collateral` handler.
30
- */
31
- invalid: number;
32
- /** Inner padding, for alignment. */
33
- alignmentPadding: Array<number>;
34
- /** Trailing padding, for future developments. */
35
- endPadding: Array<BN>;
36
- }
37
- export interface WithdrawTicketJSON {
38
- /** This ticket's place in the queue; the same as used for PDA derivation. */
39
- sequenceNumber: string;
40
- /** The funds' owner (the user who called the `enqueue_to_withdraw` handler). */
41
- owner: string;
42
- /** The reserve to withdraw from. */
43
- reserve: string;
44
- /**
45
- * The token account to which the finally-available liquidity should be transferred (by the
46
- * `withdraw_queued_liquidity` handler).
47
- */
48
- userDestinationLiquidityTa: string;
49
- /** The amount of collateral still waiting to be withdrawn using this ticket. */
50
- queuedCollateralAmount: string;
51
- /**
52
- * The timestamp at which the queue was entered.
53
- *
54
- * This is currently only a piece of metadata, not used by the logic.
55
- */
56
- createdAtTimestamp: string;
57
- /**
58
- * Whether the ticket has been found to be invalid (e.g. the [Self::user_destination_liquidity]
59
- * has been repurposed) by the `withdraw_queued_liquidity` handler.
60
- * To be specific: valid = `0`, invalid = `1`.
61
- *
62
- * An invalid ticket cannot be made valid again, and can only be passed to the
63
- * `recover_invalid_ticket_collateral` handler.
64
- */
65
- invalid: number;
66
- /** Inner padding, for alignment. */
67
- alignmentPadding: Array<number>;
68
- /** Trailing padding, for future developments. */
69
- endPadding: Array<string>;
70
- }
71
- /**
72
- * A finite-lifecycle account representing a specific depositor's place in the withdraw queue of
73
- * a specific reserve.
74
- *
75
- * The lifecycle:
76
- * 1. The depositor holding ctokens wants to withdraw funds from the reserve, and finds out that
77
- * the required amount is not available (due to high utilization).
78
- * 2. The depositor calls the `enqueue_to_withdraw` handler.
79
- * 3. The handler transfers the depositor's ctokens to the reserve's internal "pending" vault.
80
- * 4. The handler initializes a new [WithdrawTicket] account, with the next available sequence
81
- * number.
82
- * 5. The depositor waits until his ticket is the next expected one for actual withdraw, and until
83
- * the reserve has enough liquidity.
84
- * 6. Anyone (the depositor or a bot) calls the permissionless `withdraw_queued_liquidity`
85
- * handler. If the ticket became invalid (e.g. destination account no longer exists), then the
86
- * depositor can call the `recover_invalid_ticket_collateral` handler instead.
87
- * 7. The handler transfers the liquidity amount according to the current exchange rate.
88
- * 8. The handler closes the ticket account.
89
- */
90
- export declare class WithdrawTicket {
91
- /** This ticket's place in the queue; the same as used for PDA derivation. */
92
- readonly sequenceNumber: BN;
93
- /** The funds' owner (the user who called the `enqueue_to_withdraw` handler). */
94
- readonly owner: Address;
95
- /** The reserve to withdraw from. */
96
- readonly reserve: Address;
97
- /**
98
- * The token account to which the finally-available liquidity should be transferred (by the
99
- * `withdraw_queued_liquidity` handler).
100
- */
101
- readonly userDestinationLiquidityTa: Address;
102
- /** The amount of collateral still waiting to be withdrawn using this ticket. */
103
- readonly queuedCollateralAmount: BN;
104
- /**
105
- * The timestamp at which the queue was entered.
106
- *
107
- * This is currently only a piece of metadata, not used by the logic.
108
- */
109
- readonly createdAtTimestamp: BN;
110
- /**
111
- * Whether the ticket has been found to be invalid (e.g. the [Self::user_destination_liquidity]
112
- * has been repurposed) by the `withdraw_queued_liquidity` handler.
113
- * To be specific: valid = `0`, invalid = `1`.
114
- *
115
- * An invalid ticket cannot be made valid again, and can only be passed to the
116
- * `recover_invalid_ticket_collateral` handler.
117
- */
118
- readonly invalid: number;
119
- /** Inner padding, for alignment. */
120
- readonly alignmentPadding: Array<number>;
121
- /** Trailing padding, for future developments. */
122
- readonly endPadding: Array<BN>;
123
- static readonly discriminator: Buffer<ArrayBuffer>;
124
- static readonly layout: import("buffer-layout").Layout<WithdrawTicket>;
125
- constructor(fields: WithdrawTicketFields);
126
- static fetch(rpc: Rpc<GetAccountInfoApi>, address: Address, programId?: Address): Promise<WithdrawTicket | null>;
127
- static fetchMultiple(rpc: Rpc<GetMultipleAccountsApi>, addresses: Address[], programId?: Address): Promise<Array<WithdrawTicket | null>>;
128
- static decode(data: Buffer): WithdrawTicket;
129
- toJSON(): WithdrawTicketJSON;
130
- static fromJSON(obj: WithdrawTicketJSON): WithdrawTicket;
131
- }
132
- //# sourceMappingURL=WithdrawTicket.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WithdrawTicket.d.ts","sourceRoot":"","sources":["../../../../src/@codegen/klend/accounts/WithdrawTicket.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,OAAO,EAGP,iBAAiB,EACjB,sBAAsB,EACtB,GAAG,EACJ,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,MAAM,OAAO,CAAA;AAMtB,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,cAAc,EAAE,EAAE,CAAA;IAClB,gFAAgF;IAChF,KAAK,EAAE,OAAO,CAAA;IACd,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,0BAA0B,EAAE,OAAO,CAAA;IACnC,gFAAgF;IAChF,sBAAsB,EAAE,EAAE,CAAA;IAC1B;;;;OAIG;IACH,kBAAkB,EAAE,EAAE,CAAA;IACtB;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/B,iDAAiD;IACjD,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,cAAc,EAAE,MAAM,CAAA;IACtB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,0BAA0B,EAAE,MAAM,CAAA;IAClC,gFAAgF;IAChF,sBAAsB,EAAE,MAAM,CAAA;I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AAoB,GAC9B,OAAO,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAiBxC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc;IAoB3C,MAAM,IAAI,kBAAkB;IAc5B,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,kBAAkB,GAAG,cAAc;CAazD"}
@@ -1,191 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.WithdrawTicket = void 0;
40
- /* eslint-disable @typescript-eslint/no-unused-vars */
41
- const kit_1 = require("@solana/kit");
42
- /* eslint-enable @typescript-eslint/no-unused-vars */
43
- const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
44
- const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
45
- const utils_1 = require("../utils"); // eslint-disable-line @typescript-eslint/no-unused-vars
46
- const programId_1 = require("../programId");
47
- /**
48
- * A finite-lifecycle account representing a specific depositor's place in the withdraw queue of
49
- * a specific reserve.
50
- *
51
- * The lifecycle:
52
- * 1. The depositor holding ctokens wants to withdraw funds from the reserve, and finds out that
53
- * the required amount is not available (due to high utilization).
54
- * 2. The depositor calls the `enqueue_to_withdraw` handler.
55
- * 3. The handler transfers the depositor's ctokens to the reserve's internal "pending" vault.
56
- * 4. The handler initializes a new [WithdrawTicket] account, with the next available sequence
57
- * number.
58
- * 5. The depositor waits until his ticket is the next expected one for actual withdraw, and until
59
- * the reserve has enough liquidity.
60
- * 6. Anyone (the depositor or a bot) calls the permissionless `withdraw_queued_liquidity`
61
- * handler. If the ticket became invalid (e.g. destination account no longer exists), then the
62
- * depositor can call the `recover_invalid_ticket_collateral` handler instead.
63
- * 7. The handler transfers the liquidity amount according to the current exchange rate.
64
- * 8. The handler closes the ticket account.
65
- */
66
- class WithdrawTicket {
67
- /** This ticket's place in the queue; the same as used for PDA derivation. */
68
- sequenceNumber;
69
- /** The funds' owner (the user who called the `enqueue_to_withdraw` handler). */
70
- owner;
71
- /** The reserve to withdraw from. */
72
- reserve;
73
- /**
74
- * The token account to which the finally-available liquidity should be transferred (by the
75
- * `withdraw_queued_liquidity` handler).
76
- */
77
- userDestinationLiquidityTa;
78
- /** The amount of collateral still waiting to be withdrawn using this ticket. */
79
- queuedCollateralAmount;
80
- /**
81
- * The timestamp at which the queue was entered.
82
- *
83
- * This is currently only a piece of metadata, not used by the logic.
84
- */
85
- createdAtTimestamp;
86
- /**
87
- * Whether the ticket has been found to be invalid (e.g. the [Self::user_destination_liquidity]
88
- * has been repurposed) by the `withdraw_queued_liquidity` handler.
89
- * To be specific: valid = `0`, invalid = `1`.
90
- *
91
- * An invalid ticket cannot be made valid again, and can only be passed to the
92
- * `recover_invalid_ticket_collateral` handler.
93
- */
94
- invalid;
95
- /** Inner padding, for alignment. */
96
- alignmentPadding;
97
- /** Trailing padding, for future developments. */
98
- endPadding;
99
- static discriminator = Buffer.from([
100
- 237, 23, 164, 58, 53, 248, 240, 94,
101
- ]);
102
- static layout = borsh.struct([
103
- borsh.u64("sequenceNumber"),
104
- (0, utils_1.borshAddress)("owner"),
105
- (0, utils_1.borshAddress)("reserve"),
106
- (0, utils_1.borshAddress)("userDestinationLiquidityTa"),
107
- borsh.u64("queuedCollateralAmount"),
108
- borsh.u64("createdAtTimestamp"),
109
- borsh.u8("invalid"),
110
- borsh.array(borsh.u8(), 7, "alignmentPadding"),
111
- borsh.array(borsh.u64(), 48, "endPadding"),
112
- ]);
113
- constructor(fields) {
114
- this.sequenceNumber = fields.sequenceNumber;
115
- this.owner = fields.owner;
116
- this.reserve = fields.reserve;
117
- this.userDestinationLiquidityTa = fields.userDestinationLiquidityTa;
118
- this.queuedCollateralAmount = fields.queuedCollateralAmount;
119
- this.createdAtTimestamp = fields.createdAtTimestamp;
120
- this.invalid = fields.invalid;
121
- this.alignmentPadding = fields.alignmentPadding;
122
- this.endPadding = fields.endPadding;
123
- }
124
- static async fetch(rpc, address, programId = programId_1.PROGRAM_ID) {
125
- const info = await (0, kit_1.fetchEncodedAccount)(rpc, address);
126
- if (!info.exists) {
127
- return null;
128
- }
129
- if (info.programAddress !== programId) {
130
- throw new Error(`WithdrawTicketFields account ${address} belongs to wrong program ${info.programAddress}, expected ${programId}`);
131
- }
132
- return this.decode(Buffer.from(info.data));
133
- }
134
- static async fetchMultiple(rpc, addresses, programId = programId_1.PROGRAM_ID) {
135
- const infos = await (0, kit_1.fetchEncodedAccounts)(rpc, addresses);
136
- return infos.map((info) => {
137
- if (!info.exists) {
138
- return null;
139
- }
140
- if (info.programAddress !== programId) {
141
- throw new Error(`WithdrawTicketFields account ${info.address} belongs to wrong program ${info.programAddress}, expected ${programId}`);
142
- }
143
- return this.decode(Buffer.from(info.data));
144
- });
145
- }
146
- static decode(data) {
147
- if (!data.slice(0, 8).equals(WithdrawTicket.discriminator)) {
148
- throw new Error("invalid account discriminator");
149
- }
150
- const dec = WithdrawTicket.layout.decode(data.slice(8));
151
- return new WithdrawTicket({
152
- sequenceNumber: dec.sequenceNumber,
153
- owner: dec.owner,
154
- reserve: dec.reserve,
155
- userDestinationLiquidityTa: dec.userDestinationLiquidityTa,
156
- queuedCollateralAmount: dec.queuedCollateralAmount,
157
- createdAtTimestamp: dec.createdAtTimestamp,
158
- invalid: dec.invalid,
159
- alignmentPadding: dec.alignmentPadding,
160
- endPadding: dec.endPadding,
161
- });
162
- }
163
- toJSON() {
164
- return {
165
- sequenceNumber: this.sequenceNumber.toString(),
166
- owner: this.owner,
167
- reserve: this.reserve,
168
- userDestinationLiquidityTa: this.userDestinationLiquidityTa,
169
- queuedCollateralAmount: this.queuedCollateralAmount.toString(),
170
- createdAtTimestamp: this.createdAtTimestamp.toString(),
171
- invalid: this.invalid,
172
- alignmentPadding: this.alignmentPadding,
173
- endPadding: this.endPadding.map((item) => item.toString()),
174
- };
175
- }
176
- static fromJSON(obj) {
177
- return new WithdrawTicket({
178
- sequenceNumber: new bn_js_1.default(obj.sequenceNumber),
179
- owner: (0, kit_1.address)(obj.owner),
180
- reserve: (0, kit_1.address)(obj.reserve),
181
- userDestinationLiquidityTa: (0, kit_1.address)(obj.userDestinationLiquidityTa),
182
- queuedCollateralAmount: new bn_js_1.default(obj.queuedCollateralAmount),
183
- createdAtTimestamp: new bn_js_1.default(obj.createdAtTimestamp),
184
- invalid: obj.invalid,
185
- alignmentPadding: obj.alignmentPadding,
186
- endPadding: obj.endPadding.map((item) => new bn_js_1.default(item)),
187
- });
188
- }
189
- }
190
- exports.WithdrawTicket = WithdrawTicket;
191
- //# sourceMappingURL=WithdrawTicket.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WithdrawTicket.js","sourceRoot":"","sources":["../../../../src/@codegen/klend/accounts/WithdrawTicket.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAsD;AACtD,qCAQoB;AACpB,qDAAqD;AACrD,kDAAsB,CAAC,wDAAwD;AAC/E,wDAAyC,CAAC,wDAAwD;AAClG,oCAAuC,CAAC,wDAAwD;AAEhG,4CAAyC;AAwEzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,cAAc;IACzB,6EAA6E;IACpE,cAAc,CAAI;IAC3B,gFAAgF;IACvE,KAAK,CAAS;IACvB,oCAAoC;IAC3B,OAAO,CAAS;IACzB;;;OAGG;IACM,0BAA0B,CAAS;IAC5C,gFAAgF;IACvE,sBAAsB,CAAI;IACnC;;;;OAIG;IACM,kBAAkB,CAAI;IAC/B;;;;;;;OAOG;IACM,OAAO,CAAQ;IACxB,oCAAoC;IAC3B,gBAAgB,CAAe;IACxC,iDAAiD;IACxC,UAAU,CAAW;IAE9B,MAAM,CAAU,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC;QAC1C,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;KACnC,CAAC,CAAA;IAEF,MAAM,CAAU,MAAM,GAAG,KAAK,CAAC,MAAM,CAAiB;QACpD,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC;QAC3B,IAAA,oBAAY,EAAC,OAAO,CAAC;QACrB,IAAA,oBAAY,EAAC,SAAS,CAAC;QACvB,IAAA,oBAAY,EAAC,4BAA4B,CAAC;QAC1C,KAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC;QACnC,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC;QAC/B,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC;QACnB,KAAK,CAAC,KAAK,CAAC,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I,EAAE,EAAE,CAAC,IAAI,eAAE,CAAC,IAAI,CAAC,CAAC;SACvD,CAAC,CAAA;IACJ,CAAC;;AApJH,wCAqJC"}
@@ -1,39 +0,0 @@
1
- import { Address, AccountMeta, AccountSignerMeta, Instruction, TransactionSigner } from "@solana/kit";
2
- import BN from "bn.js";
3
- export declare const DISCRIMINATOR: Buffer<ArrayBuffer>;
4
- export interface EnqueueToWithdrawArgs {
5
- collateralAmount: BN;
6
- }
7
- export interface EnqueueToWithdrawAccounts {
8
- /** The depositor holding ctokens. */
9
- owner: TransactionSigner;
10
- lendingMarket: Address;
11
- /** The market's authority, needed to initialize the [Self::owner_queued_collateral_vault]. */
12
- lendingMarketAuthority: Address;
13
- reserve: Address;
14
- /** The source of collateral to be enqueued. */
15
- userSourceCollateralTa: Address;
16
- /**
17
- * The account to which the liquidity should be finally transferred later (to be recorded in
18
- * the ticket).
19
- */
20
- userDestinationLiquidityTa: Address;
21
- reserveCollateralMint: Address;
22
- /**
23
- * The collateral's program - needed for invoking the transfer to the vault *and* (implicitly)
24
- * for handling the `init_if_needed`.
25
- */
26
- collateralTokenProgram: Address;
27
- /** The new account to be initialized with the issued ticket's data. */
28
- withdrawTicket: Address;
29
- /**
30
- * The per-owner "this reserve's queued collateral" vault (in which the collateral will be
31
- * locked).
32
- */
33
- ownerQueuedCollateralVault: Address;
34
- /** The System program - needed only for `init` / `init_if_needed` of the accounts above. */
35
- systemProgram: Address;
36
- }
37
- export declare const layout: import("buffer-layout").Layout<EnqueueToWithdrawArgs>;
38
- export declare function enqueueToWithdraw(args: EnqueueToWithdrawArgs, accounts: EnqueueToWithdrawAccounts, remainingAccounts?: Array<AccountMeta | AccountSignerMeta>, programAddress?: Address): Instruction<string, readonly (AccountMeta<string> | import("@solana/kit").AccountLookupMeta<string, string>)[]>;
39
- //# sourceMappingURL=enqueueToWithdraw.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enqueueToWithdraw.d.ts","sourceRoot":"","sources":["../../../../src/@codegen/klend/instructions/enqueueToWithdraw.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EAEP,WAAW,EACX,iBAAiB,EACjB,WAAW,EAEX,iBAAiB,EAClB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,MAAM,OAAO,CAAA;AAMtB,eAAO,MAAM,aAAa,qBAAsD,CAAA;AAEhF,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,EAAE,EAAE,CAAA;CACrB;AAED,MAAM,WAAW,yBAAyB;IACxC,qCAAqC;IACrC,KAAK,EAAE,iBAAiB,CAAA;IACxB,aAAa,EAAE,OAAO,CAAA;IACtB,8FAA8F;IAC9F,sBAAsB,EAAE,OAAO,CAAA;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,+CAA+C;IAC/C,sBAAsB,EAAE,OAAO,CAAA;IAC/B;;;OAGG;IACH,0BAA0B,EAAE,OAAO,CAAA;IACnC,qBAAqB,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,sBAAsB,EAAE,OAAO,CAAA;IAC/B,uEAAuE;IACvE,cAAc,EAAE,OAAO,CAAA;IACvB;;;OAGG;IACH,0BAA0B,EAAE,OAAO,CAAA;IACnC,4FAA4F;IAC5F,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,eAAO,MAAM,MAAM,uDAEjB,CAAA;AAEF,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,qBAAqB,EAC3B,QAAQ,EAAE,yBAAyB,EACnC,iBAAiB,GAAE,KAAK,CAAC,WAAW,GAAG,iBAAiB,CAAM,EAC9D,cAAc,GAAE,OAAoB,mHA0BrC"}
@@ -1,67 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.layout = exports.DISCRIMINATOR = void 0;
37
- exports.enqueueToWithdraw = enqueueToWithdraw;
38
- const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
39
- const programId_1 = require("../programId");
40
- exports.DISCRIMINATOR = Buffer.from([134, 113, 160, 207, 90, 75, 213, 219]);
41
- exports.layout = borsh.struct([
42
- borsh.u64("collateralAmount"),
43
- ]);
44
- function enqueueToWithdraw(args, accounts, remainingAccounts = [], programAddress = programId_1.PROGRAM_ID) {
45
- const keys = [
46
- { address: accounts.owner.address, role: 3, signer: accounts.owner },
47
- { address: accounts.lendingMarket, role: 0 },
48
- { address: accounts.lendingMarketAuthority, role: 0 },
49
- { address: accounts.reserve, role: 1 },
50
- { address: accounts.userSourceCollateralTa, role: 1 },
51
- { address: accounts.userDestinationLiquidityTa, role: 0 },
52
- { address: accounts.reserveCollateralMint, role: 0 },
53
- { address: accounts.collateralTokenProgram, role: 0 },
54
- { address: accounts.withdrawTicket, role: 1 },
55
- { address: accounts.ownerQueuedCollateralVault, role: 1 },
56
- { address: accounts.systemProgram, role: 0 },
57
- ...remainingAccounts,
58
- ];
59
- const buffer = Buffer.alloc(1000);
60
- const len = exports.layout.encode({
61
- collateralAmount: args.collateralAmount,
62
- }, buffer);
63
- const data = Buffer.concat([exports.DISCRIMINATOR, buffer]).slice(0, 8 + len);
64
- const ix = { accounts: keys, programAddress, data };
65
- return ix;
66
- }
67
- //# sourceMappingURL=enqueueToWithdraw.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enqueueToWithdraw.js","sourceRoot":"","sources":["../../../../src/@codegen/klend/instructions/enqueueToWithdraw.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,8CA8BC;AA5ED,wDAAyC,CAAC,wDAAwD;AAGlG,4CAAyC;AAE5B,QAAA,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAqCnE,QAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAwB;IACxD,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC;CAC9B,CAAC,CAAA;AAEF,SAAgB,iBAAiB,CAC/B,IAA2B,EAC3B,QAAmC,EACnC,oBAA4D,EAAE,EAC9D,iBAA0B,sBAAU;IAEpC,MAAM,IAAI,GAA2C;QACnD,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE;QACpE,EAAE,OAAO,EAAE,QAAQ,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE;QAC5C,EAAE,OAAO,EAAE,QAAQ,CAAC,sBAAsB,EAAE,IAAI,EAAE,CAAC,EAAE;QACrD,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE;QACtC,EAAE,OAAO,EAAE,QAAQ,CAAC,sBAAsB,EAAE,IAAI,EAAE,CAAC,EAAE;QACrD,EAAE,OAAO,EAAE,QAAQ,CAAC,0BAA0B,EAAE,IAAI,EAAE,CAAC,EAAE;QACzD,EAAE,OAAO,EAAE,QAAQ,CAAC,qBAAqB,EAAE,IAAI,EAAE,CAAC,EAAE;QACpD,EAAE,OAAO,EAAE,QAAQ,CAAC,sBAAsB,EAAE,IAAI,EAAE,CAAC,EAAE;QACrD,EAAE,OAAO,EAAE,QAAQ,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,EAAE;QAC7C,EAAE,OAAO,EAAE,QAAQ,CAAC,0BAA0B,EAAE,IAAI,EAAE,CAAC,EAAE;QACzD,EAAE,OAAO,EAAE,QAAQ,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE;QAC5C,GAAG,iBAAiB;KACrB,CAAA;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,GAAG,GAAG,cAAM,CAAC,MAAM,CACvB;QACE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;KACxC,EACD,MAAM,CACP,CAAA;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,qBAAa,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IACrE,MAAM,EAAE,GAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC"}
@@ -1,36 +0,0 @@
1
- import { Address, AccountMeta, AccountSignerMeta, Instruction, Option, TransactionSigner } from "@solana/kit";
2
- export declare const DISCRIMINATOR: Buffer<ArrayBuffer>;
3
- export interface FillBorrowOrderAccounts {
4
- borrowAccounts: {
5
- payer: TransactionSigner;
6
- /** The obligation with a [BorrowOrder]. */
7
- obligation: Address;
8
- /** The [Self::obligation]'s market - needed for borrowing-related configuration. */
9
- lendingMarket: Address;
10
- /** The [Self::lending_market]'s authority, needed to transfer the newly-borrowed funds out of the [Self::reserve_source_liquidity]. */
11
- lendingMarketAuthority: Address;
12
- /** The reserve to borrow from. Its mint must match the asset requested by the [BorrowOrder::debt_liquidity_mint]. */
13
- borrowReserve: Address;
14
- /** The mint of [Self::borrow_reserve] - needed to execute the transfer. */
15
- borrowReserveLiquidityMint: Address;
16
- /** The vault of [Self::borrow_reserve], from which the funds are transferred. */
17
- reserveSourceLiquidity: Address;
18
- /** The fee vault of [Self::borrow_reserve], to which the fees are transferred. */
19
- borrowReserveLiquidityFeeReceiver: Address;
20
- /** The destination token account that should receive the newly borrowed funds. It must match [BorrowOrder::filled_debt_destination], owner and mint. **Warning:** An altered destination account will prevent an order from being filled. */
21
- userDestinationLiquidity: Address;
22
- /** The referrer's account, for accumulating fees - needed if the [Obligation::has_referrer]. */
23
- referrerTokenState: Option<Address>;
24
- /** The token program of [Self::borrow_reserve] - needed to execute the transfer. */
25
- tokenProgram: Address;
26
- };
27
- farmsAccounts: {
28
- obligationFarmUserState: Option<Address>;
29
- reserveFarmState: Option<Address>;
30
- };
31
- farmsProgram: Address;
32
- eventAuthority: Address;
33
- program: Address;
34
- }
35
- export declare function fillBorrowOrder(accounts: FillBorrowOrderAccounts, remainingAccounts?: Array<AccountMeta | AccountSignerMeta>, programAddress?: Address): Instruction<string, readonly (AccountMeta<string> | import("@solana/kit").AccountLookupMeta<string, string>)[]>;
36
- //# sourceMappingURL=fillBorrowOrder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fillBorrowOrder.d.ts","sourceRoot":"","sources":["../../../../src/@codegen/klend/instructions/fillBorrowOrder.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EAEP,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,MAAM,EACN,iBAAiB,EAClB,MAAM,aAAa,CAAA;AAQpB,eAAO,MAAM,aAAa,qBAAmD,CAAA;AAE7E,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE;QACd,KAAK,EAAE,iBAAiB,CAAA;QACxB,2CAA2C;QAC3C,UAAU,EAAE,OAAO,CAAA;QACnB,oFAAoF;QACpF,aAAa,EAAE,OAAO,CAAA;QACtB,uIAAuI;QACvI,sBAAsB,EAAE,OAAO,CAAA;QAC/B,sHAAsH;QACtH,aAAa,EAAE,OAAO,CAAA;QACtB,2EAA2E;QAC3E,0BAA0B,EAAE,OAAO,CAAA;QACnC,iFAAiF;QACjF,sBAAsB,EAAE,OAAO,CAAA;QAC/B,kFAAkF;QAClF,iCAAiC,EAAE,OAAO,CAAA;QAC1C,+OAA+O;QAC/O,wBAAwB,EAAE,OAAO,CAAA;QACjC,gGAAgG;QAChG,kBAAkB,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;QACnC,oFAAoF;QACpF,YAAY,EAAE,OAAO,CAAA;KACtB,CAAA;IACD,aAAa,EAAE;QACb,uBAAuB,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;QACxC,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;KAClC,CAAA;IACD,YAAY,EAAE,OAAO,CAAA;IACrB,cAAc,EAAE,OAAO,CAAA;IACvB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,uBAAuB,EACjC,iBAAiB,GAAE,KAAK,CAAC,WAAW,GAAG,iBAAiB,CAAM,EAC9D,cAAc,GAAE,OAAoB,mHAwCrC"}