@scallop-io/sui-scallop-sdk 1.5.0-alpha.1 → 1.5.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.
- package/dist/index.d.mts +3161 -0
- package/dist/index.d.ts +3161 -3
- package/dist/index.js +78 -9966
- package/dist/index.mjs +15 -9892
- package/package.json +5 -6
- package/src/builders/coreBuilder.ts +10 -14
- package/src/builders/oracle.ts +10 -2
- package/src/constants/coinGecko.ts +14 -4
- package/src/constants/common.ts +8 -1
- package/src/constants/enum.ts +28 -57
- package/src/constants/poolAddress.ts +294 -344
- package/src/constants/pyth.ts +4 -1
- package/src/constants/testAddress.ts +487 -61
- package/src/constants/xoracle.ts +18 -16
- package/src/models/scallopAddress.ts +54 -0
- package/src/models/scallopQuery.ts +8 -12
- package/src/queries/coreQuery.ts +4 -4
- package/src/queries/poolAddressesQuery.ts +2 -2
- package/src/queries/portfolioQuery.ts +7 -8
- package/src/queries/xOracleQuery.ts +15 -7
- package/src/types/address.ts +5 -0
- package/src/types/model.ts +1 -0
- package/src/utils/util.ts +8 -3
- package/dist/builders/borrowIncentiveBuilder.d.ts +0 -12
- package/dist/builders/coreBuilder.d.ts +0 -12
- package/dist/builders/index.d.ts +0 -12
- package/dist/builders/loyaltyProgramBuilder.d.ts +0 -12
- package/dist/builders/oracle.d.ts +0 -14
- package/dist/builders/referralBuilder.d.ts +0 -12
- package/dist/builders/sCoinBuilder.d.ts +0 -4
- package/dist/builders/spoolBuilder.d.ts +0 -12
- package/dist/builders/vescaBuilder.d.ts +0 -25
- package/dist/constants/cache.d.ts +0 -14
- package/dist/constants/coinGecko.d.ts +0 -2
- package/dist/constants/common.d.ts +0 -20
- package/dist/constants/enum.d.ts +0 -14
- package/dist/constants/flashloan.d.ts +0 -2
- package/dist/constants/index.d.ts +0 -13
- package/dist/constants/poolAddress.d.ts +0 -27
- package/dist/constants/pyth.d.ts +0 -5
- package/dist/constants/queryKeys.d.ts +0 -54
- package/dist/constants/rpc.d.ts +0 -1
- package/dist/constants/testAddress.d.ts +0 -2
- package/dist/constants/vesca.d.ts +0 -5
- package/dist/constants/xoracle.d.ts +0 -2
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/models/index.d.ts +0 -8
- package/dist/models/scallop.d.ts +0 -73
- package/dist/models/scallopAddress.d.ts +0 -150
- package/dist/models/scallopBuilder.d.ts +0 -90
- package/dist/models/scallopCache.d.ts +0 -81
- package/dist/models/scallopClient.d.ts +0 -321
- package/dist/models/scallopIndexer.d.ts +0 -90
- package/dist/models/scallopPrice.d.ts +0 -0
- package/dist/models/scallopQuery.d.ts +0 -704
- package/dist/models/scallopUtils.d.ts +0 -229
- package/dist/models/suiKit.d.ts +0 -2
- package/dist/queries/borrowIncentiveQuery.d.ts +0 -82
- package/dist/queries/borrowLimitQuery.d.ts +0 -9
- package/dist/queries/coreQuery.d.ts +0 -171
- package/dist/queries/index.d.ts +0 -15
- package/dist/queries/isolatedAssetQuery.d.ts +0 -14
- package/dist/queries/loyaltyProgramQuery.d.ts +0 -10
- package/dist/queries/objectsQuery.d.ts +0 -2
- package/dist/queries/poolAddressesQuery.d.ts +0 -29
- package/dist/queries/portfolioQuery.d.ts +0 -143
- package/dist/queries/priceQuery.d.ts +0 -58
- package/dist/queries/referralQuery.d.ts +0 -7
- package/dist/queries/sCoinQuery.d.ts +0 -41
- package/dist/queries/spoolQuery.d.ts +0 -74
- package/dist/queries/supplyLimitQuery.d.ts +0 -9
- package/dist/queries/vescaQuery.d.ts +0 -36
- package/dist/queries/xOracleQuery.d.ts +0 -13
- package/dist/types/address.d.ts +0 -108
- package/dist/types/builder/borrowIncentive.d.ts +0 -35
- package/dist/types/builder/core.d.ts +0 -56
- package/dist/types/builder/index.d.ts +0 -24
- package/dist/types/builder/loyaltyProgram.d.ts +0 -23
- package/dist/types/builder/referral.d.ts +0 -30
- package/dist/types/builder/sCoin.d.ts +0 -37
- package/dist/types/builder/spool.d.ts +0 -29
- package/dist/types/builder/vesca.d.ts +0 -51
- package/dist/types/constant/common.d.ts +0 -24
- package/dist/types/constant/enum.d.ts +0 -48
- package/dist/types/constant/index.d.ts +0 -3
- package/dist/types/constant/xOracle.d.ts +0 -9
- package/dist/types/index.d.ts +0 -6
- package/dist/types/model.d.ts +0 -60
- package/dist/types/query/borrowIncentive.d.ts +0 -124
- package/dist/types/query/core.d.ts +0 -380
- package/dist/types/query/index.d.ts +0 -7
- package/dist/types/query/loyaltyProgram.d.ts +0 -5
- package/dist/types/query/portfolio.d.ts +0 -119
- package/dist/types/query/sCoin.d.ts +0 -1
- package/dist/types/query/spool.d.ts +0 -142
- package/dist/types/query/vesca.d.ts +0 -26
- package/dist/types/utils.d.ts +0 -22
- package/dist/utils/builder.d.ts +0 -15
- package/dist/utils/core.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/indexer.d.ts +0 -17
- package/dist/utils/query.d.ts +0 -62
- package/dist/utils/util.d.ts +0 -27
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
import type { SupportPoolCoins, SupportCollateralCoins, SupportMarketCoins, CoinWrappedType, SupportSCoin } from '../constant';
|
|
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 BorrowDynamic = {
|
|
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 BorrowFee = {
|
|
27
|
-
value: string;
|
|
28
|
-
};
|
|
29
|
-
export type InterestModel = {
|
|
30
|
-
base_borrow_rate_per_sec: {
|
|
31
|
-
fields: {
|
|
32
|
-
value: string;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
borrow_rate_on_high_kink: {
|
|
36
|
-
fields: {
|
|
37
|
-
value: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
borrow_rate_on_mid_kink: {
|
|
41
|
-
fields: {
|
|
42
|
-
value: string;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
borrow_weight: {
|
|
46
|
-
fields: {
|
|
47
|
-
value: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
borrow_fee_rate: {
|
|
51
|
-
fields: {
|
|
52
|
-
value: string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
high_kink: {
|
|
56
|
-
fields: {
|
|
57
|
-
value: string;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
interest_rate_scale: string;
|
|
61
|
-
max_borrow_rate: {
|
|
62
|
-
fields: {
|
|
63
|
-
value: string;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
mid_kink: {
|
|
67
|
-
fields: {
|
|
68
|
-
value: string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
min_borrow_amount: string;
|
|
72
|
-
revenue_factor: {
|
|
73
|
-
fields: {
|
|
74
|
-
value: string;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
type: {
|
|
78
|
-
fields: {
|
|
79
|
-
name: string;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
export type RiskModel = {
|
|
84
|
-
collateral_factor: {
|
|
85
|
-
fields: {
|
|
86
|
-
value: string;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
liquidation_discount: {
|
|
90
|
-
fields: {
|
|
91
|
-
value: string;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
liquidation_factor: {
|
|
95
|
-
fields: {
|
|
96
|
-
value: string;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
liquidation_penalty: {
|
|
100
|
-
fields: {
|
|
101
|
-
value: string;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
liquidation_revenue_factor: {
|
|
105
|
-
fields: {
|
|
106
|
-
value: string;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
max_collateral_amount: string;
|
|
110
|
-
type: {
|
|
111
|
-
fields: {
|
|
112
|
-
name: string;
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
export type CollateralStat = {
|
|
117
|
-
amount: string;
|
|
118
|
-
};
|
|
119
|
-
export type MarketPool = {
|
|
120
|
-
coinName: SupportPoolCoins;
|
|
121
|
-
symbol: string;
|
|
122
|
-
coinType: string;
|
|
123
|
-
marketCoinType: string;
|
|
124
|
-
sCoinType: string;
|
|
125
|
-
coinWrappedType: CoinWrappedType;
|
|
126
|
-
coinDecimal: number;
|
|
127
|
-
coinPrice: number;
|
|
128
|
-
maxSupplyCoin: number;
|
|
129
|
-
maxBorrowCoin: number;
|
|
130
|
-
isIsolated: boolean;
|
|
131
|
-
} & Required<Pick<ParsedMarketPoolData, 'highKink' | 'midKink' | 'reserveFactor' | 'borrowWeight' | 'borrowFee' | 'marketCoinSupplyAmount' | 'minBorrowAmount'>> & CalculatedMarketPoolData;
|
|
132
|
-
export type MarketCollateral = {
|
|
133
|
-
coinName: SupportCollateralCoins;
|
|
134
|
-
symbol: string;
|
|
135
|
-
coinType: string;
|
|
136
|
-
marketCoinType: string;
|
|
137
|
-
coinWrappedType: CoinWrappedType;
|
|
138
|
-
coinDecimal: number;
|
|
139
|
-
coinPrice: number;
|
|
140
|
-
isIsolated: boolean;
|
|
141
|
-
} & Required<Pick<ParsedMarketCollateralData, 'collateralFactor' | 'liquidationFactor' | 'liquidationDiscount' | 'liquidationPenalty' | 'liquidationReserveFactor'>> & CalculatedMarketCollateralData;
|
|
142
|
-
export type OriginMarketPoolData = {
|
|
143
|
-
type: {
|
|
144
|
-
name: string;
|
|
145
|
-
};
|
|
146
|
-
maxBorrowRate: {
|
|
147
|
-
value: string;
|
|
148
|
-
};
|
|
149
|
-
interestRate: {
|
|
150
|
-
value: string;
|
|
151
|
-
};
|
|
152
|
-
interestRateScale: string;
|
|
153
|
-
borrowIndex: string;
|
|
154
|
-
lastUpdated: string;
|
|
155
|
-
cash: string;
|
|
156
|
-
debt: string;
|
|
157
|
-
marketCoinSupply: string;
|
|
158
|
-
reserve: string;
|
|
159
|
-
reserveFactor: {
|
|
160
|
-
value: string;
|
|
161
|
-
};
|
|
162
|
-
borrowWeight: {
|
|
163
|
-
value: string;
|
|
164
|
-
};
|
|
165
|
-
borrowFeeRate: {
|
|
166
|
-
value: string;
|
|
167
|
-
};
|
|
168
|
-
baseBorrowRatePerSec: {
|
|
169
|
-
value: string;
|
|
170
|
-
};
|
|
171
|
-
borrowRateOnHighKink: {
|
|
172
|
-
value: string;
|
|
173
|
-
};
|
|
174
|
-
borrowRateOnMidKink: {
|
|
175
|
-
value: string;
|
|
176
|
-
};
|
|
177
|
-
highKink: {
|
|
178
|
-
value: string;
|
|
179
|
-
};
|
|
180
|
-
midKink: {
|
|
181
|
-
value: string;
|
|
182
|
-
};
|
|
183
|
-
minBorrowAmount: string;
|
|
184
|
-
isIsolated: boolean;
|
|
185
|
-
supplyLimit: string;
|
|
186
|
-
borrowLimit: string;
|
|
187
|
-
};
|
|
188
|
-
export type ParsedMarketPoolData = {
|
|
189
|
-
coinType: string;
|
|
190
|
-
maxBorrowRate: number;
|
|
191
|
-
borrowRate: number;
|
|
192
|
-
borrowRateScale: number;
|
|
193
|
-
borrowIndex: number;
|
|
194
|
-
lastUpdated: number;
|
|
195
|
-
cashAmount: number;
|
|
196
|
-
debtAmount: number;
|
|
197
|
-
marketCoinSupplyAmount: number;
|
|
198
|
-
reserveAmount: number;
|
|
199
|
-
reserveFactor: number;
|
|
200
|
-
borrowWeight: number;
|
|
201
|
-
borrowFee: number;
|
|
202
|
-
baseBorrowRate: number;
|
|
203
|
-
borrowRateOnHighKink: number;
|
|
204
|
-
borrowRateOnMidKink: number;
|
|
205
|
-
highKink: number;
|
|
206
|
-
midKink: number;
|
|
207
|
-
minBorrowAmount: number;
|
|
208
|
-
isIsolated: boolean;
|
|
209
|
-
supplyLimit: number;
|
|
210
|
-
borrowLimit: number;
|
|
211
|
-
};
|
|
212
|
-
export type CalculatedMarketPoolData = {
|
|
213
|
-
baseBorrowApr: number;
|
|
214
|
-
baseBorrowApy: number;
|
|
215
|
-
borrowAprOnHighKink: number;
|
|
216
|
-
borrowApyOnHighKink: number;
|
|
217
|
-
borrowAprOnMidKink: number;
|
|
218
|
-
borrowApyOnMidKink: number;
|
|
219
|
-
coinDecimal: number;
|
|
220
|
-
conversionRate: number;
|
|
221
|
-
maxBorrowApr: number;
|
|
222
|
-
maxBorrowApy: number;
|
|
223
|
-
borrowApr: number;
|
|
224
|
-
borrowApy: number;
|
|
225
|
-
borrowIndex: number;
|
|
226
|
-
growthInterest: number;
|
|
227
|
-
supplyAmount: number;
|
|
228
|
-
supplyCoin: number;
|
|
229
|
-
borrowAmount: number;
|
|
230
|
-
borrowCoin: number;
|
|
231
|
-
reserveAmount: number;
|
|
232
|
-
reserveCoin: number;
|
|
233
|
-
utilizationRate: number;
|
|
234
|
-
supplyApr: number;
|
|
235
|
-
supplyApy: number;
|
|
236
|
-
isIsolated: boolean;
|
|
237
|
-
maxSupplyCoin: number;
|
|
238
|
-
maxBorrowCoin: number;
|
|
239
|
-
};
|
|
240
|
-
export type OriginMarketCollateralData = {
|
|
241
|
-
type: {
|
|
242
|
-
name: string;
|
|
243
|
-
};
|
|
244
|
-
isIsolated: boolean;
|
|
245
|
-
collateralFactor: {
|
|
246
|
-
value: string;
|
|
247
|
-
};
|
|
248
|
-
liquidationFactor: {
|
|
249
|
-
value: string;
|
|
250
|
-
};
|
|
251
|
-
liquidationDiscount: {
|
|
252
|
-
value: string;
|
|
253
|
-
};
|
|
254
|
-
liquidationPenalty: {
|
|
255
|
-
value: string;
|
|
256
|
-
};
|
|
257
|
-
liquidationReserveFactor: {
|
|
258
|
-
value: string;
|
|
259
|
-
};
|
|
260
|
-
maxCollateralAmount: string;
|
|
261
|
-
totalCollateralAmount: string;
|
|
262
|
-
};
|
|
263
|
-
export type ParsedMarketCollateralData = {
|
|
264
|
-
coinType: string;
|
|
265
|
-
collateralFactor: number;
|
|
266
|
-
liquidationFactor: number;
|
|
267
|
-
liquidationDiscount: number;
|
|
268
|
-
liquidationPenalty: number;
|
|
269
|
-
liquidationReserveFactor: number;
|
|
270
|
-
maxCollateralAmount: number;
|
|
271
|
-
totalCollateralAmount: number;
|
|
272
|
-
isIsolated: boolean;
|
|
273
|
-
};
|
|
274
|
-
export type CalculatedMarketCollateralData = {
|
|
275
|
-
coinDecimal: number;
|
|
276
|
-
isIsolated: boolean;
|
|
277
|
-
maxDepositAmount: number;
|
|
278
|
-
maxDepositCoin: number;
|
|
279
|
-
depositAmount: number;
|
|
280
|
-
depositCoin: number;
|
|
281
|
-
};
|
|
282
|
-
export type Market = {
|
|
283
|
-
pools: MarketPools;
|
|
284
|
-
collaterals: MarketCollaterals;
|
|
285
|
-
data?: MarketQueryInterface;
|
|
286
|
-
};
|
|
287
|
-
export type Obligation = {
|
|
288
|
-
id: string;
|
|
289
|
-
keyId: string;
|
|
290
|
-
locked: boolean;
|
|
291
|
-
};
|
|
292
|
-
/**
|
|
293
|
-
* The query interface for `market_query::market_data` inspectTxn.
|
|
294
|
-
*/
|
|
295
|
-
export interface MarketQueryInterface {
|
|
296
|
-
collaterals: {
|
|
297
|
-
collateralFactor: {
|
|
298
|
-
value: string;
|
|
299
|
-
};
|
|
300
|
-
liquidationDiscount: {
|
|
301
|
-
value: string;
|
|
302
|
-
};
|
|
303
|
-
liquidationFactor: {
|
|
304
|
-
value: string;
|
|
305
|
-
};
|
|
306
|
-
liquidationPanelty: {
|
|
307
|
-
value: string;
|
|
308
|
-
};
|
|
309
|
-
liquidationReserveFactor: {
|
|
310
|
-
value: string;
|
|
311
|
-
};
|
|
312
|
-
maxCollateralAmount: string;
|
|
313
|
-
totalCollateralAmount: string;
|
|
314
|
-
type: {
|
|
315
|
-
name: string;
|
|
316
|
-
};
|
|
317
|
-
}[];
|
|
318
|
-
pools: {
|
|
319
|
-
baseBorrowRatePerSec: {
|
|
320
|
-
value: string;
|
|
321
|
-
};
|
|
322
|
-
borrowRateOnHighKink: {
|
|
323
|
-
value: string;
|
|
324
|
-
};
|
|
325
|
-
borrowRateOnMidKink: {
|
|
326
|
-
value: string;
|
|
327
|
-
};
|
|
328
|
-
maxBorrowRate: {
|
|
329
|
-
value: string;
|
|
330
|
-
};
|
|
331
|
-
highKink: {
|
|
332
|
-
value: string;
|
|
333
|
-
};
|
|
334
|
-
midKink: {
|
|
335
|
-
value: string;
|
|
336
|
-
};
|
|
337
|
-
interestRate: {
|
|
338
|
-
value: string;
|
|
339
|
-
};
|
|
340
|
-
interestRateScale: string;
|
|
341
|
-
borrowIndex: string;
|
|
342
|
-
lastUpdated: string;
|
|
343
|
-
cash: string;
|
|
344
|
-
debt: string;
|
|
345
|
-
marketCoinSupply: string;
|
|
346
|
-
minBorrowAmount: string;
|
|
347
|
-
reserve: string;
|
|
348
|
-
reserveFactor: {
|
|
349
|
-
value: string;
|
|
350
|
-
};
|
|
351
|
-
borrowWeight: {
|
|
352
|
-
value: string;
|
|
353
|
-
};
|
|
354
|
-
borrowFeeRate: {
|
|
355
|
-
value: string;
|
|
356
|
-
};
|
|
357
|
-
type: {
|
|
358
|
-
name: string;
|
|
359
|
-
};
|
|
360
|
-
}[];
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* The query interface for `obligation_query::obligation_data` inspectTxn.
|
|
364
|
-
*/
|
|
365
|
-
export interface ObligationQueryInterface {
|
|
366
|
-
collaterals: {
|
|
367
|
-
type: {
|
|
368
|
-
name: string;
|
|
369
|
-
};
|
|
370
|
-
amount: string;
|
|
371
|
-
}[];
|
|
372
|
-
debts: {
|
|
373
|
-
type: {
|
|
374
|
-
name: string;
|
|
375
|
-
};
|
|
376
|
-
amount: string;
|
|
377
|
-
borrowIndex: string;
|
|
378
|
-
}[];
|
|
379
|
-
}
|
|
380
|
-
export {};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import type { MarketPool } from './core';
|
|
2
|
-
import type { Spool } from './spool';
|
|
3
|
-
import type { SupportPoolCoins, SupportCollateralCoins, SupportBorrowIncentiveRewardCoins } from '../constant';
|
|
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
|
-
supplyLendingValue: number;
|
|
109
|
-
supplyCollateralValue: number;
|
|
110
|
-
supplyValue: number;
|
|
111
|
-
borrowValue: number;
|
|
112
|
-
totalValue: number;
|
|
113
|
-
supplyValueChangeRatio?: number;
|
|
114
|
-
supplyLendingValueChangeRatio?: number;
|
|
115
|
-
supplyCollateralValueChangeRatio?: number;
|
|
116
|
-
borrowValueChangeRatio?: number;
|
|
117
|
-
totalValueChangeRatio?: number;
|
|
118
|
-
};
|
|
119
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type sCoinBalance = number;
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import type { SupportStakeMarketCoins } from '../constant';
|
|
2
|
-
type OptionalKeys<T> = {
|
|
3
|
-
[K in keyof T]?: T[K];
|
|
4
|
-
};
|
|
5
|
-
export type Spools = OptionalKeys<Record<SupportStakeMarketCoins, Spool>>;
|
|
6
|
-
export type Spool = {
|
|
7
|
-
marketCoinName: SupportStakeMarketCoins;
|
|
8
|
-
symbol: string;
|
|
9
|
-
coinType: string;
|
|
10
|
-
marketCoinType: string;
|
|
11
|
-
rewardCoinType: string;
|
|
12
|
-
sCoinType: string;
|
|
13
|
-
coinDecimal: number;
|
|
14
|
-
rewardCoinDecimal: number;
|
|
15
|
-
coinPrice: number;
|
|
16
|
-
marketCoinPrice: number;
|
|
17
|
-
rewardCoinPrice: number;
|
|
18
|
-
} & Required<Pick<ParsedSpoolData, 'maxPoint' | 'distributedPoint' | 'maxStake'>> & CalculatedSpoolData & SpoolRewardPool;
|
|
19
|
-
export type OriginSpoolData = {
|
|
20
|
-
stakeType: {
|
|
21
|
-
fields: {
|
|
22
|
-
name: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
maxDistributedPoint: string;
|
|
26
|
-
distributedPoint: string;
|
|
27
|
-
distributedPointPerPeriod: string;
|
|
28
|
-
pointDistributionTime: string;
|
|
29
|
-
maxStake: string;
|
|
30
|
-
stakes: string;
|
|
31
|
-
index: string;
|
|
32
|
-
createdAt: string;
|
|
33
|
-
lastUpdate: string;
|
|
34
|
-
};
|
|
35
|
-
export type SpoolData = {
|
|
36
|
-
created_at: string;
|
|
37
|
-
distributed_point: string;
|
|
38
|
-
distributed_point_per_period: string;
|
|
39
|
-
id: {
|
|
40
|
-
id: string;
|
|
41
|
-
};
|
|
42
|
-
index: string;
|
|
43
|
-
last_update: string;
|
|
44
|
-
max_distributed_point: string;
|
|
45
|
-
max_stakes: string;
|
|
46
|
-
point_distribution_time: string;
|
|
47
|
-
stake_type: {
|
|
48
|
-
type: string;
|
|
49
|
-
fields: {
|
|
50
|
-
name: string;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
stakes: string;
|
|
54
|
-
};
|
|
55
|
-
export type ParsedSpoolData = {
|
|
56
|
-
stakeType: string;
|
|
57
|
-
maxPoint: number;
|
|
58
|
-
distributedPoint: number;
|
|
59
|
-
pointPerPeriod: number;
|
|
60
|
-
period: number;
|
|
61
|
-
maxStake: number;
|
|
62
|
-
staked: number;
|
|
63
|
-
index: number;
|
|
64
|
-
createdAt: number;
|
|
65
|
-
lastUpdate: number;
|
|
66
|
-
};
|
|
67
|
-
export type CalculatedSpoolData = {
|
|
68
|
-
stakedAmount: number;
|
|
69
|
-
stakedCoin: number;
|
|
70
|
-
stakedValue: number;
|
|
71
|
-
distributedPointPerSec: number;
|
|
72
|
-
accumulatedPoints: number;
|
|
73
|
-
currentPointIndex: number;
|
|
74
|
-
currentTotalDistributedPoint: number;
|
|
75
|
-
startDate: Date;
|
|
76
|
-
endDate: Date;
|
|
77
|
-
};
|
|
78
|
-
export type SpoolRewardPool = Required<Pick<ParsedSpoolRewardPoolData, 'exchangeRateNumerator' | 'exchangeRateDenominator'>> & CalculatedSpoolRewardPoolData;
|
|
79
|
-
export type OriginSpoolRewardPoolData = {
|
|
80
|
-
claimed_rewards: string;
|
|
81
|
-
exchange_rate_denominator: string;
|
|
82
|
-
exchange_rate_numerator: string;
|
|
83
|
-
rewards: string;
|
|
84
|
-
spool_id: string;
|
|
85
|
-
};
|
|
86
|
-
export type ParsedSpoolRewardPoolData = {
|
|
87
|
-
claimedRewards: number;
|
|
88
|
-
exchangeRateDenominator: number;
|
|
89
|
-
exchangeRateNumerator: number;
|
|
90
|
-
rewards: number;
|
|
91
|
-
spoolId: string;
|
|
92
|
-
};
|
|
93
|
-
export type CalculatedSpoolRewardPoolData = {
|
|
94
|
-
rewardApr: number;
|
|
95
|
-
totalRewardAmount: number;
|
|
96
|
-
totalRewardCoin: number;
|
|
97
|
-
totalRewardValue: number;
|
|
98
|
-
remaindRewardAmount: number;
|
|
99
|
-
remaindRewardCoin: number;
|
|
100
|
-
remaindRewardValue: number;
|
|
101
|
-
claimedRewardAmount: number;
|
|
102
|
-
claimedRewardCoin: number;
|
|
103
|
-
claimedRewardValue: number;
|
|
104
|
-
rewardPerSec: number;
|
|
105
|
-
};
|
|
106
|
-
export type StakePools = OptionalKeys<Record<SupportStakeMarketCoins, StakePool>>;
|
|
107
|
-
export type StakeRewardPools = OptionalKeys<Record<SupportStakeMarketCoins, StakeRewardPool>>;
|
|
108
|
-
export type StakeAccounts = Record<SupportStakeMarketCoins, StakeAccount[]>;
|
|
109
|
-
export interface StakeAccount {
|
|
110
|
-
id: string;
|
|
111
|
-
type: string;
|
|
112
|
-
stakePoolId: string;
|
|
113
|
-
stakeType: string;
|
|
114
|
-
staked: number;
|
|
115
|
-
index: number;
|
|
116
|
-
points: number;
|
|
117
|
-
totalPoints: number;
|
|
118
|
-
}
|
|
119
|
-
export interface StakePool {
|
|
120
|
-
id: string;
|
|
121
|
-
type: string;
|
|
122
|
-
maxPoint: number;
|
|
123
|
-
distributedPoint: number;
|
|
124
|
-
pointPerPeriod: number;
|
|
125
|
-
period: number;
|
|
126
|
-
maxStake: number;
|
|
127
|
-
stakeType: string;
|
|
128
|
-
totalStaked: number;
|
|
129
|
-
index: number;
|
|
130
|
-
createdAt: number;
|
|
131
|
-
lastUpdate: number;
|
|
132
|
-
}
|
|
133
|
-
export interface StakeRewardPool {
|
|
134
|
-
id: string;
|
|
135
|
-
type: string;
|
|
136
|
-
stakePoolId: string;
|
|
137
|
-
ratioDenominator: number;
|
|
138
|
-
ratioNumerator: number;
|
|
139
|
-
rewards: number;
|
|
140
|
-
claimedRewards: number;
|
|
141
|
-
}
|
|
142
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { SuiObjectRef } from '@mysten/sui/client';
|
|
2
|
-
export type Vesca = {
|
|
3
|
-
id: string;
|
|
4
|
-
keyId: string;
|
|
5
|
-
keyObject?: SuiObjectRef;
|
|
6
|
-
object: SuiObjectRef;
|
|
7
|
-
lockedScaAmount: string;
|
|
8
|
-
lockedScaCoin: number;
|
|
9
|
-
currentVeScaBalance: number;
|
|
10
|
-
unlockAt: number;
|
|
11
|
-
};
|
|
12
|
-
export type VeScaTreasuryFields = {
|
|
13
|
-
total_ve_sca_amount: string;
|
|
14
|
-
sca_balance: string;
|
|
15
|
-
unlock_schedule: {
|
|
16
|
-
fields: {
|
|
17
|
-
locked_sca_amount: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export type VeScaTreasuryInfo = {
|
|
22
|
-
totalLockedSca: number;
|
|
23
|
-
totalVeSca: number;
|
|
24
|
-
averageLockingPeriod: number;
|
|
25
|
-
averageLockingPeriodUnit: string;
|
|
26
|
-
};
|
package/dist/types/utils.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { SupportCoins } from './constant';
|
|
2
|
-
export type OptionalKeys<T> = {
|
|
3
|
-
[K in keyof T]?: T[K];
|
|
4
|
-
};
|
|
5
|
-
export type CoinPrices = OptionalKeys<Record<SupportCoins, number>>;
|
|
6
|
-
export type PoolAddressInfo = {
|
|
7
|
-
name: string;
|
|
8
|
-
coingeckoId: string;
|
|
9
|
-
decimal: number;
|
|
10
|
-
pythFeedId: string;
|
|
11
|
-
lendingPoolAddress?: string;
|
|
12
|
-
collateralPoolAddress?: string;
|
|
13
|
-
borrowDynamic?: string;
|
|
14
|
-
interestModelId?: string;
|
|
15
|
-
borrowFeeKey?: string;
|
|
16
|
-
supplyLimitKey?: string;
|
|
17
|
-
borrowLimitKey?: string;
|
|
18
|
-
isolatedAssetKey?: string;
|
|
19
|
-
sCoinAddress: string | undefined;
|
|
20
|
-
marketCoinAddress: string;
|
|
21
|
-
sCoinName: string | undefined;
|
|
22
|
-
};
|