@scallop-io/sui-scallop-sdk 1.3.4-alpha.3 → 1.3.4-alpha.5

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 (127) hide show
  1. package/dist/builders/borrowIncentiveBuilder.d.ts +12 -0
  2. package/dist/builders/coreBuilder.d.ts +12 -0
  3. package/dist/builders/index.d.ts +12 -0
  4. package/dist/builders/loyaltyProgramBuilder.d.ts +12 -0
  5. package/dist/builders/oracle.d.ts +14 -0
  6. package/dist/builders/referralBuilder.d.ts +12 -0
  7. package/dist/builders/sCoinBuilder.d.ts +4 -0
  8. package/dist/builders/spoolBuilder.d.ts +12 -0
  9. package/dist/builders/vescaBuilder.d.ts +25 -0
  10. package/dist/constants/cache.d.ts +14 -0
  11. package/dist/constants/coinGecko.d.ts +2 -0
  12. package/dist/constants/common.d.ts +20 -0
  13. package/dist/constants/enum.d.ts +14 -0
  14. package/dist/constants/flashloan.d.ts +2 -0
  15. package/dist/constants/index.d.ts +12 -0
  16. package/dist/constants/poolAddress.d.ts +5 -0
  17. package/dist/constants/pyth.d.ts +5 -0
  18. package/dist/constants/queryKeys.d.ts +56 -0
  19. package/dist/constants/rpc.d.ts +1 -0
  20. package/dist/constants/testAddress.d.ts +2 -0
  21. package/dist/constants/tokenBucket.d.ts +2 -0
  22. package/dist/constants/vesca.d.ts +5 -0
  23. package/dist/index.d.ts +3 -0
  24. package/dist/index.js +1462 -1464
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +1461 -1464
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/models/index.d.ts +8 -0
  29. package/dist/models/scallop.d.ts +74 -0
  30. package/dist/models/scallopAddress.d.ts +150 -0
  31. package/dist/models/scallopBuilder.d.ts +89 -0
  32. package/dist/models/scallopCache.d.ts +74 -0
  33. package/dist/models/scallopClient.d.ts +321 -0
  34. package/dist/models/scallopIndexer.d.ts +89 -0
  35. package/dist/models/scallopQuery.d.ts +489 -0
  36. package/dist/models/scallopUtils.d.ts +227 -0
  37. package/dist/models/suiKit.d.ts +2 -0
  38. package/dist/queries/borrowIncentiveQuery.d.ts +61 -0
  39. package/dist/queries/coreQuery.d.ts +167 -0
  40. package/dist/queries/index.d.ts +11 -0
  41. package/dist/queries/isolatedAssetQuery.d.ts +14 -0
  42. package/dist/queries/loyaltyProgramQuery.d.ts +10 -0
  43. package/dist/queries/portfolioQuery.d.ts +73 -0
  44. package/dist/queries/priceQuery.d.ts +16 -0
  45. package/dist/queries/referralQuery.d.ts +7 -0
  46. package/dist/queries/sCoinQuery.d.ts +41 -0
  47. package/dist/queries/spoolQuery.d.ts +70 -0
  48. package/dist/queries/supplyLimitQuery.d.ts +9 -0
  49. package/dist/queries/vescaQuery.d.ts +36 -0
  50. package/dist/test.d.ts +0 -0
  51. package/dist/types/address.d.ts +107 -0
  52. package/dist/types/builder/borrowIncentive.d.ts +35 -0
  53. package/dist/types/builder/core.d.ts +56 -0
  54. package/dist/types/builder/index.d.ts +25 -0
  55. package/dist/types/builder/loyaltyProgram.d.ts +23 -0
  56. package/dist/types/builder/referral.d.ts +30 -0
  57. package/dist/types/builder/sCoin.d.ts +37 -0
  58. package/dist/types/builder/spool.d.ts +29 -0
  59. package/dist/types/builder/vesca.d.ts +51 -0
  60. package/dist/types/constant/common.d.ts +24 -0
  61. package/dist/types/constant/enum.d.ts +48 -0
  62. package/dist/types/constant/index.d.ts +2 -0
  63. package/dist/types/index.d.ts +6 -0
  64. package/dist/types/model.d.ts +54 -0
  65. package/dist/types/query/borrowIncentive.d.ts +124 -0
  66. package/dist/types/query/core.d.ts +361 -0
  67. package/dist/types/query/index.d.ts +7 -0
  68. package/dist/types/query/loyaltyProgram.d.ts +5 -0
  69. package/dist/types/query/portfolio.d.ts +115 -0
  70. package/dist/types/query/sCoin.d.ts +1 -0
  71. package/dist/types/query/spool.d.ts +122 -0
  72. package/dist/types/query/vesca.d.ts +26 -0
  73. package/dist/types/utils.d.ts +21 -0
  74. package/dist/utils/builder.d.ts +15 -0
  75. package/dist/utils/index.d.ts +5 -0
  76. package/dist/utils/indexer.d.ts +17 -0
  77. package/dist/utils/query.d.ts +62 -0
  78. package/dist/utils/tokenBucket.d.ts +11 -0
  79. package/dist/utils/util.d.ts +26 -0
  80. package/package.json +2 -2
  81. package/src/builders/borrowIncentiveBuilder.ts +8 -8
  82. package/src/builders/coreBuilder.ts +5 -5
  83. package/src/builders/index.ts +2 -2
  84. package/src/builders/oracle.ts +4 -4
  85. package/src/builders/referralBuilder.ts +1 -1
  86. package/src/builders/spoolBuilder.ts +6 -6
  87. package/src/builders/vescaBuilder.ts +4 -4
  88. package/src/constants/coinGecko.ts +1 -1
  89. package/src/constants/enum.ts +1 -1
  90. package/src/constants/index.ts +1 -0
  91. package/src/models/scallop.ts +5 -5
  92. package/src/models/scallopAddress.ts +9 -6
  93. package/src/models/scallopBuilder.ts +4 -5
  94. package/src/models/scallopCache.ts +4 -4
  95. package/src/models/scallopClient.ts +4 -4
  96. package/src/models/scallopIndexer.ts +3 -4
  97. package/src/models/scallopQuery.ts +13 -6
  98. package/src/models/scallopUtils.ts +11 -8
  99. package/src/models/suiKit.ts +1 -1
  100. package/src/queries/borrowIncentiveQuery.ts +5 -5
  101. package/src/queries/coreQuery.ts +5 -5
  102. package/src/queries/index.ts +8 -5
  103. package/src/queries/portfolioQuery.ts +4 -4
  104. package/src/queries/priceQuery.ts +2 -2
  105. package/src/queries/spoolQuery.ts +5 -5
  106. package/src/queries/vescaQuery.ts +2 -2
  107. package/src/test.ts +30 -0
  108. package/src/types/address.ts +1 -1
  109. package/src/types/builder/borrowIncentive.ts +3 -3
  110. package/src/types/builder/core.ts +3 -3
  111. package/src/types/builder/index.ts +5 -4
  112. package/src/types/builder/referral.ts +1 -1
  113. package/src/types/builder/sCoin.ts +1 -1
  114. package/src/types/builder/spool.ts +2 -2
  115. package/src/types/constant/common.ts +1 -1
  116. package/src/types/model.ts +2 -2
  117. package/src/types/query/borrowIncentive.ts +2 -2
  118. package/src/types/query/core.ts +1 -1
  119. package/src/types/query/portfolio.ts +2 -2
  120. package/src/types/query/spool.ts +1 -1
  121. package/src/utils/builder.ts +1 -1
  122. package/src/utils/index.ts +2 -2
  123. package/src/utils/query.ts +3 -3
  124. package/src/utils/tokenBucket.ts +1 -1
  125. package/src/utils/util.ts +4 -4
  126. /package/src/queries/{isolatedAsset.ts → isolatedAssetQuery.ts} +0 -0
  127. /package/src/queries/{supplyLimit.ts → supplyLimitQuery.ts} +0 -0
@@ -0,0 +1,124 @@
1
+ import { SupportBorrowIncentiveCoins, SupportBorrowIncentiveRewardCoins } from 'src/types';
2
+ export interface BorrowIncentiveAccountKey {
3
+ id: string;
4
+ onwerId: string;
5
+ }
6
+ type OptionalKeys<T> = {
7
+ [K in keyof T]?: T[K];
8
+ };
9
+ export type BorrowIncentivePools = OptionalKeys<Record<SupportBorrowIncentiveCoins, BorrowIncentivePool>>;
10
+ export type BorrowIncentivePoolPoints = {
11
+ symbol: string;
12
+ coinName: SupportBorrowIncentiveRewardCoins;
13
+ coinType: string;
14
+ coinDecimal: number;
15
+ coinPrice: number;
16
+ } & Required<Pick<ParsedBorrowIncentivePoolPointData, 'points' | 'distributedPoint' | 'weightedAmount'>> & CalculatedBorrowIncentivePoolPointData;
17
+ export type BorrowIncentivePool = {
18
+ coinName: SupportBorrowIncentiveCoins;
19
+ symbol: string;
20
+ coinType: string;
21
+ coinDecimal: number;
22
+ coinPrice: number;
23
+ stakedAmount: number;
24
+ stakedCoin: number;
25
+ stakedValue: number;
26
+ points: OptionalKeys<Record<SupportBorrowIncentiveRewardCoins, BorrowIncentivePoolPoints>>;
27
+ };
28
+ export type OriginBorrowIncentivePoolPointData = {
29
+ point_type: {
30
+ name: string;
31
+ };
32
+ distributed_point_per_period: string;
33
+ point_distribution_time: string;
34
+ distributed_point: string;
35
+ points: string;
36
+ index: string;
37
+ base_weight: string;
38
+ weighted_amount: string;
39
+ last_update: string;
40
+ created_at: string;
41
+ };
42
+ export type OriginBorrowIncentivePoolData = {
43
+ pool_type: {
44
+ name: string;
45
+ };
46
+ points: OriginBorrowIncentivePoolPointData[];
47
+ min_stakes: string;
48
+ max_stakes: string;
49
+ stakes: string;
50
+ created_at: string;
51
+ };
52
+ export type ParsedBorrowIncentivePoolPointData = {
53
+ pointType: string;
54
+ distributedPointPerPeriod: number;
55
+ period: number;
56
+ distributedPoint: number;
57
+ points: number;
58
+ index: number;
59
+ baseWeight: number;
60
+ weightedAmount: number;
61
+ lastUpdate: number;
62
+ createdAt: number;
63
+ };
64
+ export type ParsedBorrowIncentivePoolData = {
65
+ poolType: string;
66
+ poolPoints: OptionalKeys<Record<SupportBorrowIncentiveRewardCoins, ParsedBorrowIncentivePoolPointData>>;
67
+ minStakes: number;
68
+ maxStakes: number;
69
+ staked: number;
70
+ };
71
+ export type CalculatedBorrowIncentivePoolPointData = {
72
+ baseWeight: number;
73
+ weightedStakedAmount: number;
74
+ weightedStakedCoin: number;
75
+ weightedStakedValue: number;
76
+ distributedPointPerSec: number;
77
+ accumulatedPoints: number;
78
+ currentPointIndex: number;
79
+ currentTotalDistributedPoint: number;
80
+ rewardApr: number;
81
+ rewardPerSec: number;
82
+ };
83
+ export type BorrowIncentiveAccounts = OptionalKeys<Record<SupportBorrowIncentiveCoins, ParsedBorrowIncentiveAccountData>>;
84
+ export type OriginBorrowIncentiveAccountPoolData = {
85
+ point_type: {
86
+ name: string;
87
+ };
88
+ weighted_amount: string;
89
+ points: string;
90
+ total_points: string;
91
+ index: string;
92
+ };
93
+ export type OriginBorrowIncentiveAccountData = {
94
+ points_list: OriginBorrowIncentiveAccountPoolData[];
95
+ pool_type: {
96
+ name: string;
97
+ };
98
+ debt_amount: string;
99
+ };
100
+ export type ParsedBorrowIncentiveAccountPoolData = {
101
+ pointType: string;
102
+ weightedAmount: number;
103
+ points: number;
104
+ totalPoints: number;
105
+ index: number;
106
+ };
107
+ export type ParsedBorrowIncentiveAccountData = {
108
+ pointList: OptionalKeys<Record<SupportBorrowIncentiveRewardCoins, ParsedBorrowIncentiveAccountPoolData>>;
109
+ poolType: string;
110
+ debtAmount: number;
111
+ };
112
+ /**
113
+ * The query interface for `incentive_pools_query::incentive_pools_data` inspectTxn.
114
+ */
115
+ export interface BorrowIncentivePoolsQueryInterface {
116
+ incentive_pools: OriginBorrowIncentivePoolData[];
117
+ }
118
+ /**
119
+ * The query interface for `incentive_account_query::incentive_account_data` inspectTxn.
120
+ */
121
+ export interface BorrowIncentiveAccountsQueryInterface {
122
+ pool_records: OriginBorrowIncentiveAccountData[];
123
+ }
124
+ export {};
@@ -0,0 +1,361 @@
1
+ import type { SupportPoolCoins, SupportCollateralCoins, SupportMarketCoins, CoinWrappedType, SupportSCoin } from 'src/types';
2
+ type OptionalKeys<T> = {
3
+ [K in keyof T]?: T[K];
4
+ };
5
+ export type MarketPools = OptionalKeys<Record<SupportPoolCoins, MarketPool>>;
6
+ export type MarketCollaterals = OptionalKeys<Record<SupportCollateralCoins, MarketCollateral>>;
7
+ export type CoinAmounts = OptionalKeys<Record<SupportPoolCoins, number>>;
8
+ export type MarketCoinAmounts = OptionalKeys<Record<SupportMarketCoins, number>>;
9
+ export type SCoinAmounts = OptionalKeys<Record<SupportSCoin, number>>;
10
+ export type BalanceSheet = {
11
+ cash: string;
12
+ debt: string;
13
+ market_coin_supply: string;
14
+ revenue: string;
15
+ };
16
+ export type BorrowIndex = {
17
+ borrow_index: string;
18
+ interest_rate: {
19
+ fields: {
20
+ value: string;
21
+ };
22
+ };
23
+ interest_rate_scale: string;
24
+ last_updated: string;
25
+ };
26
+ export type InterestModel = {
27
+ base_borrow_rate_per_sec: {
28
+ fields: {
29
+ value: string;
30
+ };
31
+ };
32
+ borrow_rate_on_high_kink: {
33
+ fields: {
34
+ value: string;
35
+ };
36
+ };
37
+ borrow_rate_on_mid_kink: {
38
+ fields: {
39
+ value: string;
40
+ };
41
+ };
42
+ borrow_weight: {
43
+ fields: {
44
+ value: string;
45
+ };
46
+ };
47
+ borrow_fee_rate: {
48
+ fields: {
49
+ value: string;
50
+ };
51
+ };
52
+ high_kink: {
53
+ fields: {
54
+ value: string;
55
+ };
56
+ };
57
+ interest_rate_scale: string;
58
+ max_borrow_rate: {
59
+ fields: {
60
+ value: string;
61
+ };
62
+ };
63
+ mid_kink: {
64
+ fields: {
65
+ value: string;
66
+ };
67
+ };
68
+ min_borrow_amount: string;
69
+ revenue_factor: {
70
+ fields: {
71
+ value: string;
72
+ };
73
+ };
74
+ type: {
75
+ fields: {
76
+ name: string;
77
+ };
78
+ };
79
+ };
80
+ export type RiskModel = {
81
+ collateral_factor: {
82
+ fields: {
83
+ value: string;
84
+ };
85
+ };
86
+ liquidation_discount: {
87
+ fields: {
88
+ value: string;
89
+ };
90
+ };
91
+ liquidation_factor: {
92
+ fields: {
93
+ value: string;
94
+ };
95
+ };
96
+ liquidation_penalty: {
97
+ fields: {
98
+ value: string;
99
+ };
100
+ };
101
+ liquidation_revenue_factor: {
102
+ fields: {
103
+ value: string;
104
+ };
105
+ };
106
+ max_collateral_amount: string;
107
+ type: {
108
+ fields: {
109
+ name: string;
110
+ };
111
+ };
112
+ };
113
+ export type CollateralStat = {
114
+ amount: string;
115
+ };
116
+ export type MarketPool = {
117
+ coinName: SupportPoolCoins;
118
+ symbol: string;
119
+ coinType: string;
120
+ marketCoinType: string;
121
+ sCoinType: string;
122
+ coinWrappedType: CoinWrappedType;
123
+ coinDecimal: number;
124
+ coinPrice: number;
125
+ maxSupplyCoin: number;
126
+ isIsolated: boolean;
127
+ } & Required<Pick<ParsedMarketPoolData, 'highKink' | 'midKink' | 'reserveFactor' | 'borrowWeight' | 'borrowFee' | 'marketCoinSupplyAmount' | 'minBorrowAmount'>> & CalculatedMarketPoolData;
128
+ export type MarketCollateral = {
129
+ coinName: SupportCollateralCoins;
130
+ symbol: string;
131
+ coinType: string;
132
+ marketCoinType: string;
133
+ coinWrappedType: CoinWrappedType;
134
+ coinDecimal: number;
135
+ coinPrice: number;
136
+ } & Required<Pick<ParsedMarketCollateralData, 'collateralFactor' | 'liquidationFactor' | 'liquidationDiscount' | 'liquidationPanelty' | 'liquidationReserveFactor'>> & CalculatedMarketCollateralData;
137
+ export type OriginMarketPoolData = {
138
+ type: {
139
+ name: string;
140
+ };
141
+ maxBorrowRate: {
142
+ value: string;
143
+ };
144
+ interestRate: {
145
+ value: string;
146
+ };
147
+ interestRateScale: string;
148
+ borrowIndex: string;
149
+ lastUpdated: string;
150
+ cash: string;
151
+ debt: string;
152
+ marketCoinSupply: string;
153
+ reserve: string;
154
+ reserveFactor: {
155
+ value: string;
156
+ };
157
+ borrowWeight: {
158
+ value: string;
159
+ };
160
+ borrowFeeRate: {
161
+ value: string;
162
+ };
163
+ baseBorrowRatePerSec: {
164
+ value: string;
165
+ };
166
+ borrowRateOnHighKink: {
167
+ value: string;
168
+ };
169
+ borrowRateOnMidKink: {
170
+ value: string;
171
+ };
172
+ highKink: {
173
+ value: string;
174
+ };
175
+ midKink: {
176
+ value: string;
177
+ };
178
+ minBorrowAmount: string;
179
+ };
180
+ export type ParsedMarketPoolData = {
181
+ coinType: string;
182
+ maxBorrowRate: number;
183
+ borrowRate: number;
184
+ borrowRateScale: number;
185
+ borrowIndex: number;
186
+ lastUpdated: number;
187
+ cashAmount: number;
188
+ debtAmount: number;
189
+ marketCoinSupplyAmount: number;
190
+ reserveAmount: number;
191
+ reserveFactor: number;
192
+ borrowWeight: number;
193
+ borrowFee: number;
194
+ baseBorrowRate: number;
195
+ borrowRateOnHighKink: number;
196
+ borrowRateOnMidKink: number;
197
+ highKink: number;
198
+ midKink: number;
199
+ minBorrowAmount: number;
200
+ };
201
+ export type CalculatedMarketPoolData = {
202
+ baseBorrowApr: number;
203
+ baseBorrowApy: number;
204
+ borrowAprOnHighKink: number;
205
+ borrowApyOnHighKink: number;
206
+ borrowAprOnMidKink: number;
207
+ borrowApyOnMidKink: number;
208
+ maxBorrowApr: number;
209
+ maxBorrowApy: number;
210
+ borrowApr: number;
211
+ borrowApy: number;
212
+ borrowIndex: number;
213
+ growthInterest: number;
214
+ supplyAmount: number;
215
+ supplyCoin: number;
216
+ borrowAmount: number;
217
+ borrowCoin: number;
218
+ reserveAmount: number;
219
+ reserveCoin: number;
220
+ utilizationRate: number;
221
+ supplyApr: number;
222
+ supplyApy: number;
223
+ conversionRate: number;
224
+ };
225
+ export type OriginMarketCollateralData = {
226
+ type: {
227
+ name: string;
228
+ };
229
+ collateralFactor: {
230
+ value: string;
231
+ };
232
+ liquidationFactor: {
233
+ value: string;
234
+ };
235
+ liquidationDiscount: {
236
+ value: string;
237
+ };
238
+ liquidationPanelty: {
239
+ value: string;
240
+ };
241
+ liquidationReserveFactor: {
242
+ value: string;
243
+ };
244
+ maxCollateralAmount: string;
245
+ totalCollateralAmount: string;
246
+ };
247
+ export type ParsedMarketCollateralData = {
248
+ coinType: string;
249
+ collateralFactor: number;
250
+ liquidationFactor: number;
251
+ liquidationDiscount: number;
252
+ liquidationPanelty: number;
253
+ liquidationReserveFactor: number;
254
+ maxCollateralAmount: number;
255
+ totalCollateralAmount: number;
256
+ };
257
+ export type CalculatedMarketCollateralData = {
258
+ maxDepositAmount: number;
259
+ maxDepositCoin: number;
260
+ depositAmount: number;
261
+ depositCoin: number;
262
+ };
263
+ export type Market = {
264
+ pools: MarketPools;
265
+ collaterals: MarketCollaterals;
266
+ data?: MarketQueryInterface;
267
+ };
268
+ export type Obligation = {
269
+ id: string;
270
+ keyId: string;
271
+ locked: boolean;
272
+ };
273
+ /**
274
+ * The query interface for `market_query::market_data` inspectTxn.
275
+ */
276
+ export interface MarketQueryInterface {
277
+ collaterals: {
278
+ collateralFactor: {
279
+ value: string;
280
+ };
281
+ liquidationDiscount: {
282
+ value: string;
283
+ };
284
+ liquidationFactor: {
285
+ value: string;
286
+ };
287
+ liquidationPanelty: {
288
+ value: string;
289
+ };
290
+ liquidationReserveFactor: {
291
+ value: string;
292
+ };
293
+ maxCollateralAmount: string;
294
+ totalCollateralAmount: string;
295
+ type: {
296
+ name: string;
297
+ };
298
+ }[];
299
+ pools: {
300
+ baseBorrowRatePerSec: {
301
+ value: string;
302
+ };
303
+ borrowRateOnHighKink: {
304
+ value: string;
305
+ };
306
+ borrowRateOnMidKink: {
307
+ value: string;
308
+ };
309
+ maxBorrowRate: {
310
+ value: string;
311
+ };
312
+ highKink: {
313
+ value: string;
314
+ };
315
+ midKink: {
316
+ value: string;
317
+ };
318
+ interestRate: {
319
+ value: string;
320
+ };
321
+ interestRateScale: string;
322
+ borrowIndex: string;
323
+ lastUpdated: string;
324
+ cash: string;
325
+ debt: string;
326
+ marketCoinSupply: string;
327
+ minBorrowAmount: string;
328
+ reserve: string;
329
+ reserveFactor: {
330
+ value: string;
331
+ };
332
+ borrowWeight: {
333
+ value: string;
334
+ };
335
+ borrowFeeRate: {
336
+ value: string;
337
+ };
338
+ type: {
339
+ name: string;
340
+ };
341
+ }[];
342
+ }
343
+ /**
344
+ * The query interface for `obligation_query::obligation_data` inspectTxn.
345
+ */
346
+ export interface ObligationQueryInterface {
347
+ collaterals: {
348
+ type: {
349
+ name: string;
350
+ };
351
+ amount: string;
352
+ }[];
353
+ debts: {
354
+ type: {
355
+ name: string;
356
+ };
357
+ amount: string;
358
+ borrowIndex: string;
359
+ }[];
360
+ }
361
+ export {};
@@ -0,0 +1,7 @@
1
+ export type * from './borrowIncentive';
2
+ export type * from './core';
3
+ export type * from './loyaltyProgram';
4
+ export type * from './portfolio';
5
+ export type * from './sCoin';
6
+ export type * from './spool';
7
+ export type * from './vesca';
@@ -0,0 +1,5 @@
1
+ export type LoyaltyProgramInfo = {
2
+ pendingReward: number;
3
+ totalPoolReward: number;
4
+ isClaimEnabled: boolean;
5
+ };
@@ -0,0 +1,115 @@
1
+ import type { MarketPool } from './core';
2
+ import type { Spool } from './spool';
3
+ import { SupportPoolCoins, SupportCollateralCoins, SupportBorrowIncentiveRewardCoins } from 'src/types';
4
+ type OptionalKeys<T> = {
5
+ [K in keyof T]?: T[K];
6
+ };
7
+ export type Lendings = OptionalKeys<Record<SupportPoolCoins, Lending>>;
8
+ export type ObligationAccounts = OptionalKeys<Record<string, ObligationAccount>>;
9
+ export type Lending = Required<Pick<MarketPool, 'coinName' | 'symbol' | 'coinType' | 'marketCoinType' | 'sCoinType' | 'coinDecimal' | 'coinPrice' | 'conversionRate' | 'isIsolated'> & Pick<Spool, 'marketCoinPrice'>> & {
10
+ supplyApr: number;
11
+ supplyApy: number;
12
+ rewardApr: number;
13
+ suppliedAmount: number;
14
+ suppliedCoin: number;
15
+ suppliedValue: number;
16
+ stakedMarketAmount: number;
17
+ stakedMarketCoin: number;
18
+ stakedAmount: number;
19
+ stakedCoin: number;
20
+ stakedValue: number;
21
+ unstakedMarketAmount: number;
22
+ unstakedMarketCoin: number;
23
+ unstakedAmount: number;
24
+ unstakedCoin: number;
25
+ unstakedValue: number;
26
+ availableSupplyAmount: number;
27
+ availableSupplyCoin: number;
28
+ availableWithdrawAmount: number;
29
+ availableWithdrawCoin: number;
30
+ availableStakeAmount: number;
31
+ availableStakeCoin: number;
32
+ availableUnstakeAmount: number;
33
+ availableUnstakeCoin: number;
34
+ availableClaimAmount: number;
35
+ availableClaimCoin: number;
36
+ };
37
+ export type ObligationAccount = {
38
+ obligationId: string;
39
+ totalDepositedValue: number;
40
+ totalBorrowedValue: number;
41
+ totalBalanceValue: number;
42
+ totalBorrowCapacityValue: number;
43
+ totalAvailableCollateralValue: number;
44
+ totalBorrowedValueWithWeight: number;
45
+ totalRequiredCollateralValue: number;
46
+ totalUnhealthyCollateralValue: number;
47
+ totalRiskLevel: number;
48
+ totalDepositedPools: number;
49
+ totalBorrowedPools: number;
50
+ totalRewardedPools: number;
51
+ collaterals: OptionalKeys<Record<SupportCollateralCoins, ObligationCollateral>>;
52
+ debts: OptionalKeys<Record<SupportPoolCoins, ObligationDebt>>;
53
+ borrowIncentives: OptionalKeys<Record<SupportPoolCoins, ObligationBorrowIncentive>>;
54
+ };
55
+ export type ObligationCollateral = {
56
+ coinName: SupportCollateralCoins;
57
+ coinType: string;
58
+ symbol: string;
59
+ coinDecimal: number;
60
+ coinPrice: number;
61
+ depositedAmount: number;
62
+ depositedCoin: number;
63
+ depositedValue: number;
64
+ borrowCapacityValue: number;
65
+ requiredCollateralValue: number;
66
+ availableDepositAmount: number;
67
+ availableDepositCoin: number;
68
+ availableWithdrawAmount: number;
69
+ availableWithdrawCoin: number;
70
+ };
71
+ export type ObligationDebt = {
72
+ coinName: SupportPoolCoins;
73
+ coinType: string;
74
+ symbol: string;
75
+ coinDecimal: number;
76
+ coinPrice: number;
77
+ borrowedAmount: number;
78
+ borrowedCoin: number;
79
+ borrowedValue: number;
80
+ borrowedValueWithWeight: number;
81
+ borrowIndex: number;
82
+ requiredRepayAmount: number;
83
+ requiredRepayCoin: number;
84
+ availableBorrowAmount: number;
85
+ availableBorrowCoin: number;
86
+ availableRepayAmount: number;
87
+ availableRepayCoin: number;
88
+ };
89
+ export type ObligationBorrowIcentiveReward = {
90
+ coinName: SupportBorrowIncentiveRewardCoins;
91
+ coinType: string;
92
+ symbol: string;
93
+ coinDecimal: number;
94
+ coinPrice: number;
95
+ availableClaimCoin: number;
96
+ availableClaimAmount: number;
97
+ boostValue: number;
98
+ };
99
+ export type ObligationBorrowIncentive = {
100
+ coinName: SupportPoolCoins;
101
+ coinType: string;
102
+ symbol: string;
103
+ coinDecimal: number;
104
+ coinPrice: number;
105
+ rewards: ObligationBorrowIcentiveReward[];
106
+ };
107
+ export type TotalValueLocked = {
108
+ supplyValue: number;
109
+ borrowValue: number;
110
+ totalValue: number;
111
+ supplyValueChangeRatio?: number;
112
+ borrowValueChangeRatio?: number;
113
+ totalValueChangeRatio?: number;
114
+ };
115
+ export {};
@@ -0,0 +1 @@
1
+ export type sCoinBalance = number;