@lavarage/sdk 7.5.21 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/constants.ts +6 -0
  2. package/crossbar.ts +53 -0
  3. package/dist/index.d.mts +5559 -1791
  4. package/dist/index.d.ts +5559 -1791
  5. package/dist/index.js +3502 -4975
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +3301 -4772
  8. package/dist/index.mjs.map +1 -1
  9. package/docs/functions/borrowV1.html +1 -1
  10. package/docs/functions/borrowV2.html +1 -1
  11. package/docs/functions/closePositionEvm.html +2 -2
  12. package/docs/functions/closeTradeV1.html +2 -2
  13. package/docs/functions/closeTradeV2.html +2 -2
  14. package/docs/functions/createTpDelegate.html +2 -2
  15. package/docs/functions/getActiveLoanCountEvm.html +2 -2
  16. package/docs/functions/getActiveLoansBatchEvm.html +2 -2
  17. package/docs/functions/getAllPositions.html +2 -2
  18. package/docs/functions/getAvailableExposureEvm.html +2 -2
  19. package/docs/functions/getClosedPositions.html +2 -2
  20. package/docs/functions/getClosedPositionsEvm.html +2 -2
  21. package/docs/functions/getCollateralExposureEvm.html +2 -2
  22. package/docs/functions/getCollateralInfoEvm.html +2 -2
  23. package/docs/functions/getDelegateAccounts.html +2 -2
  24. package/docs/functions/getLiquidatedPositions.html +2 -2
  25. package/docs/functions/getLiquidatedPositionsEvm.html +2 -2
  26. package/docs/functions/getLoanEvm.html +2 -2
  27. package/docs/functions/getLoansByBorrowerEvm.html +2 -2
  28. package/docs/functions/getOffers.html +2 -2
  29. package/docs/functions/getOffersEvm.html +2 -2
  30. package/docs/functions/getOpenPositions.html +2 -2
  31. package/docs/functions/getOpeningFeeEvm.html +2 -2
  32. package/docs/functions/getPda.html +2 -2
  33. package/docs/functions/getPositionAccountPDA.html +2 -2
  34. package/docs/functions/getPositionsEvm.html +2 -2
  35. package/docs/functions/getProfitFeeEvm.html +2 -2
  36. package/docs/functions/getTokenBalanceEvm.html +2 -2
  37. package/docs/functions/getUserLoansEvm.html +2 -2
  38. package/docs/functions/lending.addToWithdrawalAccessList.html +1 -1
  39. package/docs/functions/lending.createOffer.html +2 -2
  40. package/docs/functions/lending.depositFunds.html +2 -2
  41. package/docs/functions/lending.getNodeWalletPDA.html +2 -2
  42. package/docs/functions/lending.getTradingPoolPDA.html +2 -2
  43. package/docs/functions/lending.getWithdrawalAccessList.html +1 -1
  44. package/docs/functions/lending.getWithdrawalAccessListPDA.html +1 -1
  45. package/docs/functions/lending.removeFromWithdrawalAccessList.html +1 -1
  46. package/docs/functions/lending.updateInterestRate.html +2 -2
  47. package/docs/functions/lending.updateMaxBorrow.html +2 -2
  48. package/docs/functions/lending.updateMaxExposure.html +2 -2
  49. package/docs/functions/lending.updateOffer.html +2 -2
  50. package/docs/functions/lending.withdrawFunds.html +2 -2
  51. package/docs/functions/lending.withdrawFundsV1.html +2 -2
  52. package/docs/functions/lending.withdrawFundsV2.html +2 -2
  53. package/docs/functions/liquidatePositionEvm.html +2 -2
  54. package/docs/functions/mergePositionV2.html +2 -2
  55. package/docs/functions/modifyTpDelegate.html +2 -2
  56. package/docs/functions/openPositionEvm.html +2 -2
  57. package/docs/functions/openTradeV1.html +2 -2
  58. package/docs/functions/openTradeV2.html +2 -2
  59. package/docs/functions/partialRepayV1.html +2 -2
  60. package/docs/functions/partialRepayV2.html +2 -2
  61. package/docs/functions/removeTpDelegate.html +2 -2
  62. package/docs/functions/splitPositionV2.html +2 -2
  63. package/docs/functions/updateMaxLendPerTokenBatchEvm.html +2 -2
  64. package/docs/hierarchy.html +1 -1
  65. package/docs/index.html +2 -2
  66. package/docs/modules/IDLV2.html +2 -2
  67. package/docs/modules/lending.html +1 -1
  68. package/docs/modules.html +2 -2
  69. package/docs/types/IDLV2.Lavarage.html +2 -2
  70. package/docs/types/Lavarage.html +2 -2
  71. package/docs/variables/IDL.html +1 -1
  72. package/docs/variables/IDLV2.IDL.html +1 -1
  73. package/idl/lavarageSOL.json +1852 -0
  74. package/idl/lavarageSOL.ts +1858 -0
  75. package/idl/lavarageUSDC.json +5377 -0
  76. package/idl/lavarageUSDC.ts +5383 -0
  77. package/idl/userVault.json +244 -0
  78. package/idl/userVault.ts +250 -0
  79. package/index.ts +81 -42
  80. package/lending.ts +225 -86
  81. package/package.json +6 -4
  82. package/switchboard.ts +23 -0
  83. package/tsconfig.json +2 -1
  84. package/utils.ts +54 -0
  85. package/idl/lavarage.ts +0 -3465
  86. package/idl/lavaragev2.ts +0 -3791
  87. package/idl/referralVault.ts +0 -276
@@ -1,276 +0,0 @@
1
- export type UserVault = {
2
- "version": "0.1.0",
3
- "name": "user_vault",
4
- "instructions": [
5
- {
6
- "name": "initializeVault",
7
- "accounts": [
8
- {
9
- "name": "userVault",
10
- "isMut": true,
11
- "isSigner": false
12
- },
13
- {
14
- "name": "user",
15
- "isMut": true,
16
- "isSigner": false
17
- },
18
- {
19
- "name": "funder",
20
- "isMut": true,
21
- "isSigner": true
22
- },
23
- {
24
- "name": "systemProgram",
25
- "isMut": false,
26
- "isSigner": false
27
- }
28
- ],
29
- "args": []
30
- },
31
- {
32
- "name": "claimSol",
33
- "accounts": [
34
- {
35
- "name": "userVault",
36
- "isMut": true,
37
- "isSigner": false
38
- },
39
- {
40
- "name": "signer",
41
- "isMut": false,
42
- "isSigner": true
43
- },
44
- {
45
- "name": "recipient",
46
- "isMut": true,
47
- "isSigner": false
48
- },
49
- {
50
- "name": "systemProgram",
51
- "isMut": false,
52
- "isSigner": false
53
- }
54
- ],
55
- "args": [
56
- {
57
- "name": "amount",
58
- "type": "u64"
59
- }
60
- ]
61
- },
62
- {
63
- "name": "claimToken",
64
- "accounts": [
65
- {
66
- "name": "userVault",
67
- "isMut": false,
68
- "isSigner": false
69
- },
70
- {
71
- "name": "vaultTokenAccount",
72
- "isMut": true,
73
- "isSigner": false
74
- },
75
- {
76
- "name": "recipientTokenAccount",
77
- "isMut": true,
78
- "isSigner": false
79
- },
80
- {
81
- "name": "tokenMint",
82
- "isMut": false,
83
- "isSigner": false
84
- },
85
- {
86
- "name": "signer",
87
- "isMut": false,
88
- "isSigner": true
89
- },
90
- {
91
- "name": "tokenProgram",
92
- "isMut": false,
93
- "isSigner": false
94
- }
95
- ],
96
- "args": [
97
- {
98
- "name": "amount",
99
- "type": "u64"
100
- }
101
- ]
102
- }
103
- ],
104
- "accounts": [
105
- {
106
- "name": "userVault",
107
- "type": {
108
- "kind": "struct",
109
- "fields": [
110
- {
111
- "name": "user",
112
- "type": "publicKey"
113
- },
114
- {
115
- "name": "authority",
116
- "type": "publicKey"
117
- },
118
- {
119
- "name": "bump",
120
- "type": "u8"
121
- },
122
- {
123
- "name": "totalSolClaimed",
124
- "type": "u64"
125
- }
126
- ]
127
- }
128
- }
129
- ],
130
- "errors": [
131
- {
132
- "code": 6000,
133
- "name": "UnauthorizedClaim",
134
- "msg": "Unauthorized: Only user or authority can claim"
135
- }
136
- ]
137
- };
138
-
139
- export const IDL: UserVault = {
140
- "version": "0.1.0",
141
- "name": "user_vault",
142
- "instructions": [
143
- {
144
- "name": "initializeVault",
145
- "accounts": [
146
- {
147
- "name": "userVault",
148
- "isMut": true,
149
- "isSigner": false
150
- },
151
- {
152
- "name": "user",
153
- "isMut": true,
154
- "isSigner": false
155
- },
156
- {
157
- "name": "funder",
158
- "isMut": true,
159
- "isSigner": true
160
- },
161
- {
162
- "name": "systemProgram",
163
- "isMut": false,
164
- "isSigner": false
165
- }
166
- ],
167
- "args": []
168
- },
169
- {
170
- "name": "claimSol",
171
- "accounts": [
172
- {
173
- "name": "userVault",
174
- "isMut": true,
175
- "isSigner": false
176
- },
177
- {
178
- "name": "signer",
179
- "isMut": false,
180
- "isSigner": true
181
- },
182
- {
183
- "name": "recipient",
184
- "isMut": true,
185
- "isSigner": false
186
- },
187
- {
188
- "name": "systemProgram",
189
- "isMut": false,
190
- "isSigner": false
191
- }
192
- ],
193
- "args": [
194
- {
195
- "name": "amount",
196
- "type": "u64"
197
- }
198
- ]
199
- },
200
- {
201
- "name": "claimToken",
202
- "accounts": [
203
- {
204
- "name": "userVault",
205
- "isMut": false,
206
- "isSigner": false
207
- },
208
- {
209
- "name": "vaultTokenAccount",
210
- "isMut": true,
211
- "isSigner": false
212
- },
213
- {
214
- "name": "recipientTokenAccount",
215
- "isMut": true,
216
- "isSigner": false
217
- },
218
- {
219
- "name": "tokenMint",
220
- "isMut": false,
221
- "isSigner": false
222
- },
223
- {
224
- "name": "signer",
225
- "isMut": false,
226
- "isSigner": true
227
- },
228
- {
229
- "name": "tokenProgram",
230
- "isMut": false,
231
- "isSigner": false
232
- }
233
- ],
234
- "args": [
235
- {
236
- "name": "amount",
237
- "type": "u64"
238
- }
239
- ]
240
- }
241
- ],
242
- "accounts": [
243
- {
244
- "name": "userVault",
245
- "type": {
246
- "kind": "struct",
247
- "fields": [
248
- {
249
- "name": "user",
250
- "type": "publicKey"
251
- },
252
- {
253
- "name": "authority",
254
- "type": "publicKey"
255
- },
256
- {
257
- "name": "bump",
258
- "type": "u8"
259
- },
260
- {
261
- "name": "totalSolClaimed",
262
- "type": "u64"
263
- }
264
- ]
265
- }
266
- }
267
- ],
268
- "errors": [
269
- {
270
- "code": 6000,
271
- "name": "UnauthorizedClaim",
272
- "msg": "Unauthorized: Only user or authority can claim"
273
- }
274
- ]
275
- };
276
-