@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.
Files changed (104) hide show
  1. package/dist/index.d.mts +3161 -0
  2. package/dist/index.d.ts +3161 -3
  3. package/dist/index.js +78 -9966
  4. package/dist/index.mjs +15 -9892
  5. package/package.json +5 -6
  6. package/src/builders/coreBuilder.ts +10 -14
  7. package/src/builders/oracle.ts +10 -2
  8. package/src/constants/coinGecko.ts +14 -4
  9. package/src/constants/common.ts +8 -1
  10. package/src/constants/enum.ts +28 -57
  11. package/src/constants/poolAddress.ts +294 -344
  12. package/src/constants/pyth.ts +4 -1
  13. package/src/constants/testAddress.ts +487 -61
  14. package/src/constants/xoracle.ts +18 -16
  15. package/src/models/scallopAddress.ts +54 -0
  16. package/src/models/scallopQuery.ts +8 -12
  17. package/src/queries/coreQuery.ts +4 -4
  18. package/src/queries/poolAddressesQuery.ts +2 -2
  19. package/src/queries/portfolioQuery.ts +7 -8
  20. package/src/queries/xOracleQuery.ts +15 -7
  21. package/src/types/address.ts +5 -0
  22. package/src/types/model.ts +1 -0
  23. package/src/utils/util.ts +8 -3
  24. package/dist/builders/borrowIncentiveBuilder.d.ts +0 -12
  25. package/dist/builders/coreBuilder.d.ts +0 -12
  26. package/dist/builders/index.d.ts +0 -12
  27. package/dist/builders/loyaltyProgramBuilder.d.ts +0 -12
  28. package/dist/builders/oracle.d.ts +0 -14
  29. package/dist/builders/referralBuilder.d.ts +0 -12
  30. package/dist/builders/sCoinBuilder.d.ts +0 -4
  31. package/dist/builders/spoolBuilder.d.ts +0 -12
  32. package/dist/builders/vescaBuilder.d.ts +0 -25
  33. package/dist/constants/cache.d.ts +0 -14
  34. package/dist/constants/coinGecko.d.ts +0 -2
  35. package/dist/constants/common.d.ts +0 -20
  36. package/dist/constants/enum.d.ts +0 -14
  37. package/dist/constants/flashloan.d.ts +0 -2
  38. package/dist/constants/index.d.ts +0 -13
  39. package/dist/constants/poolAddress.d.ts +0 -27
  40. package/dist/constants/pyth.d.ts +0 -5
  41. package/dist/constants/queryKeys.d.ts +0 -54
  42. package/dist/constants/rpc.d.ts +0 -1
  43. package/dist/constants/testAddress.d.ts +0 -2
  44. package/dist/constants/vesca.d.ts +0 -5
  45. package/dist/constants/xoracle.d.ts +0 -2
  46. package/dist/index.js.map +0 -1
  47. package/dist/index.mjs.map +0 -1
  48. package/dist/models/index.d.ts +0 -8
  49. package/dist/models/scallop.d.ts +0 -73
  50. package/dist/models/scallopAddress.d.ts +0 -150
  51. package/dist/models/scallopBuilder.d.ts +0 -90
  52. package/dist/models/scallopCache.d.ts +0 -81
  53. package/dist/models/scallopClient.d.ts +0 -321
  54. package/dist/models/scallopIndexer.d.ts +0 -90
  55. package/dist/models/scallopPrice.d.ts +0 -0
  56. package/dist/models/scallopQuery.d.ts +0 -704
  57. package/dist/models/scallopUtils.d.ts +0 -229
  58. package/dist/models/suiKit.d.ts +0 -2
  59. package/dist/queries/borrowIncentiveQuery.d.ts +0 -82
  60. package/dist/queries/borrowLimitQuery.d.ts +0 -9
  61. package/dist/queries/coreQuery.d.ts +0 -171
  62. package/dist/queries/index.d.ts +0 -15
  63. package/dist/queries/isolatedAssetQuery.d.ts +0 -14
  64. package/dist/queries/loyaltyProgramQuery.d.ts +0 -10
  65. package/dist/queries/objectsQuery.d.ts +0 -2
  66. package/dist/queries/poolAddressesQuery.d.ts +0 -29
  67. package/dist/queries/portfolioQuery.d.ts +0 -143
  68. package/dist/queries/priceQuery.d.ts +0 -58
  69. package/dist/queries/referralQuery.d.ts +0 -7
  70. package/dist/queries/sCoinQuery.d.ts +0 -41
  71. package/dist/queries/spoolQuery.d.ts +0 -74
  72. package/dist/queries/supplyLimitQuery.d.ts +0 -9
  73. package/dist/queries/vescaQuery.d.ts +0 -36
  74. package/dist/queries/xOracleQuery.d.ts +0 -13
  75. package/dist/types/address.d.ts +0 -108
  76. package/dist/types/builder/borrowIncentive.d.ts +0 -35
  77. package/dist/types/builder/core.d.ts +0 -56
  78. package/dist/types/builder/index.d.ts +0 -24
  79. package/dist/types/builder/loyaltyProgram.d.ts +0 -23
  80. package/dist/types/builder/referral.d.ts +0 -30
  81. package/dist/types/builder/sCoin.d.ts +0 -37
  82. package/dist/types/builder/spool.d.ts +0 -29
  83. package/dist/types/builder/vesca.d.ts +0 -51
  84. package/dist/types/constant/common.d.ts +0 -24
  85. package/dist/types/constant/enum.d.ts +0 -48
  86. package/dist/types/constant/index.d.ts +0 -3
  87. package/dist/types/constant/xOracle.d.ts +0 -9
  88. package/dist/types/index.d.ts +0 -6
  89. package/dist/types/model.d.ts +0 -60
  90. package/dist/types/query/borrowIncentive.d.ts +0 -124
  91. package/dist/types/query/core.d.ts +0 -380
  92. package/dist/types/query/index.d.ts +0 -7
  93. package/dist/types/query/loyaltyProgram.d.ts +0 -5
  94. package/dist/types/query/portfolio.d.ts +0 -119
  95. package/dist/types/query/sCoin.d.ts +0 -1
  96. package/dist/types/query/spool.d.ts +0 -142
  97. package/dist/types/query/vesca.d.ts +0 -26
  98. package/dist/types/utils.d.ts +0 -22
  99. package/dist/utils/builder.d.ts +0 -15
  100. package/dist/utils/core.d.ts +0 -2
  101. package/dist/utils/index.d.ts +0 -5
  102. package/dist/utils/indexer.d.ts +0 -17
  103. package/dist/utils/query.d.ts +0 -62
  104. package/dist/utils/util.d.ts +0 -27
@@ -1,704 +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, xOracleRules } 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: SuiObjectArg, args?: {
132
- version: SuiObjectArg;
133
- market: SuiObjectArg;
134
- }): Promise<import("../types").ObligationQueryInterface | undefined>;
135
- /**
136
- * Get all asset coin amounts.
137
- *
138
- * @param assetCoinNames - Specific an array of support asset coin name.
139
- * @param ownerAddress - The owner address.
140
- * @return All coin amounts.
141
- */
142
- getCoinAmounts(assetCoinNames?: SupportAssetCoins[], ownerAddress?: string): Promise<import("../types").OptionalKeys<Record<SupportAssetCoins, number>>>;
143
- /**
144
- * Get asset coin amount.
145
- *
146
- * @param assetCoinName - Specific support asset coin name.
147
- * @param ownerAddress - The owner address.
148
- * @return Coin amount.
149
- */
150
- getCoinAmount(assetCoinName: SupportAssetCoins, ownerAddress?: string): Promise<number>;
151
- /**
152
- * Get all market coin amounts.
153
- *
154
- * @param coinNames - Specific an array of support market coin name.
155
- * @param ownerAddress - The owner address.
156
- * @return All market market coin amounts.
157
- */
158
- getMarketCoinAmounts(marketCoinNames?: SupportMarketCoins[], ownerAddress?: string): Promise<import("../types").OptionalKeys<Record<SupportMarketCoins, number>>>;
159
- /**
160
- * Get market coin amount.
161
- *
162
- * @param coinNames - Specific support market coin name.
163
- * @param ownerAddress - The owner address.
164
- * @return Market market coin amount.
165
- */
166
- getMarketCoinAmount(marketCoinName: SupportMarketCoins, ownerAddress?: string): Promise<number>;
167
- /**
168
- * Get price from pyth fee object.
169
- *
170
- * @param assetCoinName - Specific support asset coin name.
171
- * @return Asset coin price.
172
- */
173
- getPriceFromPyth(assetCoinName: SupportAssetCoins): Promise<number>;
174
- /**
175
- * Get prices from pyth fee object.
176
- *
177
- * @param assetCoinNames - Array of supported asset coin names.
178
- * @return Array of asset coin prices.
179
- */
180
- getPricesFromPyth(assetCoinNames: SupportAssetCoins[]): Promise<Record<SupportAssetCoins, number>>;
181
- /**
182
- * Get spools data.
183
- *
184
- * @param stakeMarketCoinNames - Specific an array of support stake market coin name.
185
- * @param indexer - Whether to use indexer.
186
- * @return Spools data.
187
- */
188
- getSpools(stakeMarketCoinNames?: SupportStakeMarketCoins[], args?: {
189
- marketPools?: MarketPools;
190
- coinPrices?: CoinPrices;
191
- indexer?: boolean;
192
- }): Promise<{
193
- susdc?: import("../types").Spool | undefined;
194
- sweth?: import("../types").Spool | undefined;
195
- swusdc?: import("../types").Spool | undefined;
196
- swusdt?: import("../types").Spool | undefined;
197
- ssui?: import("../types").Spool | undefined;
198
- scetus?: import("../types").Spool | undefined;
199
- safsui?: import("../types").Spool | undefined;
200
- shasui?: import("../types").Spool | undefined;
201
- svsui?: import("../types").Spool | undefined;
202
- }>;
203
- /**
204
- * Get spool data.
205
- *
206
- * @param stakeMarketCoinName - Specific support stake market coin name.
207
- * @param indexer - Whether to use indexer.
208
- * @return Spool data.
209
- */
210
- getSpool(stakeMarketCoinName: SupportStakeMarketCoins, args?: {
211
- marketPool?: MarketPool;
212
- coinPrices?: CoinPrices;
213
- indexer?: boolean;
214
- }): Promise<import("../types").Spool | undefined>;
215
- /**
216
- * Get stake accounts data for all stake pools (spools).
217
- *
218
- * @param ownerAddress - The owner address.
219
- * @return All Stake accounts data.
220
- */
221
- getAllStakeAccounts(ownerAddress?: string): Promise<import("../types").StakeAccounts>;
222
- /**
223
- * Get stake accounts data for specific stake pool (spool).
224
- *
225
- * @param stakeMarketCoinName - Specific support stake market coin name.
226
- * @param ownerAddress - The owner address.
227
- * @return Stake accounts data.
228
- */
229
- getStakeAccounts(stakeMarketCoinName: SupportStakeMarketCoins, ownerAddress?: string): Promise<import("../types").StakeAccount[]>;
230
- /**
231
- * Get stake pools (spools) data.
232
- *
233
- * @description
234
- * For backward compatible, it is recommended to use `getSpools` method
235
- * to get all spools data.
236
- *
237
- * @param stakeMarketCoinNames - Specific an array of support stake market coin name.
238
- * @return Stake pools data.
239
- */
240
- getStakePools(stakeMarketCoinNames?: SupportStakeMarketCoins[]): Promise<{
241
- susdc?: import("../types").StakePool | undefined;
242
- sweth?: import("../types").StakePool | undefined;
243
- swusdc?: import("../types").StakePool | undefined;
244
- swusdt?: import("../types").StakePool | undefined;
245
- ssui?: import("../types").StakePool | undefined;
246
- scetus?: import("../types").StakePool | undefined;
247
- safsui?: import("../types").StakePool | undefined;
248
- shasui?: import("../types").StakePool | undefined;
249
- svsui?: import("../types").StakePool | undefined;
250
- }>;
251
- /**
252
- * Get stake pool (spool) data.
253
- *
254
- * @description
255
- * For backward compatible, it is recommended to use `getSpool` method
256
- * to get all spool data.
257
- *
258
- * @param stakeMarketCoinName - Specific support stake market coin name.
259
- * @return Stake pool data.
260
- */
261
- getStakePool(stakeMarketCoinName: SupportStakeMarketCoins): Promise<import("../types").StakePool | undefined>;
262
- /**
263
- * Get stake reward pools data.
264
- *
265
- * @description
266
- * For backward compatible, it is recommended to use `getSpools` method
267
- * to get all spools data.
268
- *
269
- * @param stakeMarketCoinNames - Specific an array of stake market coin name.
270
- * @return Stake reward pools data.
271
- */
272
- getStakeRewardPools(stakeMarketCoinNames?: SupportStakeMarketCoins[]): Promise<{
273
- susdc?: import("../types").StakeRewardPool | undefined;
274
- sweth?: import("../types").StakeRewardPool | undefined;
275
- swusdc?: import("../types").StakeRewardPool | undefined;
276
- swusdt?: import("../types").StakeRewardPool | undefined;
277
- ssui?: import("../types").StakeRewardPool | undefined;
278
- scetus?: import("../types").StakeRewardPool | undefined;
279
- safsui?: import("../types").StakeRewardPool | undefined;
280
- shasui?: import("../types").StakeRewardPool | undefined;
281
- svsui?: import("../types").StakeRewardPool | undefined;
282
- }>;
283
- /**
284
- * Get stake reward pool data.
285
- *
286
- * @description
287
- * For backward compatible, it is recommended to use `getSpool` method
288
- * to get spool data.
289
- *
290
- * @param marketCoinName - Specific support stake market coin name.
291
- * @return Stake reward pool data.
292
- */
293
- getStakeRewardPool(stakeMarketCoinName: SupportStakeMarketCoins): Promise<import("../types").StakeRewardPool | undefined>;
294
- /**
295
- * Get borrow incentive pools data.
296
- *
297
- * @param coinNames - Specific an array of support borrow incentive coin name.
298
- * @param indexer - Whether to use indexer.
299
- * @return Borrow incentive pools data.
300
- */
301
- getBorrowIncentivePools(coinNames?: SupportBorrowIncentiveCoins[], args?: {
302
- coinPrices?: CoinPrices;
303
- indexer?: boolean;
304
- marketPools?: MarketPools;
305
- }): Promise<{
306
- usdc?: import("../types").BorrowIncentivePool | undefined;
307
- sbeth?: import("../types").BorrowIncentivePool | undefined;
308
- sbusdt?: import("../types").BorrowIncentivePool | undefined;
309
- sbwbtc?: import("../types").BorrowIncentivePool | undefined;
310
- weth?: import("../types").BorrowIncentivePool | undefined;
311
- wbtc?: import("../types").BorrowIncentivePool | undefined;
312
- wusdc?: import("../types").BorrowIncentivePool | undefined;
313
- wusdt?: import("../types").BorrowIncentivePool | undefined;
314
- sui?: import("../types").BorrowIncentivePool | undefined;
315
- wapt?: import("../types").BorrowIncentivePool | undefined;
316
- wsol?: import("../types").BorrowIncentivePool | undefined;
317
- cetus?: import("../types").BorrowIncentivePool | undefined;
318
- afsui?: import("../types").BorrowIncentivePool | undefined;
319
- hasui?: import("../types").BorrowIncentivePool | undefined;
320
- vsui?: import("../types").BorrowIncentivePool | undefined;
321
- sca?: import("../types").BorrowIncentivePool | undefined;
322
- fud?: import("../types").BorrowIncentivePool | undefined;
323
- deep?: import("../types").BorrowIncentivePool | undefined;
324
- fdusd?: import("../types").BorrowIncentivePool | undefined;
325
- blub?: import("../types").BorrowIncentivePool | undefined;
326
- }>;
327
- /**
328
- * Get borrow incentive accounts data.
329
- *
330
- * @param coinNames - Specific support borrow incentive coin name.
331
- * @param ownerAddress - The owner address.
332
- * @return Borrow incentive accounts data.
333
- */
334
- getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef, coinNames?: SupportBorrowIncentiveCoins[]): Promise<{
335
- usdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
336
- sbeth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
337
- sbusdt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
338
- sbwbtc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
339
- weth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
340
- wbtc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
341
- wusdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
342
- wusdt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
343
- sui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
344
- wapt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
345
- wsol?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
346
- cetus?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
347
- afsui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
348
- hasui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
349
- vsui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
350
- sca?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
351
- fud?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
352
- deep?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
353
- fdusd?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
354
- blub?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
355
- }>;
356
- /**
357
- * Get user lending and spool infomation for specific pools.
358
- *
359
- * @param poolCoinNames - Specific an array of support pool coin name.
360
- * @param ownerAddress - The owner address.
361
- * @param indexer - Whether to use indexer.
362
- * @return All lending and spool infomation.
363
- */
364
- getLendings(poolCoinNames?: SupportPoolCoins[], ownerAddress?: string, args?: {
365
- indexer?: boolean;
366
- marketPools?: MarketPools;
367
- coinPrices?: CoinPrices;
368
- }): Promise<{
369
- usdc?: import("../types").Lending | undefined;
370
- sbeth?: import("../types").Lending | undefined;
371
- sbusdt?: import("../types").Lending | undefined;
372
- sbwbtc?: import("../types").Lending | undefined;
373
- weth?: import("../types").Lending | undefined;
374
- wbtc?: import("../types").Lending | undefined;
375
- wusdc?: import("../types").Lending | undefined;
376
- wusdt?: import("../types").Lending | undefined;
377
- sui?: import("../types").Lending | undefined;
378
- wapt?: import("../types").Lending | undefined;
379
- wsol?: import("../types").Lending | undefined;
380
- cetus?: import("../types").Lending | undefined;
381
- afsui?: import("../types").Lending | undefined;
382
- hasui?: import("../types").Lending | undefined;
383
- vsui?: import("../types").Lending | undefined;
384
- sca?: import("../types").Lending | undefined;
385
- fud?: import("../types").Lending | undefined;
386
- deep?: import("../types").Lending | undefined;
387
- fdusd?: import("../types").Lending | undefined;
388
- blub?: 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", 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", 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 supported pool price from indexer
544
- * @returns prices data
545
- */
546
- getCoinPricesByIndexer(): Promise<Record<string, number>>;
547
- /**
548
- * Get all coin prices, including sCoin
549
- * @returns prices data
550
- */
551
- getAllCoinPrices(args?: {
552
- marketPools?: MarketPools;
553
- coinPrices?: CoinPrices;
554
- indexer?: boolean;
555
- }): Promise<{
556
- susdc?: number | undefined;
557
- ssbeth?: number | undefined;
558
- ssbusdt?: number | undefined;
559
- ssbwbtc?: number | undefined;
560
- sweth?: number | undefined;
561
- swbtc?: number | undefined;
562
- swusdc?: number | undefined;
563
- swusdt?: number | undefined;
564
- ssui?: number | undefined;
565
- swsol?: number | undefined;
566
- scetus?: number | undefined;
567
- safsui?: number | undefined;
568
- shasui?: number | undefined;
569
- svsui?: number | undefined;
570
- ssca?: number | undefined;
571
- sfud?: number | undefined;
572
- sdeep?: number | undefined;
573
- sfdusd?: number | undefined;
574
- sblub?: number | undefined;
575
- usdc?: number | undefined;
576
- sbeth?: number | undefined;
577
- sbusdt?: number | undefined;
578
- sbwbtc?: number | undefined;
579
- weth?: number | undefined;
580
- wbtc?: number | undefined;
581
- wusdc?: number | undefined;
582
- wusdt?: number | undefined;
583
- sui?: number | undefined;
584
- wapt?: number | undefined;
585
- wsol?: number | undefined;
586
- cetus?: number | undefined;
587
- afsui?: number | undefined;
588
- hasui?: number | undefined;
589
- vsui?: number | undefined;
590
- sca?: number | undefined;
591
- fud?: number | undefined;
592
- deep?: number | undefined;
593
- fdusd?: number | undefined;
594
- blub?: number | undefined;
595
- swapt?: number | undefined;
596
- }>;
597
- /**
598
- * Query all address (lending pool, collateral pool, borrow dynamics, interest models, etc.) of all pool
599
- * @returns
600
- */
601
- getPoolAddresses(poolNames?: 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", {
602
- coinName: string;
603
- symbol: string;
604
- lendingPoolAddress?: string;
605
- collateralPoolAddress?: string;
606
- borrowDynamic?: string;
607
- spoolReward?: string;
608
- spool?: string;
609
- sCoinType?: string;
610
- sCoinName?: string;
611
- sCoinSymbol?: string;
612
- sCoinTreasury?: string;
613
- interestModel?: string;
614
- riskModel?: string;
615
- borrowFeeKey?: string;
616
- supplyLimitKey?: string;
617
- borrowLimitKey?: string;
618
- isolatedAssetKey?: string;
619
- coinMetadataId?: string;
620
- borrowIncentivePoolId?: string;
621
- coinType?: string;
622
- sCoinMetadataId?: string;
623
- spoolName?: string;
624
- decimals: number;
625
- pythFeed?: string;
626
- pythFeedObjectId?: string;
627
- }>>>;
628
- /**
629
- * Get user portfolio
630
- */
631
- getUserPortfolio(args?: {
632
- walletAddress?: string;
633
- indexer?: boolean;
634
- }): Promise<{
635
- totalLockedScaValue: number;
636
- lendings: {
637
- suppliedCoin: number;
638
- suppliedValue: number;
639
- stakedCoin: number;
640
- coinName: "usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub";
641
- symbol: string;
642
- coinType: string;
643
- coinPrice: number;
644
- coinDecimals: number;
645
- supplyApr: number;
646
- supplyApy: number;
647
- incentiveApr: number;
648
- }[];
649
- borrowings: {
650
- obligationId: string;
651
- totalDebtsInUsd: number;
652
- totalCollateralInUsd: number;
653
- riskLevel: number;
654
- availableCollateralInUsd: number;
655
- totalUnhealthyCollateralInUsd: number;
656
- borrowedPools: {
657
- coinName: "usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub";
658
- symbol: string;
659
- coinDecimals: number;
660
- coinType: string;
661
- coinPrice: number;
662
- borrowedCoin: number;
663
- borrowedValueInUsd: number;
664
- borrowApr: number | undefined;
665
- borrowApy: number | undefined;
666
- incentiveInfos: {
667
- coinName: "usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub" | "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub";
668
- symbol: string;
669
- coinType: string;
670
- incentiveApr: number;
671
- }[];
672
- }[];
673
- }[];
674
- pendingRewards: {
675
- lendings: any;
676
- borrowIncentives: any;
677
- };
678
- veScas: {
679
- veScaKey: string;
680
- coinPrice: number;
681
- lockedScaInCoin: number;
682
- lockedScaInUsd: number;
683
- currentVeScaBalance: number;
684
- remainingLockPeriodInDays: number;
685
- unlockAt: number;
686
- }[];
687
- totalDebtValue: number;
688
- totalCollateralValue: number;
689
- totalSupplyValue: number;
690
- }>;
691
- /**
692
- * Get both primary and secondary price update policy objects
693
- * @returns price update policies
694
- */
695
- getPriceUpdatePolicies(): Promise<{
696
- primary: import("@mysten/sui/client").SuiObjectResponse | null;
697
- secondary: import("@mysten/sui/client").SuiObjectResponse | null;
698
- }>;
699
- /**
700
- * Return the supported primary and secondary oracles for all supported pool assets
701
- * @returns
702
- */
703
- getAssetOracles(): Promise<Record<SupportAssetCoins, xOracleRules>>;
704
- }