@scallop-io/sui-scallop-sdk 0.44.27 → 0.45.0

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 (39) hide show
  1. package/dist/builders/borrowIncentiveBuilder.d.ts +0 -7
  2. package/dist/constants/cache.d.ts +8 -0
  3. package/dist/index.js +538 -268
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +522 -253
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/models/index.d.ts +1 -0
  8. package/dist/models/scallop.d.ts +7 -1
  9. package/dist/models/scallopAddress.d.ts +4 -2
  10. package/dist/models/scallopBuilder.d.ts +2 -0
  11. package/dist/models/scallopCache.d.ts +71 -0
  12. package/dist/models/scallopClient.d.ts +2 -0
  13. package/dist/models/scallopIndexer.d.ts +5 -3
  14. package/dist/models/scallopQuery.d.ts +14 -0
  15. package/dist/models/scallopUtils.d.ts +1 -0
  16. package/dist/queries/borrowIncentiveQuery.d.ts +8 -0
  17. package/dist/types/model.d.ts +2 -0
  18. package/dist/types/query/vesca.d.ts +2 -1
  19. package/package.json +2 -1
  20. package/src/builders/borrowIncentiveBuilder.ts +8 -57
  21. package/src/builders/vescaBuilder.ts +7 -3
  22. package/src/constants/cache.ts +15 -0
  23. package/src/models/index.ts +1 -0
  24. package/src/models/scallop.ts +26 -7
  25. package/src/models/scallopAddress.ts +24 -19
  26. package/src/models/scallopBuilder.ts +14 -4
  27. package/src/models/scallopCache.ts +245 -0
  28. package/src/models/scallopClient.ts +15 -4
  29. package/src/models/scallopIndexer.ts +58 -84
  30. package/src/models/scallopQuery.ts +34 -5
  31. package/src/models/scallopUtils.ts +53 -24
  32. package/src/queries/borrowIncentiveQuery.ts +99 -7
  33. package/src/queries/coreQuery.ts +62 -75
  34. package/src/queries/priceQuery.ts +4 -6
  35. package/src/queries/spoolQuery.ts +12 -15
  36. package/src/queries/vescaQuery.ts +20 -8
  37. package/src/types/model.ts +2 -0
  38. package/src/types/query/borrowIncentive.ts +0 -107
  39. package/src/types/query/vesca.ts +2 -1
@@ -16,24 +16,6 @@ export type BorrowIncentivePools = OptionalKeys<
16
16
  Record<SupportBorrowIncentiveCoins, BorrowIncentivePool>
17
17
  >;
18
18
 
19
- // export type BorrowIncentivePool = {
20
- // coinName: SupportBorrowIncentiveCoins;
21
- // symbol: string;
22
- // coinType: string;
23
- // rewardCoinType: string;
24
- // coinDecimal: number;
25
- // rewardCoinDecimal: number;
26
- // coinPrice: number;
27
- // rewardCoinPrice: number;
28
- // } & Required<
29
- // Pick<
30
- // ParsedBorrowIncentivePoolData,
31
- // 'maxPoints' | 'distributedPoint' | 'maxStake'
32
- // >
33
- // > &
34
- // CalculatedBorrowIncentivePoolData &
35
- // BorrowIncentiveRewardPool;
36
-
37
19
  export type BorrowIncentivePoolPoints = {
38
20
  symbol: string;
39
21
  coinName: SupportBorrowIncentiveRewardCoins;
@@ -60,21 +42,6 @@ export type BorrowIncentivePool = {
60
42
  >;
61
43
  };
62
44
 
63
- // export type OriginBorrowIncentivePoolData = {
64
- // created_at: string;
65
- // distributed_point: string;
66
- // distributed_point_per_period: string;
67
- // index: string;
68
- // last_update: string;
69
- // max_distributed_point: string;
70
- // max_stakes: string;
71
- // point_distribution_time: string;
72
- // pool_type: {
73
- // name: string;
74
- // };
75
- // stakes: string;
76
- // };
77
-
78
45
  export type OriginBorrowIncentivePoolPointData = {
79
46
  point_type: {
80
47
  name: string;
@@ -112,18 +79,6 @@ export type ParsedBorrowIncentivePoolPointData = {
112
79
  lastUpdate: number;
113
80
  };
114
81
 
115
- // export type ParsedBorrowIncentivePoolData = {
116
- // poolType: string;
117
- // maxPoint: number;
118
- // distributedPoint: number;
119
- // pointPerPeriod: number;
120
- // period: number;
121
- // maxStake: number;
122
- // staked: number;
123
- // index: number;
124
- // createdAt: number;
125
- // lastUpdate: number;
126
- // };
127
82
  export type ParsedBorrowIncentivePoolData = {
128
83
  poolType: string;
129
84
  poolPoints: OptionalKeys<
@@ -154,54 +109,10 @@ export type CalculatedBorrowIncentivePoolPointData = {
154
109
  rewardPerSec: number;
155
110
  };
156
111
 
157
- // export type BorrowIncentiveRewardPool = CalculatedBorrowIncentiveRewardPoolData;
158
-
159
- // export type OriginBorrowIncentiveRewardPoolData = {
160
- // claimed_rewards: string;
161
- // exchange_rate_denominator: string;
162
- // exchange_rate_numerator: string;
163
- // remaining_reward: string;
164
- // reward_type: {
165
- // name: string;
166
- // };
167
- // };
168
-
169
- // export type ParsedBorrowIncentiveRewardPoolData = {
170
- // rewardType: string;
171
- // claimedRewards: number;
172
- // exchangeRateDenominator: number;
173
- // exchangeRateNumerator: number;
174
- // remainingRewards: number;
175
- // };
176
-
177
- // export type CalculatedBorrowIncentiveRewardPoolData = {
178
- // rewardApr: number;
179
- // totalRewardAmount: number;
180
- // totalRewardCoin: number;
181
- // totalRewardValue: number;
182
- // // remaindRewardAmount: number;
183
- // // remaindRewardCoin: number;
184
- // // remaindRewardValue: number;
185
- // // claimedRewardAmount: number;
186
- // // claimedRewardCoin: number;
187
- // // claimedRewardValue: number;
188
- // rewardPerSec: number;
189
- // };
190
-
191
112
  export type BorrowIncentiveAccounts = OptionalKeys<
192
113
  Record<SupportBorrowIncentiveCoins, ParsedBorrowIncentiveAccountData>
193
114
  >;
194
115
 
195
- // export type OriginBorrowIncentiveAccountData = {
196
- // amount: string;
197
- // index: string;
198
- // points: string;
199
- // pool_type: {
200
- // name: string;
201
- // };
202
- // total_points: string;
203
- // };
204
-
205
116
  export type OriginBorrowIncentiveAccountPoolData = {
206
117
  point_type: {
207
118
  name: string;
@@ -220,14 +131,6 @@ export type OriginBorrowIncentiveAccountData = {
220
131
  debt_amount: string;
221
132
  };
222
133
 
223
- // export type ParsedBorrowIncentiveAccountData = {
224
- // poolType: string;
225
- // amount: number;
226
- // index: number;
227
- // points: number;
228
- // totalPoints: number;
229
- // };
230
-
231
134
  export type ParsedBorrowIncentiveAccountPoolData = {
232
135
  pointType: string;
233
136
  weightedAmount: number;
@@ -250,11 +153,6 @@ export type ParsedBorrowIncentiveAccountData = {
250
153
  /**
251
154
  * The query interface for `incentive_pools_query::incentive_pools_data` inspectTxn.
252
155
  */
253
- // export interface BorrowIncentivePoolsQueryInterface {
254
- // incentive_pools: OriginBorrowIncentivePoolData[];
255
- // reward_pool: OriginBorrowIncentiveRewardPoolData;
256
- // }
257
-
258
156
  export interface BorrowIncentivePoolsQueryInterface {
259
157
  incentive_pools: OriginBorrowIncentivePoolData[];
260
158
  }
@@ -262,11 +160,6 @@ export interface BorrowIncentivePoolsQueryInterface {
262
160
  /**
263
161
  * The query interface for `incentive_account_query::incentive_account_data` inspectTxn.
264
162
  */
265
- // export interface BorrowIncentiveAccountsQueryInterface {
266
- // incentive_states: OriginBorrowIncentiveAccountData[];
267
- // total_points: string;
268
- // }
269
-
270
163
  export interface BorrowIncentiveAccountsQueryInterface {
271
164
  pool_records: OriginBorrowIncentiveAccountData[];
272
165
  }
@@ -1,7 +1,8 @@
1
1
  export type Vesca = {
2
2
  id: string;
3
3
  keyId: string;
4
- lockedScaAmount: number;
4
+ lockedScaAmount: string;
5
5
  lockedScaCoin: number;
6
+ currentVeScaBalance: number;
6
7
  unlockAt: number;
7
8
  };