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