@kamino-finance/klend-sdk 5.2.11 → 5.2.13

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 (120) hide show
  1. package/dist/classes/manager.d.ts +38 -9
  2. package/dist/classes/manager.d.ts.map +1 -1
  3. package/dist/classes/manager.js +44 -10
  4. package/dist/classes/manager.js.map +1 -1
  5. package/dist/classes/types.d.ts +23 -0
  6. package/dist/classes/types.d.ts.map +1 -0
  7. package/dist/classes/types.js +3 -0
  8. package/dist/classes/types.js.map +1 -0
  9. package/dist/classes/utils.js +2 -2
  10. package/dist/classes/utils.js.map +1 -1
  11. package/dist/classes/vault.d.ts +47 -11
  12. package/dist/classes/vault.d.ts.map +1 -1
  13. package/dist/classes/vault.js +367 -49
  14. package/dist/classes/vault.js.map +1 -1
  15. package/dist/client_kamino_manager.d.ts.map +1 -1
  16. package/dist/client_kamino_manager.js +62 -12
  17. package/dist/client_kamino_manager.js.map +1 -1
  18. package/dist/idl_codegen_kamino_vault/accounts/Reserve.js +1 -1
  19. package/dist/idl_codegen_kamino_vault/accounts/VaultState.d.ts +18 -9
  20. package/dist/idl_codegen_kamino_vault/accounts/VaultState.d.ts.map +1 -1
  21. package/dist/idl_codegen_kamino_vault/accounts/VaultState.js +62 -42
  22. package/dist/idl_codegen_kamino_vault/accounts/VaultState.js.map +1 -1
  23. package/dist/idl_codegen_kamino_vault/errors/custom.d.ts +112 -80
  24. package/dist/idl_codegen_kamino_vault/errors/custom.d.ts.map +1 -1
  25. package/dist/idl_codegen_kamino_vault/errors/custom.js +214 -158
  26. package/dist/idl_codegen_kamino_vault/errors/custom.js.map +1 -1
  27. package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts +1 -1
  28. package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts.map +1 -1
  29. package/dist/idl_codegen_kamino_vault/instructions/deposit.js +1 -1
  30. package/dist/idl_codegen_kamino_vault/instructions/deposit.js.map +1 -1
  31. package/dist/idl_codegen_kamino_vault/instructions/index.d.ts +6 -0
  32. package/dist/idl_codegen_kamino_vault/instructions/index.d.ts.map +1 -1
  33. package/dist/idl_codegen_kamino_vault/instructions/index.js +7 -1
  34. package/dist/idl_codegen_kamino_vault/instructions/index.js.map +1 -1
  35. package/dist/idl_codegen_kamino_vault/instructions/initVault.d.ts +2 -2
  36. package/dist/idl_codegen_kamino_vault/instructions/initVault.d.ts.map +1 -1
  37. package/dist/idl_codegen_kamino_vault/instructions/initVault.js +2 -2
  38. package/dist/idl_codegen_kamino_vault/instructions/initVault.js.map +1 -1
  39. package/dist/idl_codegen_kamino_vault/instructions/initializeSharesMetadata.d.ts +19 -0
  40. package/dist/idl_codegen_kamino_vault/instructions/initializeSharesMetadata.d.ts.map +1 -0
  41. package/dist/idl_codegen_kamino_vault/instructions/initializeSharesMetadata.js +58 -0
  42. package/dist/idl_codegen_kamino_vault/instructions/initializeSharesMetadata.js.map +1 -0
  43. package/dist/idl_codegen_kamino_vault/instructions/invest.d.ts +3 -4
  44. package/dist/idl_codegen_kamino_vault/instructions/invest.d.ts.map +1 -1
  45. package/dist/idl_codegen_kamino_vault/instructions/invest.js +2 -3
  46. package/dist/idl_codegen_kamino_vault/instructions/invest.js.map +1 -1
  47. package/dist/idl_codegen_kamino_vault/instructions/updateSharesMetadata.d.ts +16 -0
  48. package/dist/idl_codegen_kamino_vault/instructions/updateSharesMetadata.d.ts.map +1 -0
  49. package/dist/idl_codegen_kamino_vault/instructions/updateSharesMetadata.js +55 -0
  50. package/dist/idl_codegen_kamino_vault/instructions/updateSharesMetadata.js.map +1 -0
  51. package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.js +1 -1
  52. package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.js.map +1 -1
  53. package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts +24 -20
  54. package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts.map +1 -1
  55. package/dist/idl_codegen_kamino_vault/instructions/withdraw.js +81 -20
  56. package/dist/idl_codegen_kamino_vault/instructions/withdraw.js.map +1 -1
  57. package/dist/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.d.ts +21 -0
  58. package/dist/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.d.ts.map +1 -0
  59. package/dist/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.js +55 -0
  60. package/dist/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.js.map +1 -0
  61. package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.d.ts +2 -3
  62. package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.d.ts.map +1 -1
  63. package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.js +3 -4
  64. package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.js.map +1 -1
  65. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts +78 -20
  66. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts.map +1 -1
  67. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js +45 -14
  68. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js.map +1 -1
  69. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.d.ts +16 -16
  70. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.d.ts.map +1 -1
  71. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.js +16 -16
  72. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.js.map +1 -1
  73. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.d.ts +5 -5
  74. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.js +7 -7
  75. package/dist/idl_codegen_kamino_vault/types/VaultConfigField.d.ts +46 -7
  76. package/dist/idl_codegen_kamino_vault/types/VaultConfigField.d.ts.map +1 -1
  77. package/dist/idl_codegen_kamino_vault/types/VaultConfigField.js +84 -12
  78. package/dist/idl_codegen_kamino_vault/types/VaultConfigField.js.map +1 -1
  79. package/dist/idl_codegen_kamino_vault/types/index.d.ts +2 -2
  80. package/dist/idl_codegen_kamino_vault/types/index.d.ts.map +1 -1
  81. package/dist/idl_codegen_kamino_vault/types/index.js.map +1 -1
  82. package/dist/lending_operations/repay_with_collateral_calcs.d.ts.map +1 -1
  83. package/dist/lending_operations/repay_with_collateral_calcs.js +10 -1
  84. package/dist/lending_operations/repay_with_collateral_calcs.js.map +1 -1
  85. package/dist/lending_operations/repay_with_collateral_operations.d.ts.map +1 -1
  86. package/dist/lending_operations/repay_with_collateral_operations.js +7 -6
  87. package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
  88. package/dist/leverage/operations.d.ts.map +1 -1
  89. package/dist/leverage/operations.js +12 -8
  90. package/dist/leverage/operations.js.map +1 -1
  91. package/dist/leverage/types.d.ts +1 -0
  92. package/dist/leverage/types.d.ts.map +1 -1
  93. package/package.json +1 -1
  94. package/src/classes/manager.ts +60 -13
  95. package/src/classes/types.ts +28 -0
  96. package/src/classes/utils.ts +2 -2
  97. package/src/classes/vault.ts +527 -54
  98. package/src/client_kamino_manager.ts +119 -15
  99. package/src/idl_codegen_kamino_vault/accounts/Reserve.ts +1 -1
  100. package/src/idl_codegen_kamino_vault/accounts/VaultState.ts +215 -178
  101. package/src/idl_codegen_kamino_vault/errors/custom.ts +213 -157
  102. package/src/idl_codegen_kamino_vault/instructions/deposit.ts +2 -2
  103. package/src/idl_codegen_kamino_vault/instructions/index.ts +15 -0
  104. package/src/idl_codegen_kamino_vault/instructions/initVault.ts +4 -4
  105. package/src/idl_codegen_kamino_vault/instructions/initializeSharesMetadata.ts +58 -0
  106. package/src/idl_codegen_kamino_vault/instructions/invest.ts +5 -7
  107. package/src/idl_codegen_kamino_vault/instructions/updateSharesMetadata.ts +52 -0
  108. package/src/idl_codegen_kamino_vault/instructions/updateVaultConfig.ts +1 -1
  109. package/src/idl_codegen_kamino_vault/instructions/withdraw.ts +106 -40
  110. package/src/idl_codegen_kamino_vault/instructions/withdrawFromAvailable.ts +56 -0
  111. package/src/idl_codegen_kamino_vault/instructions/withdrawPendingFees.ts +5 -7
  112. package/src/idl_codegen_kamino_vault/types/ReserveConfig.ts +100 -28
  113. package/src/idl_codegen_kamino_vault/types/ReserveLiquidity.ts +25 -24
  114. package/src/idl_codegen_kamino_vault/types/VaultAllocation.ts +9 -9
  115. package/src/idl_codegen_kamino_vault/types/VaultConfigField.ts +103 -13
  116. package/src/idl_codegen_kamino_vault/types/index.ts +8 -2
  117. package/src/lending_operations/repay_with_collateral_calcs.ts +18 -1
  118. package/src/lending_operations/repay_with_collateral_operations.ts +9 -7
  119. package/src/leverage/operations.ts +69 -29
  120. package/src/leverage/types.ts +1 -0
@@ -1,541 +1,597 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AUMBelowPendingFees = exports.AUMDecreasedAfterInvest = exports.SharesMintedAmountDoesNotMatch = exports.DisinvestedLiquidityAmountDoesNotMatch = exports.SharesBurnedAmountDoesNotMatch = exports.UserReceivedAmountDoesNotMatch = exports.LiquidityToWithdrawDoesNotMatch = exports.AmountToWithdrawDoesNotMatch = exports.TokensDepositedAmountDoesNotMatch = exports.CannotWithdrawFromEmptyVault = exports.ReserveSpaceExhausted = exports.DepositAmountBelowMinimum = exports.BPSValueTooBig = exports.NotEnoughLiquidityDisinvestedToSendToUser = exports.ReserveIsStale = exports.InitialAccountintIncorrect = exports.SharesMintIncorrect = exports.SharesMintDecimalsIncorrect = exports.TokenVaultIncorrect = exports.TokenMintDecimalsIncorrect = exports.TokenMintIncorrect = exports.BaseVaultAuthorityBumpIncorrect = exports.BaseVaultAuthorityIncorrect = exports.AdminAuthorityIncorrect = exports.InvestAmountBelowMinimum = exports.CannotFindReserveInAllocations = exports.OutOfRangeOfReserveIndex = exports.ReserveAccountAndKeyMismatch = exports.ReserveNotProvidedInTheAccounts = exports.CouldNotDeserializeAccountAsReserve = exports.ReserveNotPartOfAllocations = exports.ReserveAlreadyExists = exports.TooMuchLiquidityToWithdraw = exports.WithdrawAmountBelowMinimum = exports.IntegerOverflow = exports.MathOverflow = exports.SharesIssuedAmountDoesNotMatch = exports.DepositAmountsZero = void 0;
3
+ exports.ManagementFeeGreaterThanMaxAllowed = exports.CannotWithdrawZeroShares = exports.WithdrawResultsInZeroShares = exports.DepositAmountsZeroShares = exports.AUMBelowPendingFees = exports.AUMDecreasedAfterInvest = exports.SharesMintedAmountDoesNotMatch = exports.DisinvestedLiquidityAmountDoesNotMatch = exports.SharesBurnedAmountDoesNotMatch = exports.UserReceivedAmountDoesNotMatch = exports.LiquidityToWithdrawDoesNotMatch = exports.AmountToWithdrawDoesNotMatch = exports.TokensDepositedAmountDoesNotMatch = exports.CannotWithdrawFromEmptyVault = exports.ReserveSpaceExhausted = exports.DepositAmountBelowMinimum = exports.BPSValueTooBig = exports.NotEnoughLiquidityDisinvestedToSendToUser = exports.ReserveIsStale = exports.InitialAccountingIncorrect = exports.SharesMintIncorrect = exports.SharesMintDecimalsIncorrect = exports.TokenVaultIncorrect = exports.TokenMintDecimalsIncorrect = exports.TokenMintIncorrect = exports.BaseVaultAuthorityBumpIncorrect = exports.BaseVaultAuthorityIncorrect = exports.AdminAuthorityIncorrect = exports.InvestAmountBelowMinimum = exports.CannotFindReserveInAllocations = exports.OutOfRangeOfReserveIndex = exports.ReserveAccountAndKeyMismatch = exports.ReserveNotProvidedInTheAccounts = exports.CouldNotDeserializeAccountAsReserve = exports.ReserveNotPartOfAllocations = exports.ReserveAlreadyExists = exports.TooMuchLiquidityToWithdraw = exports.WithdrawAmountBelowMinimum = exports.IntegerOverflow = exports.MathOverflow = exports.SharesIssuedAmountDoesNotMatch = exports.DepositAmountsZero = void 0;
4
4
  exports.fromCode = fromCode;
5
5
  class DepositAmountsZero extends Error {
6
6
  logs;
7
- static code = 6000;
8
- code = 6000;
7
+ static code = 7000;
8
+ code = 7000;
9
9
  name = "DepositAmountsZero";
10
10
  msg = "DepositAmountsZero";
11
11
  constructor(logs) {
12
- super("6000: DepositAmountsZero");
12
+ super("7000: DepositAmountsZero");
13
13
  this.logs = logs;
14
14
  }
15
15
  }
16
16
  exports.DepositAmountsZero = DepositAmountsZero;
17
17
  class SharesIssuedAmountDoesNotMatch extends Error {
18
18
  logs;
19
- static code = 6001;
20
- code = 6001;
19
+ static code = 7001;
20
+ code = 7001;
21
21
  name = "SharesIssuedAmountDoesNotMatch";
22
22
  msg = "SharesIssuedAmountDoesNotMatch";
23
23
  constructor(logs) {
24
- super("6001: SharesIssuedAmountDoesNotMatch");
24
+ super("7001: SharesIssuedAmountDoesNotMatch");
25
25
  this.logs = logs;
26
26
  }
27
27
  }
28
28
  exports.SharesIssuedAmountDoesNotMatch = SharesIssuedAmountDoesNotMatch;
29
29
  class MathOverflow extends Error {
30
30
  logs;
31
- static code = 6002;
32
- code = 6002;
31
+ static code = 7002;
32
+ code = 7002;
33
33
  name = "MathOverflow";
34
34
  msg = "MathOverflow";
35
35
  constructor(logs) {
36
- super("6002: MathOverflow");
36
+ super("7002: MathOverflow");
37
37
  this.logs = logs;
38
38
  }
39
39
  }
40
40
  exports.MathOverflow = MathOverflow;
41
41
  class IntegerOverflow extends Error {
42
42
  logs;
43
- static code = 6003;
44
- code = 6003;
43
+ static code = 7003;
44
+ code = 7003;
45
45
  name = "IntegerOverflow";
46
46
  msg = "IntegerOverflow";
47
47
  constructor(logs) {
48
- super("6003: IntegerOverflow");
48
+ super("7003: IntegerOverflow");
49
49
  this.logs = logs;
50
50
  }
51
51
  }
52
52
  exports.IntegerOverflow = IntegerOverflow;
53
53
  class WithdrawAmountBelowMinimum extends Error {
54
54
  logs;
55
- static code = 6004;
56
- code = 6004;
55
+ static code = 7004;
56
+ code = 7004;
57
57
  name = "WithdrawAmountBelowMinimum";
58
58
  msg = "Withdrawn amount is below minimum";
59
59
  constructor(logs) {
60
- super("6004: Withdrawn amount is below minimum");
60
+ super("7004: Withdrawn amount is below minimum");
61
61
  this.logs = logs;
62
62
  }
63
63
  }
64
64
  exports.WithdrawAmountBelowMinimum = WithdrawAmountBelowMinimum;
65
65
  class TooMuchLiquidityToWithdraw extends Error {
66
66
  logs;
67
- static code = 6005;
68
- code = 6005;
67
+ static code = 7005;
68
+ code = 7005;
69
69
  name = "TooMuchLiquidityToWithdraw";
70
70
  msg = "TooMuchLiquidityToWithdraw";
71
71
  constructor(logs) {
72
- super("6005: TooMuchLiquidityToWithdraw");
72
+ super("7005: TooMuchLiquidityToWithdraw");
73
73
  this.logs = logs;
74
74
  }
75
75
  }
76
76
  exports.TooMuchLiquidityToWithdraw = TooMuchLiquidityToWithdraw;
77
77
  class ReserveAlreadyExists extends Error {
78
78
  logs;
79
- static code = 6006;
80
- code = 6006;
79
+ static code = 7006;
80
+ code = 7006;
81
81
  name = "ReserveAlreadyExists";
82
82
  msg = "ReserveAlreadyExists";
83
83
  constructor(logs) {
84
- super("6006: ReserveAlreadyExists");
84
+ super("7006: ReserveAlreadyExists");
85
85
  this.logs = logs;
86
86
  }
87
87
  }
88
88
  exports.ReserveAlreadyExists = ReserveAlreadyExists;
89
89
  class ReserveNotPartOfAllocations extends Error {
90
90
  logs;
91
- static code = 6007;
92
- code = 6007;
91
+ static code = 7007;
92
+ code = 7007;
93
93
  name = "ReserveNotPartOfAllocations";
94
94
  msg = "ReserveNotPartOfAllocations";
95
95
  constructor(logs) {
96
- super("6007: ReserveNotPartOfAllocations");
96
+ super("7007: ReserveNotPartOfAllocations");
97
97
  this.logs = logs;
98
98
  }
99
99
  }
100
100
  exports.ReserveNotPartOfAllocations = ReserveNotPartOfAllocations;
101
101
  class CouldNotDeserializeAccountAsReserve extends Error {
102
102
  logs;
103
- static code = 6008;
104
- code = 6008;
103
+ static code = 7008;
104
+ code = 7008;
105
105
  name = "CouldNotDeserializeAccountAsReserve";
106
106
  msg = "CouldNotDeserializeAccountAsReserve";
107
107
  constructor(logs) {
108
- super("6008: CouldNotDeserializeAccountAsReserve");
108
+ super("7008: CouldNotDeserializeAccountAsReserve");
109
109
  this.logs = logs;
110
110
  }
111
111
  }
112
112
  exports.CouldNotDeserializeAccountAsReserve = CouldNotDeserializeAccountAsReserve;
113
113
  class ReserveNotProvidedInTheAccounts extends Error {
114
114
  logs;
115
- static code = 6009;
116
- code = 6009;
115
+ static code = 7009;
116
+ code = 7009;
117
117
  name = "ReserveNotProvidedInTheAccounts";
118
118
  msg = "ReserveNotProvidedInTheAccounts";
119
119
  constructor(logs) {
120
- super("6009: ReserveNotProvidedInTheAccounts");
120
+ super("7009: ReserveNotProvidedInTheAccounts");
121
121
  this.logs = logs;
122
122
  }
123
123
  }
124
124
  exports.ReserveNotProvidedInTheAccounts = ReserveNotProvidedInTheAccounts;
125
125
  class ReserveAccountAndKeyMismatch extends Error {
126
126
  logs;
127
- static code = 6010;
128
- code = 6010;
127
+ static code = 7010;
128
+ code = 7010;
129
129
  name = "ReserveAccountAndKeyMismatch";
130
130
  msg = "ReserveAccountAndKeyMismatch";
131
131
  constructor(logs) {
132
- super("6010: ReserveAccountAndKeyMismatch");
132
+ super("7010: ReserveAccountAndKeyMismatch");
133
133
  this.logs = logs;
134
134
  }
135
135
  }
136
136
  exports.ReserveAccountAndKeyMismatch = ReserveAccountAndKeyMismatch;
137
137
  class OutOfRangeOfReserveIndex extends Error {
138
138
  logs;
139
- static code = 6011;
140
- code = 6011;
139
+ static code = 7011;
140
+ code = 7011;
141
141
  name = "OutOfRangeOfReserveIndex";
142
142
  msg = "OutOfRangeOfReserveIndex";
143
143
  constructor(logs) {
144
- super("6011: OutOfRangeOfReserveIndex");
144
+ super("7011: OutOfRangeOfReserveIndex");
145
145
  this.logs = logs;
146
146
  }
147
147
  }
148
148
  exports.OutOfRangeOfReserveIndex = OutOfRangeOfReserveIndex;
149
149
  class CannotFindReserveInAllocations extends Error {
150
150
  logs;
151
- static code = 6012;
152
- code = 6012;
151
+ static code = 7012;
152
+ code = 7012;
153
153
  name = "CannotFindReserveInAllocations";
154
154
  msg = "OutOfRangeOfReserveIndex";
155
155
  constructor(logs) {
156
- super("6012: OutOfRangeOfReserveIndex");
156
+ super("7012: OutOfRangeOfReserveIndex");
157
157
  this.logs = logs;
158
158
  }
159
159
  }
160
160
  exports.CannotFindReserveInAllocations = CannotFindReserveInAllocations;
161
161
  class InvestAmountBelowMinimum extends Error {
162
162
  logs;
163
- static code = 6013;
164
- code = 6013;
163
+ static code = 7013;
164
+ code = 7013;
165
165
  name = "InvestAmountBelowMinimum";
166
166
  msg = "Invested amount is below minimum";
167
167
  constructor(logs) {
168
- super("6013: Invested amount is below minimum");
168
+ super("7013: Invested amount is below minimum");
169
169
  this.logs = logs;
170
170
  }
171
171
  }
172
172
  exports.InvestAmountBelowMinimum = InvestAmountBelowMinimum;
173
173
  class AdminAuthorityIncorrect extends Error {
174
174
  logs;
175
- static code = 6014;
176
- code = 6014;
175
+ static code = 7014;
176
+ code = 7014;
177
177
  name = "AdminAuthorityIncorrect";
178
178
  msg = "AdminAuthorityIncorrect";
179
179
  constructor(logs) {
180
- super("6014: AdminAuthorityIncorrect");
180
+ super("7014: AdminAuthorityIncorrect");
181
181
  this.logs = logs;
182
182
  }
183
183
  }
184
184
  exports.AdminAuthorityIncorrect = AdminAuthorityIncorrect;
185
185
  class BaseVaultAuthorityIncorrect extends Error {
186
186
  logs;
187
- static code = 6015;
188
- code = 6015;
187
+ static code = 7015;
188
+ code = 7015;
189
189
  name = "BaseVaultAuthorityIncorrect";
190
190
  msg = "BaseVaultAuthorityIncorrect";
191
191
  constructor(logs) {
192
- super("6015: BaseVaultAuthorityIncorrect");
192
+ super("7015: BaseVaultAuthorityIncorrect");
193
193
  this.logs = logs;
194
194
  }
195
195
  }
196
196
  exports.BaseVaultAuthorityIncorrect = BaseVaultAuthorityIncorrect;
197
197
  class BaseVaultAuthorityBumpIncorrect extends Error {
198
198
  logs;
199
- static code = 6016;
200
- code = 6016;
199
+ static code = 7016;
200
+ code = 7016;
201
201
  name = "BaseVaultAuthorityBumpIncorrect";
202
202
  msg = "BaseVaultAuthorityBumpIncorrect";
203
203
  constructor(logs) {
204
- super("6016: BaseVaultAuthorityBumpIncorrect");
204
+ super("7016: BaseVaultAuthorityBumpIncorrect");
205
205
  this.logs = logs;
206
206
  }
207
207
  }
208
208
  exports.BaseVaultAuthorityBumpIncorrect = BaseVaultAuthorityBumpIncorrect;
209
209
  class TokenMintIncorrect extends Error {
210
210
  logs;
211
- static code = 6017;
212
- code = 6017;
211
+ static code = 7017;
212
+ code = 7017;
213
213
  name = "TokenMintIncorrect";
214
214
  msg = "TokenMintIncorrect";
215
215
  constructor(logs) {
216
- super("6017: TokenMintIncorrect");
216
+ super("7017: TokenMintIncorrect");
217
217
  this.logs = logs;
218
218
  }
219
219
  }
220
220
  exports.TokenMintIncorrect = TokenMintIncorrect;
221
221
  class TokenMintDecimalsIncorrect extends Error {
222
222
  logs;
223
- static code = 6018;
224
- code = 6018;
223
+ static code = 7018;
224
+ code = 7018;
225
225
  name = "TokenMintDecimalsIncorrect";
226
226
  msg = "TokenMintDecimalsIncorrect";
227
227
  constructor(logs) {
228
- super("6018: TokenMintDecimalsIncorrect");
228
+ super("7018: TokenMintDecimalsIncorrect");
229
229
  this.logs = logs;
230
230
  }
231
231
  }
232
232
  exports.TokenMintDecimalsIncorrect = TokenMintDecimalsIncorrect;
233
233
  class TokenVaultIncorrect extends Error {
234
234
  logs;
235
- static code = 6019;
236
- code = 6019;
235
+ static code = 7019;
236
+ code = 7019;
237
237
  name = "TokenVaultIncorrect";
238
238
  msg = "TokenVaultIncorrect";
239
239
  constructor(logs) {
240
- super("6019: TokenVaultIncorrect");
240
+ super("7019: TokenVaultIncorrect");
241
241
  this.logs = logs;
242
242
  }
243
243
  }
244
244
  exports.TokenVaultIncorrect = TokenVaultIncorrect;
245
245
  class SharesMintDecimalsIncorrect extends Error {
246
246
  logs;
247
- static code = 6020;
248
- code = 6020;
247
+ static code = 7020;
248
+ code = 7020;
249
249
  name = "SharesMintDecimalsIncorrect";
250
250
  msg = "SharesMintDecimalsIncorrect";
251
251
  constructor(logs) {
252
- super("6020: SharesMintDecimalsIncorrect");
252
+ super("7020: SharesMintDecimalsIncorrect");
253
253
  this.logs = logs;
254
254
  }
255
255
  }
256
256
  exports.SharesMintDecimalsIncorrect = SharesMintDecimalsIncorrect;
257
257
  class SharesMintIncorrect extends Error {
258
258
  logs;
259
- static code = 6021;
260
- code = 6021;
259
+ static code = 7021;
260
+ code = 7021;
261
261
  name = "SharesMintIncorrect";
262
262
  msg = "SharesMintIncorrect";
263
263
  constructor(logs) {
264
- super("6021: SharesMintIncorrect");
264
+ super("7021: SharesMintIncorrect");
265
265
  this.logs = logs;
266
266
  }
267
267
  }
268
268
  exports.SharesMintIncorrect = SharesMintIncorrect;
269
- class InitialAccountintIncorrect extends Error {
269
+ class InitialAccountingIncorrect extends Error {
270
270
  logs;
271
- static code = 6022;
272
- code = 6022;
273
- name = "InitialAccountintIncorrect";
274
- msg = "InitialAccountintIncorrect";
271
+ static code = 7022;
272
+ code = 7022;
273
+ name = "InitialAccountingIncorrect";
274
+ msg = "InitialAccountingIncorrect";
275
275
  constructor(logs) {
276
- super("6022: InitialAccountintIncorrect");
276
+ super("7022: InitialAccountingIncorrect");
277
277
  this.logs = logs;
278
278
  }
279
279
  }
280
- exports.InitialAccountintIncorrect = InitialAccountintIncorrect;
280
+ exports.InitialAccountingIncorrect = InitialAccountingIncorrect;
281
281
  class ReserveIsStale extends Error {
282
282
  logs;
283
- static code = 6023;
284
- code = 6023;
283
+ static code = 7023;
284
+ code = 7023;
285
285
  name = "ReserveIsStale";
286
286
  msg = "Reserve is stale and must be refreshed before any operation";
287
287
  constructor(logs) {
288
- super("6023: Reserve is stale and must be refreshed before any operation");
288
+ super("7023: Reserve is stale and must be refreshed before any operation");
289
289
  this.logs = logs;
290
290
  }
291
291
  }
292
292
  exports.ReserveIsStale = ReserveIsStale;
293
293
  class NotEnoughLiquidityDisinvestedToSendToUser extends Error {
294
294
  logs;
295
- static code = 6024;
296
- code = 6024;
295
+ static code = 7024;
296
+ code = 7024;
297
297
  name = "NotEnoughLiquidityDisinvestedToSendToUser";
298
298
  msg = "Not enough liquidity disinvested to send to user";
299
299
  constructor(logs) {
300
- super("6024: Not enough liquidity disinvested to send to user");
300
+ super("7024: Not enough liquidity disinvested to send to user");
301
301
  this.logs = logs;
302
302
  }
303
303
  }
304
304
  exports.NotEnoughLiquidityDisinvestedToSendToUser = NotEnoughLiquidityDisinvestedToSendToUser;
305
305
  class BPSValueTooBig extends Error {
306
306
  logs;
307
- static code = 6025;
308
- code = 6025;
307
+ static code = 7025;
308
+ code = 7025;
309
309
  name = "BPSValueTooBig";
310
310
  msg = "BPS value is greater than 10000";
311
311
  constructor(logs) {
312
- super("6025: BPS value is greater than 10000");
312
+ super("7025: BPS value is greater than 10000");
313
313
  this.logs = logs;
314
314
  }
315
315
  }
316
316
  exports.BPSValueTooBig = BPSValueTooBig;
317
317
  class DepositAmountBelowMinimum extends Error {
318
318
  logs;
319
- static code = 6026;
320
- code = 6026;
319
+ static code = 7026;
320
+ code = 7026;
321
321
  name = "DepositAmountBelowMinimum";
322
322
  msg = "Deposited amount is below minimum";
323
323
  constructor(logs) {
324
- super("6026: Deposited amount is below minimum");
324
+ super("7026: Deposited amount is below minimum");
325
325
  this.logs = logs;
326
326
  }
327
327
  }
328
328
  exports.DepositAmountBelowMinimum = DepositAmountBelowMinimum;
329
329
  class ReserveSpaceExhausted extends Error {
330
330
  logs;
331
- static code = 6027;
332
- code = 6027;
331
+ static code = 7027;
332
+ code = 7027;
333
333
  name = "ReserveSpaceExhausted";
334
334
  msg = "Vault have no space for new reserves";
335
335
  constructor(logs) {
336
- super("6027: Vault have no space for new reserves");
336
+ super("7027: Vault have no space for new reserves");
337
337
  this.logs = logs;
338
338
  }
339
339
  }
340
340
  exports.ReserveSpaceExhausted = ReserveSpaceExhausted;
341
341
  class CannotWithdrawFromEmptyVault extends Error {
342
342
  logs;
343
- static code = 6028;
344
- code = 6028;
343
+ static code = 7028;
344
+ code = 7028;
345
345
  name = "CannotWithdrawFromEmptyVault";
346
346
  msg = "Cannot withdraw from empty vault";
347
347
  constructor(logs) {
348
- super("6028: Cannot withdraw from empty vault");
348
+ super("7028: Cannot withdraw from empty vault");
349
349
  this.logs = logs;
350
350
  }
351
351
  }
352
352
  exports.CannotWithdrawFromEmptyVault = CannotWithdrawFromEmptyVault;
353
353
  class TokensDepositedAmountDoesNotMatch extends Error {
354
354
  logs;
355
- static code = 6029;
356
- code = 6029;
355
+ static code = 7029;
356
+ code = 7029;
357
357
  name = "TokensDepositedAmountDoesNotMatch";
358
358
  msg = "TokensDepositedAmountDoesNotMatch";
359
359
  constructor(logs) {
360
- super("6029: TokensDepositedAmountDoesNotMatch");
360
+ super("7029: TokensDepositedAmountDoesNotMatch");
361
361
  this.logs = logs;
362
362
  }
363
363
  }
364
364
  exports.TokensDepositedAmountDoesNotMatch = TokensDepositedAmountDoesNotMatch;
365
365
  class AmountToWithdrawDoesNotMatch extends Error {
366
366
  logs;
367
- static code = 6030;
368
- code = 6030;
367
+ static code = 7030;
368
+ code = 7030;
369
369
  name = "AmountToWithdrawDoesNotMatch";
370
370
  msg = "Amount to withdraw does not match";
371
371
  constructor(logs) {
372
- super("6030: Amount to withdraw does not match");
372
+ super("7030: Amount to withdraw does not match");
373
373
  this.logs = logs;
374
374
  }
375
375
  }
376
376
  exports.AmountToWithdrawDoesNotMatch = AmountToWithdrawDoesNotMatch;
377
377
  class LiquidityToWithdrawDoesNotMatch extends Error {
378
378
  logs;
379
- static code = 6031;
380
- code = 6031;
379
+ static code = 7031;
380
+ code = 7031;
381
381
  name = "LiquidityToWithdrawDoesNotMatch";
382
382
  msg = "Liquidity to withdraw does not match";
383
383
  constructor(logs) {
384
- super("6031: Liquidity to withdraw does not match");
384
+ super("7031: Liquidity to withdraw does not match");
385
385
  this.logs = logs;
386
386
  }
387
387
  }
388
388
  exports.LiquidityToWithdrawDoesNotMatch = LiquidityToWithdrawDoesNotMatch;
389
389
  class UserReceivedAmountDoesNotMatch extends Error {
390
390
  logs;
391
- static code = 6032;
392
- code = 6032;
391
+ static code = 7032;
392
+ code = 7032;
393
393
  name = "UserReceivedAmountDoesNotMatch";
394
394
  msg = "User received amount does not match";
395
395
  constructor(logs) {
396
- super("6032: User received amount does not match");
396
+ super("7032: User received amount does not match");
397
397
  this.logs = logs;
398
398
  }
399
399
  }
400
400
  exports.UserReceivedAmountDoesNotMatch = UserReceivedAmountDoesNotMatch;
401
401
  class SharesBurnedAmountDoesNotMatch extends Error {
402
402
  logs;
403
- static code = 6033;
404
- code = 6033;
403
+ static code = 7033;
404
+ code = 7033;
405
405
  name = "SharesBurnedAmountDoesNotMatch";
406
406
  msg = "Shares burned amount does not match";
407
407
  constructor(logs) {
408
- super("6033: Shares burned amount does not match");
408
+ super("7033: Shares burned amount does not match");
409
409
  this.logs = logs;
410
410
  }
411
411
  }
412
412
  exports.SharesBurnedAmountDoesNotMatch = SharesBurnedAmountDoesNotMatch;
413
413
  class DisinvestedLiquidityAmountDoesNotMatch extends Error {
414
414
  logs;
415
- static code = 6034;
416
- code = 6034;
415
+ static code = 7034;
416
+ code = 7034;
417
417
  name = "DisinvestedLiquidityAmountDoesNotMatch";
418
418
  msg = "Disinvested liquidity amount does not match";
419
419
  constructor(logs) {
420
- super("6034: Disinvested liquidity amount does not match");
420
+ super("7034: Disinvested liquidity amount does not match");
421
421
  this.logs = logs;
422
422
  }
423
423
  }
424
424
  exports.DisinvestedLiquidityAmountDoesNotMatch = DisinvestedLiquidityAmountDoesNotMatch;
425
425
  class SharesMintedAmountDoesNotMatch extends Error {
426
426
  logs;
427
- static code = 6035;
428
- code = 6035;
427
+ static code = 7035;
428
+ code = 7035;
429
429
  name = "SharesMintedAmountDoesNotMatch";
430
430
  msg = "SharesMintedAmountDoesNotMatch";
431
431
  constructor(logs) {
432
- super("6035: SharesMintedAmountDoesNotMatch");
432
+ super("7035: SharesMintedAmountDoesNotMatch");
433
433
  this.logs = logs;
434
434
  }
435
435
  }
436
436
  exports.SharesMintedAmountDoesNotMatch = SharesMintedAmountDoesNotMatch;
437
437
  class AUMDecreasedAfterInvest extends Error {
438
438
  logs;
439
- static code = 6036;
440
- code = 6036;
439
+ static code = 7036;
440
+ code = 7036;
441
441
  name = "AUMDecreasedAfterInvest";
442
442
  msg = "AUM decreased after invest";
443
443
  constructor(logs) {
444
- super("6036: AUM decreased after invest");
444
+ super("7036: AUM decreased after invest");
445
445
  this.logs = logs;
446
446
  }
447
447
  }
448
448
  exports.AUMDecreasedAfterInvest = AUMDecreasedAfterInvest;
449
449
  class AUMBelowPendingFees extends Error {
450
450
  logs;
451
- static code = 6037;
452
- code = 6037;
451
+ static code = 7037;
452
+ code = 7037;
453
453
  name = "AUMBelowPendingFees";
454
454
  msg = "AUM is below pending fees";
455
455
  constructor(logs) {
456
- super("6037: AUM is below pending fees");
456
+ super("7037: AUM is below pending fees");
457
457
  this.logs = logs;
458
458
  }
459
459
  }
460
460
  exports.AUMBelowPendingFees = AUMBelowPendingFees;
461
+ class DepositAmountsZeroShares extends Error {
462
+ logs;
463
+ static code = 7038;
464
+ code = 7038;
465
+ name = "DepositAmountsZeroShares";
466
+ msg = "Deposit amount results in 0 shares";
467
+ constructor(logs) {
468
+ super("7038: Deposit amount results in 0 shares");
469
+ this.logs = logs;
470
+ }
471
+ }
472
+ exports.DepositAmountsZeroShares = DepositAmountsZeroShares;
473
+ class WithdrawResultsInZeroShares extends Error {
474
+ logs;
475
+ static code = 7039;
476
+ code = 7039;
477
+ name = "WithdrawResultsInZeroShares";
478
+ msg = "Withdraw amount results in 0 shares";
479
+ constructor(logs) {
480
+ super("7039: Withdraw amount results in 0 shares");
481
+ this.logs = logs;
482
+ }
483
+ }
484
+ exports.WithdrawResultsInZeroShares = WithdrawResultsInZeroShares;
485
+ class CannotWithdrawZeroShares extends Error {
486
+ logs;
487
+ static code = 7040;
488
+ code = 7040;
489
+ name = "CannotWithdrawZeroShares";
490
+ msg = "Cannot withdraw zero shares";
491
+ constructor(logs) {
492
+ super("7040: Cannot withdraw zero shares");
493
+ this.logs = logs;
494
+ }
495
+ }
496
+ exports.CannotWithdrawZeroShares = CannotWithdrawZeroShares;
497
+ class ManagementFeeGreaterThanMaxAllowed extends Error {
498
+ logs;
499
+ static code = 7041;
500
+ code = 7041;
501
+ name = "ManagementFeeGreaterThanMaxAllowed";
502
+ msg = "Management fee is greater than maximum allowed";
503
+ constructor(logs) {
504
+ super("7041: Management fee is greater than maximum allowed");
505
+ this.logs = logs;
506
+ }
507
+ }
508
+ exports.ManagementFeeGreaterThanMaxAllowed = ManagementFeeGreaterThanMaxAllowed;
461
509
  function fromCode(code, logs) {
462
510
  switch (code) {
463
- case 6000:
511
+ case 7000:
464
512
  return new DepositAmountsZero(logs);
465
- case 6001:
513
+ case 7001:
466
514
  return new SharesIssuedAmountDoesNotMatch(logs);
467
- case 6002:
515
+ case 7002:
468
516
  return new MathOverflow(logs);
469
- case 6003:
517
+ case 7003:
470
518
  return new IntegerOverflow(logs);
471
- case 6004:
519
+ case 7004:
472
520
  return new WithdrawAmountBelowMinimum(logs);
473
- case 6005:
521
+ case 7005:
474
522
  return new TooMuchLiquidityToWithdraw(logs);
475
- case 6006:
523
+ case 7006:
476
524
  return new ReserveAlreadyExists(logs);
477
- case 6007:
525
+ case 7007:
478
526
  return new ReserveNotPartOfAllocations(logs);
479
- case 6008:
527
+ case 7008:
480
528
  return new CouldNotDeserializeAccountAsReserve(logs);
481
- case 6009:
529
+ case 7009:
482
530
  return new ReserveNotProvidedInTheAccounts(logs);
483
- case 6010:
531
+ case 7010:
484
532
  return new ReserveAccountAndKeyMismatch(logs);
485
- case 6011:
533
+ case 7011:
486
534
  return new OutOfRangeOfReserveIndex(logs);
487
- case 6012:
535
+ case 7012:
488
536
  return new CannotFindReserveInAllocations(logs);
489
- case 6013:
537
+ case 7013:
490
538
  return new InvestAmountBelowMinimum(logs);
491
- case 6014:
539
+ case 7014:
492
540
  return new AdminAuthorityIncorrect(logs);
493
- case 6015:
541
+ case 7015:
494
542
  return new BaseVaultAuthorityIncorrect(logs);
495
- case 6016:
543
+ case 7016:
496
544
  return new BaseVaultAuthorityBumpIncorrect(logs);
497
- case 6017:
545
+ case 7017:
498
546
  return new TokenMintIncorrect(logs);
499
- case 6018:
547
+ case 7018:
500
548
  return new TokenMintDecimalsIncorrect(logs);
501
- case 6019:
549
+ case 7019:
502
550
  return new TokenVaultIncorrect(logs);
503
- case 6020:
551
+ case 7020:
504
552
  return new SharesMintDecimalsIncorrect(logs);
505
- case 6021:
553
+ case 7021:
506
554
  return new SharesMintIncorrect(logs);
507
- case 6022:
508
- return new InitialAccountintIncorrect(logs);
509
- case 6023:
555
+ case 7022:
556
+ return new InitialAccountingIncorrect(logs);
557
+ case 7023:
510
558
  return new ReserveIsStale(logs);
511
- case 6024:
559
+ case 7024:
512
560
  return new NotEnoughLiquidityDisinvestedToSendToUser(logs);
513
- case 6025:
561
+ case 7025:
514
562
  return new BPSValueTooBig(logs);
515
- case 6026:
563
+ case 7026:
516
564
  return new DepositAmountBelowMinimum(logs);
517
- case 6027:
565
+ case 7027:
518
566
  return new ReserveSpaceExhausted(logs);
519
- case 6028:
567
+ case 7028:
520
568
  return new CannotWithdrawFromEmptyVault(logs);
521
- case 6029:
569
+ case 7029:
522
570
  return new TokensDepositedAmountDoesNotMatch(logs);
523
- case 6030:
571
+ case 7030:
524
572
  return new AmountToWithdrawDoesNotMatch(logs);
525
- case 6031:
573
+ case 7031:
526
574
  return new LiquidityToWithdrawDoesNotMatch(logs);
527
- case 6032:
575
+ case 7032:
528
576
  return new UserReceivedAmountDoesNotMatch(logs);
529
- case 6033:
577
+ case 7033:
530
578
  return new SharesBurnedAmountDoesNotMatch(logs);
531
- case 6034:
579
+ case 7034:
532
580
  return new DisinvestedLiquidityAmountDoesNotMatch(logs);
533
- case 6035:
581
+ case 7035:
534
582
  return new SharesMintedAmountDoesNotMatch(logs);
535
- case 6036:
583
+ case 7036:
536
584
  return new AUMDecreasedAfterInvest(logs);
537
- case 6037:
585
+ case 7037:
538
586
  return new AUMBelowPendingFees(logs);
587
+ case 7038:
588
+ return new DepositAmountsZeroShares(logs);
589
+ case 7039:
590
+ return new WithdrawResultsInZeroShares(logs);
591
+ case 7040:
592
+ return new CannotWithdrawZeroShares(logs);
593
+ case 7041:
594
+ return new ManagementFeeGreaterThanMaxAllowed(logs);
539
595
  }
540
596
  return null;
541
597
  }