@scallop-io/sui-scallop-sdk 1.4.24-alpha.1 → 1.4.24-alpha.2

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 (85) hide show
  1. package/dist/index.d.mts +3119 -0
  2. package/dist/index.d.ts +3119 -3
  3. package/dist/index.js +77 -10071
  4. package/dist/index.mjs +15 -9998
  5. package/package.json +3 -4
  6. package/src/models/scallopIndexer.ts +11 -0
  7. package/src/models/scallopQuery.ts +15 -1
  8. package/src/queries/priceQuery.ts +10 -3
  9. package/dist/builders/borrowIncentiveBuilder.d.ts +0 -12
  10. package/dist/builders/coreBuilder.d.ts +0 -12
  11. package/dist/builders/index.d.ts +0 -12
  12. package/dist/builders/loyaltyProgramBuilder.d.ts +0 -12
  13. package/dist/builders/oracle.d.ts +0 -14
  14. package/dist/builders/referralBuilder.d.ts +0 -12
  15. package/dist/builders/sCoinBuilder.d.ts +0 -4
  16. package/dist/builders/spoolBuilder.d.ts +0 -12
  17. package/dist/builders/vescaBuilder.d.ts +0 -25
  18. package/dist/constants/cache.d.ts +0 -14
  19. package/dist/constants/coinGecko.d.ts +0 -2
  20. package/dist/constants/common.d.ts +0 -20
  21. package/dist/constants/enum.d.ts +0 -14
  22. package/dist/constants/flashloan.d.ts +0 -2
  23. package/dist/constants/index.d.ts +0 -12
  24. package/dist/constants/poolAddress.d.ts +0 -27
  25. package/dist/constants/pyth.d.ts +0 -5
  26. package/dist/constants/queryKeys.d.ts +0 -54
  27. package/dist/constants/rpc.d.ts +0 -1
  28. package/dist/constants/testAddress.d.ts +0 -2
  29. package/dist/constants/vesca.d.ts +0 -5
  30. package/dist/index.js.map +0 -1
  31. package/dist/index.mjs.map +0 -1
  32. package/dist/models/index.d.ts +0 -8
  33. package/dist/models/scallop.d.ts +0 -73
  34. package/dist/models/scallopAddress.d.ts +0 -150
  35. package/dist/models/scallopBuilder.d.ts +0 -90
  36. package/dist/models/scallopCache.d.ts +0 -81
  37. package/dist/models/scallopClient.d.ts +0 -321
  38. package/dist/models/scallopIndexer.d.ts +0 -89
  39. package/dist/models/scallopQuery.d.ts +0 -687
  40. package/dist/models/scallopUtils.d.ts +0 -229
  41. package/dist/models/suiKit.d.ts +0 -2
  42. package/dist/queries/borrowIncentiveQuery.d.ts +0 -84
  43. package/dist/queries/borrowLimitQuery.d.ts +0 -9
  44. package/dist/queries/coreQuery.d.ts +0 -171
  45. package/dist/queries/index.d.ts +0 -14
  46. package/dist/queries/isolatedAssetQuery.d.ts +0 -14
  47. package/dist/queries/loyaltyProgramQuery.d.ts +0 -10
  48. package/dist/queries/objectsQuery.d.ts +0 -2
  49. package/dist/queries/poolAddressesQuery.d.ts +0 -29
  50. package/dist/queries/portfolioQuery.d.ts +0 -144
  51. package/dist/queries/priceQuery.d.ts +0 -60
  52. package/dist/queries/referralQuery.d.ts +0 -7
  53. package/dist/queries/sCoinQuery.d.ts +0 -41
  54. package/dist/queries/spoolQuery.d.ts +0 -74
  55. package/dist/queries/supplyLimitQuery.d.ts +0 -9
  56. package/dist/queries/vescaQuery.d.ts +0 -36
  57. package/dist/types/address.d.ts +0 -107
  58. package/dist/types/builder/borrowIncentive.d.ts +0 -35
  59. package/dist/types/builder/core.d.ts +0 -56
  60. package/dist/types/builder/index.d.ts +0 -24
  61. package/dist/types/builder/loyaltyProgram.d.ts +0 -23
  62. package/dist/types/builder/referral.d.ts +0 -30
  63. package/dist/types/builder/sCoin.d.ts +0 -37
  64. package/dist/types/builder/spool.d.ts +0 -29
  65. package/dist/types/builder/vesca.d.ts +0 -51
  66. package/dist/types/constant/common.d.ts +0 -24
  67. package/dist/types/constant/enum.d.ts +0 -48
  68. package/dist/types/constant/index.d.ts +0 -2
  69. package/dist/types/index.d.ts +0 -6
  70. package/dist/types/model.d.ts +0 -60
  71. package/dist/types/query/borrowIncentive.d.ts +0 -124
  72. package/dist/types/query/core.d.ts +0 -380
  73. package/dist/types/query/index.d.ts +0 -7
  74. package/dist/types/query/loyaltyProgram.d.ts +0 -5
  75. package/dist/types/query/portfolio.d.ts +0 -119
  76. package/dist/types/query/sCoin.d.ts +0 -1
  77. package/dist/types/query/spool.d.ts +0 -142
  78. package/dist/types/query/vesca.d.ts +0 -26
  79. package/dist/types/utils.d.ts +0 -22
  80. package/dist/utils/builder.d.ts +0 -15
  81. package/dist/utils/core.d.ts +0 -2
  82. package/dist/utils/index.d.ts +0 -5
  83. package/dist/utils/indexer.d.ts +0 -17
  84. package/dist/utils/query.d.ts +0 -62
  85. package/dist/utils/util.d.ts +0 -27
@@ -1,687 +0,0 @@
1
- import { SuiKit, SuiObjectArg } from '@scallop-io/sui-kit';
2
- import { ScallopQueryParams, SupportStakeMarketCoins, SupportAssetCoins, SupportPoolCoins, SupportCollateralCoins, SupportMarketCoins, SupportBorrowIncentiveCoins, SupportSCoin, ScallopQueryInstanceParams, MarketPool, CoinPrices, MarketPools, MarketCollaterals } from '../types';
3
- import { ScallopAddress } from './scallopAddress';
4
- import { ScallopUtils } from './scallopUtils';
5
- import { ScallopIndexer } from './scallopIndexer';
6
- import { ScallopCache } from './scallopCache';
7
- import { SuiObjectData } from '@mysten/sui/client';
8
- import { SuiObjectRef } from '@mysten/sui/client';
9
- /**
10
- * @description
11
- * It provides methods for getting on-chain data from the Scallop contract.
12
- *
13
- * @example
14
- * ```typescript
15
- * const scallopQuery = new ScallopQuery(<parameters>);
16
- * await scallopQuery.init();
17
- * scallopQuery.<query functions>();
18
- * await scallopQuery.<query functions>();
19
- * ```
20
- */
21
- export declare class ScallopQuery {
22
- readonly params: ScallopQueryParams;
23
- suiKit: SuiKit;
24
- address: ScallopAddress;
25
- utils: ScallopUtils;
26
- indexer: ScallopIndexer;
27
- cache: ScallopCache;
28
- walletAddress: string;
29
- constructor(params?: ScallopQueryParams, instance?: ScallopQueryInstanceParams);
30
- /**
31
- * Request the scallop API to initialize data.
32
- *
33
- * @param force - Whether to force initialization.
34
- * @param address - ScallopAddress instance.
35
- */
36
- init(force?: boolean, address?: ScallopAddress): Promise<void>;
37
- /**
38
- * @deprecated use getMarketPools
39
- * Query market data.
40
- * @param indexer - Whether to use indexer.
41
- * @return Market data.
42
- */
43
- queryMarket(args?: {
44
- coinPrices?: CoinPrices;
45
- indexer?: boolean;
46
- }): Promise<import("../types").Market>;
47
- /**
48
- * Get market pools.
49
- *
50
- * @description
51
- * To obtain all market pools at once, it is recommended to use
52
- * the `queryMarket` method to reduce time consumption.
53
- *
54
- * @param poolCoinNames - Specific an array of support pool coin name.
55
- * @param indexer - Whether to use indexer.
56
- * @return Market pools data.
57
- */
58
- getMarketPools(poolCoinNames?: SupportPoolCoins[], args?: {
59
- coinPrices?: CoinPrices;
60
- indexer?: boolean;
61
- }): Promise<{
62
- pools: MarketPools;
63
- collaterals: MarketCollaterals;
64
- }>;
65
- /**
66
- * Get market pool
67
- *
68
- * @param poolCoinName - Specific support pool coin name.
69
- * @param indexer - Whether to use indexer.
70
- * @return Market pool data.
71
- */
72
- getMarketPool(poolCoinName: SupportPoolCoins, args?: {
73
- coinPrice?: number;
74
- indexer?: boolean;
75
- }): Promise<MarketPool | undefined>;
76
- /**
77
- * Get market collaterals.
78
- *
79
- * @description
80
- * To obtain all market collaterals at once, it is recommended to use
81
- * the `queryMarket` method to reduce time consumption.
82
- *
83
- * @param collateralCoinNames - Specific an array of support collateral coin name.
84
- * @param indexer - Whether to use indexer.
85
- * @return Market collaterals data.
86
- */
87
- getMarketCollaterals(collateralCoinNames?: SupportCollateralCoins[], args?: {
88
- indexer?: boolean;
89
- }): Promise<{
90
- usdc?: import("../types").MarketCollateral | undefined;
91
- sbeth?: import("../types").MarketCollateral | undefined;
92
- sbusdt?: import("../types").MarketCollateral | undefined;
93
- sbwbtc?: import("../types").MarketCollateral | undefined;
94
- weth?: import("../types").MarketCollateral | undefined;
95
- wbtc?: import("../types").MarketCollateral | undefined;
96
- wusdc?: import("../types").MarketCollateral | undefined;
97
- wusdt?: import("../types").MarketCollateral | undefined;
98
- sui?: import("../types").MarketCollateral | undefined;
99
- wapt?: import("../types").MarketCollateral | undefined;
100
- wsol?: import("../types").MarketCollateral | undefined;
101
- cetus?: import("../types").MarketCollateral | undefined;
102
- afsui?: import("../types").MarketCollateral | undefined;
103
- hasui?: import("../types").MarketCollateral | undefined;
104
- vsui?: import("../types").MarketCollateral | undefined;
105
- sca?: import("../types").MarketCollateral | undefined;
106
- fdusd?: import("../types").MarketCollateral | undefined;
107
- }>;
108
- /**
109
- * Get market collateral
110
- *
111
- * @param collateralCoinName - Specific support collateral coin name.
112
- * @param indexer - Whether to use indexer.
113
- * @return Market collateral data.
114
- */
115
- getMarketCollateral(collateralCoinName: SupportCollateralCoins, args?: {
116
- indexer?: boolean;
117
- }): Promise<import("../types").MarketCollateral | undefined>;
118
- /**
119
- * Get obligations data.
120
- *
121
- * @param ownerAddress - The owner address.
122
- * @return Obligations data.
123
- */
124
- getObligations(ownerAddress?: string): Promise<import("../types").Obligation[]>;
125
- /**
126
- * Query obligation data.
127
- *
128
- * @param obligationId - The obligation id.
129
- * @return Obligation data.
130
- */
131
- queryObligation(obligationId: string | SuiObjectArg): Promise<import("../types").ObligationQueryInterface | undefined>;
132
- /**
133
- * Get all asset coin amounts.
134
- *
135
- * @param assetCoinNames - Specific an array of support asset coin name.
136
- * @param ownerAddress - The owner address.
137
- * @return All coin amounts.
138
- */
139
- getCoinAmounts(assetCoinNames?: SupportAssetCoins[], ownerAddress?: string): Promise<import("../types").OptionalKeys<Record<SupportAssetCoins, number>>>;
140
- /**
141
- * Get asset coin amount.
142
- *
143
- * @param assetCoinName - Specific support asset coin name.
144
- * @param ownerAddress - The owner address.
145
- * @return Coin amount.
146
- */
147
- getCoinAmount(assetCoinName: SupportAssetCoins, ownerAddress?: string): Promise<number>;
148
- /**
149
- * Get all market coin amounts.
150
- *
151
- * @param coinNames - Specific an array of support market coin name.
152
- * @param ownerAddress - The owner address.
153
- * @return All market market coin amounts.
154
- */
155
- getMarketCoinAmounts(marketCoinNames?: SupportMarketCoins[], ownerAddress?: string): Promise<import("../types").OptionalKeys<Record<SupportMarketCoins, number>>>;
156
- /**
157
- * Get market coin amount.
158
- *
159
- * @param coinNames - Specific support market coin name.
160
- * @param ownerAddress - The owner address.
161
- * @return Market market coin amount.
162
- */
163
- getMarketCoinAmount(marketCoinName: SupportMarketCoins, ownerAddress?: string): Promise<number>;
164
- /**
165
- * Get price from pyth fee object.
166
- *
167
- * @param assetCoinName - Specific support asset coin name.
168
- * @return Asset coin price.
169
- */
170
- getPriceFromPyth(assetCoinName: SupportAssetCoins): Promise<number>;
171
- /**
172
- * Get prices from pyth fee object.
173
- *
174
- * @param assetCoinNames - Array of supported asset coin names.
175
- * @return Array of asset coin prices.
176
- */
177
- getPricesFromPyth(assetCoinNames: SupportAssetCoins[]): Promise<Record<SupportAssetCoins, number>>;
178
- /**
179
- * Get spools data.
180
- *
181
- * @param stakeMarketCoinNames - Specific an array of support stake market coin name.
182
- * @param indexer - Whether to use indexer.
183
- * @return Spools data.
184
- */
185
- getSpools(stakeMarketCoinNames?: SupportStakeMarketCoins[], args?: {
186
- marketPools?: MarketPools;
187
- coinPrices?: CoinPrices;
188
- indexer?: boolean;
189
- }): Promise<{
190
- susdc?: import("../types").Spool | undefined;
191
- sweth?: import("../types").Spool | undefined;
192
- swusdc?: import("../types").Spool | undefined;
193
- swusdt?: import("../types").Spool | undefined;
194
- ssui?: import("../types").Spool | undefined;
195
- scetus?: import("../types").Spool | undefined;
196
- safsui?: import("../types").Spool | undefined;
197
- shasui?: import("../types").Spool | undefined;
198
- svsui?: import("../types").Spool | undefined;
199
- }>;
200
- /**
201
- * Get spool data.
202
- *
203
- * @param stakeMarketCoinName - Specific support stake market coin name.
204
- * @param indexer - Whether to use indexer.
205
- * @return Spool data.
206
- */
207
- getSpool(stakeMarketCoinName: SupportStakeMarketCoins, args?: {
208
- marketPool?: MarketPool;
209
- coinPrices?: CoinPrices;
210
- indexer?: boolean;
211
- }): Promise<import("../types").Spool | undefined>;
212
- /**
213
- * Get stake accounts data for all stake pools (spools).
214
- *
215
- * @param ownerAddress - The owner address.
216
- * @return All Stake accounts data.
217
- */
218
- getAllStakeAccounts(ownerAddress?: string): Promise<import("../types").StakeAccounts>;
219
- /**
220
- * Get stake accounts data for specific stake pool (spool).
221
- *
222
- * @param stakeMarketCoinName - Specific support stake market coin name.
223
- * @param ownerAddress - The owner address.
224
- * @return Stake accounts data.
225
- */
226
- getStakeAccounts(stakeMarketCoinName: SupportStakeMarketCoins, ownerAddress?: string): Promise<import("../types").StakeAccount[]>;
227
- /**
228
- * Get stake pools (spools) data.
229
- *
230
- * @description
231
- * For backward compatible, it is recommended to use `getSpools` method
232
- * to get all spools data.
233
- *
234
- * @param stakeMarketCoinNames - Specific an array of support stake market coin name.
235
- * @return Stake pools data.
236
- */
237
- getStakePools(stakeMarketCoinNames?: SupportStakeMarketCoins[]): Promise<{
238
- susdc?: import("../types").StakePool | undefined;
239
- sweth?: import("../types").StakePool | undefined;
240
- swusdc?: import("../types").StakePool | undefined;
241
- swusdt?: import("../types").StakePool | undefined;
242
- ssui?: import("../types").StakePool | undefined;
243
- scetus?: import("../types").StakePool | undefined;
244
- safsui?: import("../types").StakePool | undefined;
245
- shasui?: import("../types").StakePool | undefined;
246
- svsui?: import("../types").StakePool | undefined;
247
- }>;
248
- /**
249
- * Get stake pool (spool) data.
250
- *
251
- * @description
252
- * For backward compatible, it is recommended to use `getSpool` method
253
- * to get all spool data.
254
- *
255
- * @param stakeMarketCoinName - Specific support stake market coin name.
256
- * @return Stake pool data.
257
- */
258
- getStakePool(stakeMarketCoinName: SupportStakeMarketCoins): Promise<import("../types").StakePool | undefined>;
259
- /**
260
- * Get stake reward pools data.
261
- *
262
- * @description
263
- * For backward compatible, it is recommended to use `getSpools` method
264
- * to get all spools data.
265
- *
266
- * @param stakeMarketCoinNames - Specific an array of stake market coin name.
267
- * @return Stake reward pools data.
268
- */
269
- getStakeRewardPools(stakeMarketCoinNames?: SupportStakeMarketCoins[]): Promise<{
270
- susdc?: import("../types").StakeRewardPool | undefined;
271
- sweth?: import("../types").StakeRewardPool | undefined;
272
- swusdc?: import("../types").StakeRewardPool | undefined;
273
- swusdt?: import("../types").StakeRewardPool | undefined;
274
- ssui?: import("../types").StakeRewardPool | undefined;
275
- scetus?: import("../types").StakeRewardPool | undefined;
276
- safsui?: import("../types").StakeRewardPool | undefined;
277
- shasui?: import("../types").StakeRewardPool | undefined;
278
- svsui?: import("../types").StakeRewardPool | undefined;
279
- }>;
280
- /**
281
- * Get stake reward pool data.
282
- *
283
- * @description
284
- * For backward compatible, it is recommended to use `getSpool` method
285
- * to get spool data.
286
- *
287
- * @param marketCoinName - Specific support stake market coin name.
288
- * @return Stake reward pool data.
289
- */
290
- getStakeRewardPool(stakeMarketCoinName: SupportStakeMarketCoins): Promise<import("../types").StakeRewardPool | undefined>;
291
- /**
292
- * Get borrow incentive pools data.
293
- *
294
- * @param coinNames - Specific an array of support borrow incentive coin name.
295
- * @param indexer - Whether to use indexer.
296
- * @return Borrow incentive pools data.
297
- */
298
- getBorrowIncentivePools(coinNames?: SupportBorrowIncentiveCoins[], args?: {
299
- coinPrices?: CoinPrices;
300
- indexer?: boolean;
301
- marketPools?: MarketPools;
302
- }): Promise<{
303
- usdc?: import("../types").BorrowIncentivePool | undefined;
304
- sbeth?: import("../types").BorrowIncentivePool | undefined;
305
- sbusdt?: import("../types").BorrowIncentivePool | undefined;
306
- sbwbtc?: import("../types").BorrowIncentivePool | undefined;
307
- weth?: import("../types").BorrowIncentivePool | undefined;
308
- wbtc?: import("../types").BorrowIncentivePool | undefined;
309
- wusdc?: import("../types").BorrowIncentivePool | undefined;
310
- wusdt?: import("../types").BorrowIncentivePool | undefined;
311
- sui?: import("../types").BorrowIncentivePool | undefined;
312
- wapt?: import("../types").BorrowIncentivePool | undefined;
313
- wsol?: import("../types").BorrowIncentivePool | undefined;
314
- cetus?: import("../types").BorrowIncentivePool | undefined;
315
- afsui?: import("../types").BorrowIncentivePool | undefined;
316
- hasui?: import("../types").BorrowIncentivePool | undefined;
317
- vsui?: import("../types").BorrowIncentivePool | undefined;
318
- sca?: import("../types").BorrowIncentivePool | undefined;
319
- fud?: import("../types").BorrowIncentivePool | undefined;
320
- deep?: import("../types").BorrowIncentivePool | undefined;
321
- fdusd?: import("../types").BorrowIncentivePool | undefined;
322
- blub?: import("../types").BorrowIncentivePool | undefined;
323
- musd?: import("../types").BorrowIncentivePool | undefined;
324
- }>;
325
- /**
326
- * Get borrow incentive accounts data.
327
- *
328
- * @param coinNames - Specific support borrow incentive coin name.
329
- * @param ownerAddress - The owner address.
330
- * @return Borrow incentive accounts data.
331
- */
332
- getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef, coinNames?: SupportBorrowIncentiveCoins[]): Promise<{
333
- usdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
334
- sbeth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
335
- sbusdt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
336
- sbwbtc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
337
- weth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
338
- wbtc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
339
- wusdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
340
- wusdt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
341
- sui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
342
- wapt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
343
- wsol?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
344
- cetus?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
345
- afsui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
346
- hasui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
347
- vsui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
348
- sca?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
349
- fud?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
350
- deep?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
351
- fdusd?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
352
- blub?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
353
- musd?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
354
- }>;
355
- /**
356
- * Get user lending and spool infomation for specific pools.
357
- *
358
- * @param poolCoinNames - Specific an array of support pool coin name.
359
- * @param ownerAddress - The owner address.
360
- * @param indexer - Whether to use indexer.
361
- * @return All lending and spool infomation.
362
- */
363
- getLendings(poolCoinNames?: SupportPoolCoins[], ownerAddress?: string, args?: {
364
- indexer?: boolean;
365
- marketPools?: MarketPools;
366
- coinPrices?: CoinPrices;
367
- }): Promise<{
368
- usdc?: import("../types").Lending | undefined;
369
- sbeth?: import("../types").Lending | undefined;
370
- sbusdt?: import("../types").Lending | undefined;
371
- sbwbtc?: import("../types").Lending | undefined;
372
- weth?: import("../types").Lending | undefined;
373
- wbtc?: import("../types").Lending | undefined;
374
- wusdc?: import("../types").Lending | undefined;
375
- wusdt?: import("../types").Lending | undefined;
376
- sui?: import("../types").Lending | undefined;
377
- wapt?: import("../types").Lending | undefined;
378
- wsol?: import("../types").Lending | undefined;
379
- cetus?: import("../types").Lending | undefined;
380
- afsui?: import("../types").Lending | undefined;
381
- hasui?: import("../types").Lending | undefined;
382
- vsui?: import("../types").Lending | undefined;
383
- sca?: import("../types").Lending | undefined;
384
- fud?: import("../types").Lending | undefined;
385
- deep?: import("../types").Lending | undefined;
386
- fdusd?: import("../types").Lending | undefined;
387
- blub?: import("../types").Lending | undefined;
388
- musd?: import("../types").Lending | undefined;
389
- }>;
390
- /**
391
- * Get user lending and spool information for specific pool.
392
- *
393
- * @param poolCoinName - Specific support pool coin name.
394
- * @param ownerAddress - The owner address.
395
- * @param indexer - Whether to use indexer.
396
- * @return Lending pool data.
397
- */
398
- getLending(poolCoinName: SupportPoolCoins, ownerAddress?: string, args?: {
399
- indexer?: boolean;
400
- }): Promise<import("../types").Lending>;
401
- /**
402
- * Get user all obligation accounts information.
403
- *
404
- * @description
405
- * All collateral and borrowing information in all obligation accounts owned by the user.
406
- *
407
- * @param ownerAddress - The owner address.
408
- * @param indexer - Whether to use indexer.
409
- * @return All obligation accounts information.
410
- */
411
- getObligationAccounts(ownerAddress?: string, args?: {
412
- indexer?: boolean;
413
- market?: {
414
- collaterals: MarketCollaterals;
415
- pools: MarketPools;
416
- };
417
- coinPrices?: CoinPrices;
418
- }): Promise<{
419
- [x: string]: import("../types").ObligationAccount | undefined;
420
- }>;
421
- /**
422
- * Get obligation account information for specific id.
423
- *
424
- * @description
425
- * borrowing and obligation information for specific pool.
426
- *
427
- * @param obligationId - The obligation id.
428
- * @param ownerAddress - The owner address.
429
- * @param indexer - Whether to use indexer.
430
- * @return Borrowing and collateral information.
431
- */
432
- getObligationAccount(obligationId: string, ownerAddress?: string, args?: {
433
- indexer?: boolean;
434
- }): Promise<import("../types").ObligationAccount | undefined>;
435
- /**
436
- * Get total value locked.
437
- *
438
- * @param indexer - Whether to use indexer.
439
- * @description
440
- * Include total supplied value and total borrowed value.
441
- *
442
- * @return Total value locked.
443
- */
444
- getTvl(args?: {
445
- indexer?: boolean;
446
- }): Promise<import("../types").TotalValueLocked>;
447
- /**
448
- * Get veSca data.
449
- * @param veScaKey
450
- * @returns veSca
451
- */
452
- getVeSca(veScaKey: string | SuiObjectData): Promise<import("../types").Vesca | undefined>;
453
- /**
454
- * Get all veSca from walletAdddress
455
- * @param walletAddress
456
- * @returns array of veSca
457
- */
458
- getVeScas({ walletAddress, excludeEmpty, }?: {
459
- walletAddress?: string;
460
- excludeEmpty?: boolean;
461
- }): Promise<import("../types").Vesca[]>;
462
- /**
463
- * Get total vesca treasury with movecall
464
- * @returns Promise<string | undefined>
465
- */
466
- getVeScaTreasuryInfo(): Promise<import("../types").VeScaTreasuryInfo | null>;
467
- /**
468
- * Return binded referrer veScaKeyId of referee walletAddress if exist
469
- * @param walletAddress
470
- * @returns veScaKeyId
471
- */
472
- getVeScaKeyIdFromReferralBindings(walletAddress?: string): Promise<string | null>;
473
- /**
474
- * Get binded obligationId from a veScaKey if it exists.
475
- * @param veScaKey
476
- * @returns obligationId
477
- */
478
- getBindedObligationId(veScaKey: string): Promise<string | null>;
479
- /**
480
- * Get binded veSCA key from a obligationId if it exists.
481
- * @param obligationId
482
- * @returns veScaKey
483
- */
484
- getBindedVeScaKey(obligationId: string): Promise<string | null>;
485
- /**
486
- * Get user's veSCA loyalty program informations
487
- * @param walletAddress
488
- * @returns Loyalty program information
489
- */
490
- getLoyaltyProgramInfos(veScaKey?: string | SuiObjectData): Promise<import("../types").LoyaltyProgramInfo | null>;
491
- /**
492
- * Get total supply of sCoin
493
- * @param sCoinName - Supported sCoin name
494
- * @returns Total Supply
495
- */
496
- getSCoinTotalSupply(sCoinName: SupportSCoin): Promise<number>;
497
- /**
498
- * Get all sCoin amounts.
499
- *
500
- * @param sCoinNames - Specific an array of support sCoin name.
501
- * @param ownerAddress - The owner address.
502
- * @return All market sCoin amounts.
503
- */
504
- getSCoinAmounts(sCoinNames?: SupportSCoin[], ownerAddress?: string): Promise<import("../types").OptionalKeys<Record<"susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub" | "smusd", number>>>;
505
- /**
506
- * Get sCoin amount.
507
- *
508
- * @param coinNames - Specific support sCoin name.
509
- * @param ownerAddress - The owner address.
510
- * @return sCoin amount.
511
- */
512
- getSCoinAmount(sCoinName: SupportSCoin | SupportMarketCoins, ownerAddress?: string): Promise<number>;
513
- /**
514
- * Get swap rate from sCoin A to sCoin B
515
- * @param assetCoinNames
516
- * @returns
517
- */
518
- getSCoinSwapRate(fromSCoin: SupportSCoin, toSCoin: SupportSCoin): Promise<number>;
519
- getFlashLoanFees(assetCoinNames?: SupportAssetCoins[]): Promise<Record<"usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub" | "musd", number>>;
520
- /**
521
- * Get supply limit of lending pool
522
- */
523
- getPoolSupplyLimit(poolName: SupportPoolCoins): Promise<string | null>;
524
- /**
525
- * Get borrow limit of borrow pool
526
- */
527
- getPoolBorrowLimit(poolName: SupportPoolCoins): Promise<string | null>;
528
- /**
529
- * Get list of isolated assets
530
- */
531
- getIsolatedAssets(): Promise<string[]>;
532
- /**
533
- * Check if asset is an isolated asset
534
- */
535
- isIsolatedAsset(assetCoinName: SupportAssetCoins): Promise<boolean>;
536
- /**
537
- * Get pool coin price from indexer
538
- * @param coinName
539
- * @returns price data
540
- */
541
- getCoinPriceByIndexer(poolName: SupportPoolCoins): Promise<number>;
542
- /**
543
- * Get all coin prices, including sCoin
544
- * @returns prices data
545
- */
546
- getAllCoinPrices(args?: {
547
- marketPools?: MarketPools;
548
- coinPrices?: CoinPrices;
549
- }): Promise<{
550
- susdc?: number | undefined;
551
- ssbeth?: number | undefined;
552
- ssbusdt?: number | undefined;
553
- ssbwbtc?: number | undefined;
554
- sweth?: number | undefined;
555
- swbtc?: number | undefined;
556
- swusdc?: number | undefined;
557
- swusdt?: number | undefined;
558
- ssui?: number | undefined;
559
- swsol?: number | undefined;
560
- scetus?: number | undefined;
561
- safsui?: number | undefined;
562
- shasui?: number | undefined;
563
- svsui?: number | undefined;
564
- ssca?: number | undefined;
565
- sfud?: number | undefined;
566
- sdeep?: number | undefined;
567
- sfdusd?: number | undefined;
568
- sblub?: number | undefined;
569
- smusd?: number | undefined;
570
- usdc?: number | undefined;
571
- sbeth?: number | undefined;
572
- sbusdt?: number | undefined;
573
- sbwbtc?: number | undefined;
574
- weth?: number | undefined;
575
- wbtc?: number | undefined;
576
- wusdc?: number | undefined;
577
- wusdt?: number | undefined;
578
- sui?: number | undefined;
579
- wapt?: number | undefined;
580
- wsol?: number | undefined;
581
- cetus?: number | undefined;
582
- afsui?: number | undefined;
583
- hasui?: number | undefined;
584
- vsui?: number | undefined;
585
- sca?: number | undefined;
586
- fud?: number | undefined;
587
- deep?: number | undefined;
588
- fdusd?: number | undefined;
589
- blub?: number | undefined;
590
- musd?: number | undefined;
591
- swapt?: number | undefined;
592
- }>;
593
- /**
594
- * Query all address (lending pool, collateral pool, borrow dynamics, interest models, etc.) of all pool
595
- * @returns
596
- */
597
- getPoolAddresses(pools?: SupportPoolCoins[]): Promise<import("../types").OptionalKeys<Record<"usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub" | "musd", {
598
- coinName: string;
599
- symbol: string;
600
- lendingPoolAddress?: string;
601
- collateralPoolAddress?: string;
602
- borrowDynamic?: string;
603
- spoolReward?: string;
604
- spool?: string;
605
- sCoinType?: string;
606
- sCoinName?: string;
607
- sCoinSymbol?: string;
608
- sCoinTreasury?: string;
609
- interestModel?: string;
610
- riskModel?: string;
611
- borrowFeeKey?: string;
612
- supplyLimitKey?: string;
613
- borrowLimitKey?: string;
614
- isolatedAssetKey?: string;
615
- coinMetadataId?: string;
616
- borrowIncentivePoolId?: string;
617
- coinType?: string;
618
- sCoinMetadataId?: string;
619
- spoolName?: string;
620
- decimals: number;
621
- pythFeed?: string;
622
- pythFeedObjectId?: string;
623
- }>>>;
624
- /**
625
- * Get user portfolio
626
- */
627
- getUserPortfolio(args?: {
628
- walletAddress?: string;
629
- indexer?: boolean;
630
- }): Promise<{
631
- totalLockedScaValue: number;
632
- lendings: {
633
- suppliedCoin: number;
634
- suppliedValue: number;
635
- stakedCoin: number;
636
- coinName: "usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub" | "musd";
637
- symbol: string;
638
- coinType: string;
639
- coinPrice: number;
640
- coinDecimals: number;
641
- supplyApr: number;
642
- supplyApy: number;
643
- incentiveApr: number;
644
- }[];
645
- borrowings: {
646
- obligationId: string;
647
- totalDebtsInUsd: number;
648
- totalCollateralInUsd: number;
649
- riskLevel: number;
650
- availableCollateralInUsd: number;
651
- totalUnhealthyCollateralInUsd: number;
652
- borrowedPools: {
653
- coinName: "usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub" | "musd";
654
- symbol: string;
655
- coinDecimals: number;
656
- coinType: string;
657
- coinPrice: number;
658
- borrowedCoin: number;
659
- borrowedValueInUsd: number;
660
- borrowApr: number | undefined;
661
- borrowApy: number | undefined;
662
- incentiveInfos: {
663
- coinName: "usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub" | "musd" | "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub" | "smusd";
664
- symbol: string;
665
- coinType: string;
666
- incentiveApr: number;
667
- }[];
668
- }[];
669
- }[];
670
- pendingRewards: {
671
- lendings: any;
672
- borrowIncentives: any;
673
- };
674
- veScas: {
675
- veScaKey: string;
676
- coinPrice: number;
677
- lockedScaInCoin: number;
678
- lockedScaInUsd: number;
679
- currentVeScaBalance: number;
680
- remainingLockPeriodInDays: number;
681
- unlockAt: number;
682
- }[];
683
- totalDebtValue: number;
684
- totalCollateralValue: number;
685
- totalSupplyValue: number;
686
- }>;
687
- }