@scallop-io/sui-scallop-sdk 2.3.0-lst-x-oracle-alpha.8 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/index.d.mts +1811 -1750
  2. package/dist/index.d.ts +1811 -1750
  3. package/dist/index.js +49 -2
  4. package/dist/index.mjs +15 -2
  5. package/package.json +8 -5
  6. package/src/builders/borrowIncentiveBuilder.ts +4 -4
  7. package/src/builders/coreBuilder.ts +86 -59
  8. package/src/builders/index.ts +2 -2
  9. package/src/builders/loyaltyProgramBuilder.ts +2 -2
  10. package/src/builders/oracles/index.ts +365 -114
  11. package/src/builders/oracles/pyth.ts +135 -0
  12. package/src/builders/referralBuilder.ts +4 -10
  13. package/src/builders/sCoinBuilder.ts +2 -6
  14. package/src/builders/spoolBuilder.ts +2 -2
  15. package/src/builders/vescaBuilder.ts +5 -5
  16. package/src/constants/common.ts +3 -0
  17. package/src/constants/index.ts +1 -1
  18. package/src/constants/queryKeys.ts +1 -1
  19. package/src/constants/testAddress.ts +95 -183
  20. package/src/constants/xoracle.ts +2 -8
  21. package/src/index.ts +1 -1
  22. package/src/models/index.ts +1 -2
  23. package/src/models/interface.ts +6 -6
  24. package/src/models/rateLimiter.ts +55 -0
  25. package/src/models/scallop.ts +1 -1
  26. package/src/models/scallopAddress.ts +5 -25
  27. package/src/models/scallopBuilder.ts +14 -11
  28. package/src/models/scallopClient.ts +31 -14
  29. package/src/models/scallopConstants.ts +3 -3
  30. package/src/models/scallopIndexer.ts +3 -4
  31. package/src/models/scallopQuery.ts +112 -56
  32. package/src/models/scallopQueryClient.ts +1 -1
  33. package/src/models/scallopSuiKit.ts +1 -1
  34. package/src/models/scallopUtils.ts +12 -7
  35. package/src/queries/borrowIncentiveQuery.ts +4 -3
  36. package/src/queries/coreQuery.ts +114 -186
  37. package/src/queries/index.ts +3 -4
  38. package/src/queries/loyaltyProgramQuery.ts +2 -2
  39. package/src/queries/ownerQuery.ts +32 -0
  40. package/src/queries/poolAddressesQuery.ts +1 -3
  41. package/src/queries/portfolioQuery.ts +68 -16
  42. package/src/queries/priceQuery.ts +2 -3
  43. package/src/queries/sCoinQuery.ts +2 -2
  44. package/src/queries/spoolQuery.ts +57 -74
  45. package/src/queries/vescaQuery.ts +3 -3
  46. package/src/queries/xOracleQuery.ts +4 -21
  47. package/src/types/address.ts +47 -85
  48. package/src/types/builder/core.ts +40 -15
  49. package/src/types/builder/index.ts +17 -1
  50. package/src/types/constant/enum.ts +64 -0
  51. package/src/types/constant/index.ts +1 -2
  52. package/src/types/constant/xOracle.ts +7 -10
  53. package/src/types/index.ts +1 -1
  54. package/src/types/query/core.ts +3 -0
  55. package/src/types/query/index.ts +1 -0
  56. package/src/types/query/sCoin.ts +1 -0
  57. package/src/{builders/utils.ts → utils/builder.ts} +1 -1
  58. package/src/utils/core.ts +18 -0
  59. package/src/utils/index.ts +5 -0
  60. package/src/utils/indexer.ts +47 -0
  61. package/src/{queries/utils.ts → utils/query.ts} +7 -25
  62. package/src/utils/util.ts +42 -0
  63. package/src/builders/oracles/error.ts +0 -29
  64. package/src/builders/oracles/oraclePackageRegistry.ts +0 -322
  65. package/src/builders/oracles/priceFeedUpdater.ts +0 -112
  66. package/src/builders/oracles/priceUpdateRequester.ts +0 -50
  67. package/src/builders/oracles/xOracleUpdateStrategy.ts +0 -178
  68. package/src/builders/oracles/xOracleUpdater.ts +0 -160
  69. package/src/constants/api.ts +0 -2
  70. package/src/models/utils.ts +0 -97
  71. package/src/types/builder/type.ts +0 -25
  72. package/src/types/constant/package.ts +0 -16
  73. /package/src/types/{util.ts → utils.ts} +0 -0
package/dist/index.d.mts CHANGED
@@ -1,15 +1,12 @@
1
1
  import * as _mysten_sui_dist_cjs_client from '@mysten/sui/dist/cjs/client';
2
- import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectRef as SuiObjectRef$1 } from '@mysten/sui/dist/cjs/client';
2
+ import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectRef } from '@mysten/sui/dist/cjs/client';
3
3
  import * as _scallop_io_sui_kit from '@scallop-io/sui-kit';
4
- import { SuiObjectArg, SuiTxArg, NetworkType, SuiKit, SuiKitParams, Transaction, SuiTxBlock, DerivePathParams, SuiAddressArg, TransactionResult as TransactionResult$1, SuiVecTxArg, SuiAmountsArg } from '@scallop-io/sui-kit';
4
+ import { SuiObjectArg, SuiTxArg, NetworkType, SuiKit, Transaction, SuiTxBlock, DerivePathParams, SuiKitParams, SuiVecTxArg, SuiAmountsArg, SuiAddressArg, TransactionResult as TransactionResult$1 } from '@scallop-io/sui-kit';
5
5
  import * as _tanstack_query_core from '@tanstack/query-core';
6
6
  import { QueryClient, QueryClientConfig, QueryKey } from '@tanstack/query-core';
7
7
  import { AxiosInstance, AxiosResponse, AxiosRequestConfig } from 'axios';
8
- import { SuiObjectRef, SuiObjectDataOptions as SuiObjectDataOptions$1, SuiObjectResponse, SuiObjectData as SuiObjectData$1, GetOwnedObjectsParams as GetOwnedObjectsParams$1, GetDynamicFieldsParams as GetDynamicFieldsParams$1, DynamicFieldPage, GetDynamicFieldObjectParams as GetDynamicFieldObjectParams$1, CoinBalance, GetBalanceParams, DevInspectResults, SuiTransactionBlockResponse } from '@mysten/sui/client';
9
- import { Argument, TransactionResult, Transaction as Transaction$1, TransactionObjectArgument } from '@mysten/sui/transactions';
10
-
11
- declare const API_BASE_URL: "https://sui.apis.scallop.io";
12
- declare const SDK_API_BASE_URL: "https://sdk.api.scallop.io";
8
+ import { SuiObjectDataOptions as SuiObjectDataOptions$1, SuiObjectResponse, SuiObjectData as SuiObjectData$1, GetOwnedObjectsParams as GetOwnedObjectsParams$1, GetDynamicFieldsParams as GetDynamicFieldsParams$1, DynamicFieldPage, GetDynamicFieldObjectParams as GetDynamicFieldObjectParams$1, CoinBalance, GetBalanceParams, DevInspectResults, SuiTransactionBlockResponse, SuiObjectRef as SuiObjectRef$1 } from '@mysten/sui/client';
9
+ import { Transaction as Transaction$1, TransactionObjectArgument, TransactionResult, Argument } from '@mysten/sui/transactions';
13
10
 
14
11
  /**
15
12
  * Default cache options for the QueryClient.
@@ -26,6 +23,8 @@ declare const DEFAULT_CACHE_OPTIONS: {
26
23
  };
27
24
  };
28
25
 
26
+ declare const API_BASE_URL: "https://sui.apis.scallop.io";
27
+ declare const SDK_API_BASE_URL: "https://sdk.api.scallop.io";
29
28
  declare const IS_VE_SCA_TEST: boolean;
30
29
  declare const USE_TEST_ADDRESS: boolean;
31
30
  declare const SCA_COIN_TYPE: "0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA" | "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
@@ -77,7 +76,7 @@ declare const queryKeys: {
77
76
  getPoolAddresses: () => string[];
78
77
  getMarket: () => string[];
79
78
  getSpools: () => string[];
80
- getBorrowIncentivePool: () => string[];
79
+ getBorrowIncentivePools: () => string[];
81
80
  getTotalValueLocked: () => string[];
82
81
  };
83
82
  rpc: {
@@ -110,458 +109,53 @@ declare const queryKeys: {
110
109
 
111
110
  declare const RPC_PROVIDERS: string[];
112
111
 
113
- declare const SUPPORT_ORACLES: readonly ["supra", "switchboard", "pyth"];
114
- declare const X_ORACLE_RULES: readonly ["primary", "secondary"];
115
- declare const SUPPORT_ORACLE_LST: readonly ["pyth"];
116
- declare const SUPPORT_SUI_LST: readonly ["afsui"];
117
- declare const X_ORACLE_LIST: Record<string, Record<(typeof X_ORACLE_RULES)[number], (typeof SUPPORT_ORACLES)[number][]>>;
118
-
119
- type SupportOracleType = (typeof SUPPORT_ORACLES)[number];
120
- type xOracleRuleType = (typeof X_ORACLE_RULES)[number];
121
- type xOracleRules = Record<xOracleRuleType, SupportOracleType[]>;
122
- type xOracleListType = {
123
- [key in string]: xOracleRules;
112
+ type ScallopQueryClientParams = {
113
+ queryClient?: QueryClient;
114
+ queryClientConfig?: QueryClientConfig;
124
115
  };
125
- type SupportedOracleSuiLst = (typeof SUPPORT_SUI_LST)[number];
126
-
127
- declare const _PACKAGE_NAMES: readonly ["coinDecimalsRegistry", "math", "whitelist", "x", "protocol", "protocolWhitelist", "query", "supra", "pyth", "switchboard", "xOracle", "testCoin"];
128
- type PackageName = (typeof _PACKAGE_NAMES)[number];
129
-
130
- type BasePackage = {
131
- id: string;
132
- object?: string;
133
- upgradeCap?: string;
134
- };
135
- type OracleLstPackage = {
136
- [K in SupportedOracleSuiLst]: BasePackage;
137
- };
138
- type OraclePackage<T> = BasePackage & T extends SupportOracleLst ? BasePackage & {
139
- lst: OracleLstPackage;
140
- } : BasePackage;
141
- type Packages<T extends SupportOracleType | PackageName = SupportOracleType | PackageName> = T extends SupportOracleType ? Record<T, OraclePackage<T>> : T extends PackageName ? Record<T, BasePackage> : never;
142
- type SupportOracleLst = (typeof SUPPORT_ORACLE_LST)[number];
143
- type OracleLstConfig<T extends SupportedOracleSuiLst> = T extends 'afsui' ? Record<T, {
144
- stakedSuiVaultId: string;
145
- safeId: string;
146
- configId: string;
147
- }> : never;
148
- type OracleLst<T extends SupportOracleLst, U extends SupportedOracleSuiLst = SupportedOracleSuiLst> = T extends 'pyth' ? OracleLstConfig<U> : undefined;
149
- type MaybeWithOracleLst<T, U> = T extends SupportOracleLst ? U & {
150
- lst: OracleLst<T>;
151
- } : U;
152
- interface AddressesInterface {
153
- id?: string;
154
- core: {
155
- version: string;
156
- versionCap: string;
157
- object: string;
158
- market: string;
159
- adminCap: string;
160
- coinDecimalsRegistry: string;
161
- obligationAccessStore: string;
162
- coins: Partial<Record<string, {
163
- id: string;
164
- treasury: string;
165
- metaData: string;
166
- coinType: string;
167
- symbol: string;
168
- decimals: number;
169
- oracle: {
170
- [K in SupportOracleType]: K extends (typeof SUPPORT_ORACLES)[0] ? string : K extends (typeof SUPPORT_ORACLES)[1] ? string : K extends (typeof SUPPORT_ORACLES)[2] ? {
171
- feed: string;
172
- feedObject: string;
173
- } : never;
116
+ declare class ScallopQueryClient {
117
+ private _queryClient;
118
+ constructor(params?: ScallopQueryClientParams);
119
+ get queryClient(): QueryClient;
120
+ set queryClient(queryClient: QueryClient);
121
+ get defaultQueryClientConfig(): {
122
+ defaultOptions: {
123
+ queries: {
124
+ staleTime: number;
125
+ gcTime: number;
174
126
  };
175
- }>>;
176
- oracles: {
177
- [K in SupportOracleType]: K extends (typeof SUPPORT_ORACLES)[0] ? MaybeWithOracleLst<K, {
178
- registry: string;
179
- registryCap: string;
180
- holder: string;
181
- }> : K extends (typeof SUPPORT_ORACLES)[1] ? MaybeWithOracleLst<K, {
182
- registry: string;
183
- registryCap: string;
184
- registryTableId: string;
185
- state: string;
186
- }> : K extends (typeof SUPPORT_ORACLES)[2] ? MaybeWithOracleLst<K, {
187
- registry: string;
188
- registryCap: string;
189
- state: string;
190
- wormhole: string;
191
- wormholeState: string;
192
- }> : never;
193
- } & {
194
- xOracle: string;
195
- xOracleCap: string;
196
- primaryPriceUpdatePolicyObject: string;
197
- secondaryPriceUpdatePolicyObject: string;
198
- primaryPriceUpdatePolicyVecsetId: string;
199
- secondaryPriceUpdatePolicyVecsetId: string;
200
127
  };
201
- packages: Packages;
202
- };
203
- spool: {
204
- id: string;
205
- adminCap: string;
206
- object: string;
207
- config: string;
208
- pools: Partial<Record<string, {
209
- id: string;
210
- rewardPoolId: string;
211
- }>>;
212
- };
213
- borrowIncentive: {
214
- id: string;
215
- adminCap: string;
216
- object: string;
217
- query: string;
218
- config: string;
219
- incentivePools: string;
220
- incentiveAccounts: string;
221
- };
222
- vesca: {
223
- id: string;
224
- object: string;
225
- adminCap: string;
226
- tableId: string;
227
- table: string;
228
- treasury: string;
229
- config: string;
230
- subsTable: string;
231
- subsTableId: string;
232
- subsWhitelist: string;
233
- };
234
- referral: {
235
- id: string;
236
- version: string;
237
- object: string;
238
- adminCap: string;
239
- referralBindings: string;
240
- bindingTableId: string;
241
- referralRevenuePool: string;
242
- revenueTableId: string;
243
- referralTiers: string;
244
- tiersTableId: string;
245
- authorizedWitnessList: string;
246
- };
247
- loyaltyProgram: {
248
- id: string;
249
- adminCap?: string;
250
- object: string;
251
- rewardPool: string;
252
- userRewardTableId: string;
253
- };
254
- veScaLoyaltyProgram: {
255
- id: string;
256
- adminCap?: string;
257
- object: string;
258
- veScaRewardPool: string;
259
- veScaRewardTableId: string;
260
- };
261
- scoin: {
262
- id: string;
263
- coins: Partial<Record<string, {
264
- coinType: string;
265
- symbol: string;
266
- treasury: string;
267
- metaData: string;
268
- }>>;
269
128
  };
270
129
  }
271
- type Paths<T> = T extends object ? {
272
- [K in Extract<keyof T, string>]: T[K] extends object ? K | `${K}.${Paths<T[K]>}` : K;
273
- }[Extract<keyof T, string>] : never;
274
- type AddressStringPath = Paths<AddressesInterface>;
275
130
 
276
- declare const TEST_ADDRESSES: AddressesInterface;
277
- declare const TEST_WHITELIST: {
278
- lending: Set<string>;
279
- collateral: Set<string>;
280
- borrowing: Set<string>;
281
- packages: Set<string>;
282
- spool: Set<string>;
283
- scoin: Set<string>;
284
- suiBridge: Set<string>;
285
- wormhole: Set<string>;
286
- oracles: Set<string>;
287
- pythEndpoints: Set<string>;
288
- deprecated: Set<string>;
289
- borrowIncentiveRewards: Set<string>;
290
- rewardsAsPoint: Set<string>;
291
- emerging: Set<string>;
292
- };
293
- declare const TEST_POOL_ADDRESSES: {
294
- usdc: {
295
- coinName: string;
296
- symbol: string;
297
- lendingPoolAddress: string;
298
- collateralPoolAddress: string;
299
- borrowDynamic: string;
300
- interestModel: string;
301
- riskModel: string;
302
- borrowFeeKey: string;
303
- supplyLimitKey: string;
304
- borrowLimitKey: string;
305
- isolatedAssetKey: string;
306
- isIsolated: boolean;
307
- spool: string;
308
- spoolReward: string;
309
- sCoinType: string;
310
- sCoinTreasury: string;
311
- sCoinMetadataId: string;
312
- sCoinSymbol: string;
313
- sCoinName: string;
314
- coinMetadataId: string;
315
- coinType: string;
316
- spoolName: string;
317
- decimals: number;
318
- pythFeed: string;
319
- pythFeedObjectId: string;
320
- flashloanFeeObject: string;
131
+ type ScallopAxiosParams = {
132
+ baseUrl?: string;
133
+ axiosInstance?: AxiosInstance;
134
+ axiosTimeout?: number;
135
+ } & ScallopQueryClientParams;
136
+ declare class ScallopAxios extends ScallopQueryClient {
137
+ readonly axiosInstance: AxiosInstance;
138
+ constructor(params?: ScallopAxiosParams);
139
+ post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
140
+ post<T = any, R = AxiosResponse<T>, D = any>(url: string, queryKey: QueryKey, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
141
+ get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
142
+ get<T = any, R = AxiosResponse<T>, D = any>(url: string, queryKey: QueryKey, config?: AxiosRequestConfig<D>): Promise<R>;
143
+ put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
144
+ put<T = any, R = AxiosResponse<T>, D = any>(url: string, queryKey: QueryKey, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
145
+ delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
146
+ delete<T = any, R = AxiosResponse<T>, D = any>(url: string, queryKey: QueryKey, config?: AxiosRequestConfig<D>): Promise<R>;
147
+ }
148
+
149
+ type ScallopAddressParams = {
150
+ addressId?: string;
151
+ urls?: {
152
+ addresses?: string[];
321
153
  };
322
- sui: {
323
- coinName: string;
324
- symbol: string;
325
- lendingPoolAddress: string;
326
- collateralPoolAddress: string;
327
- borrowDynamic: string;
328
- interestModel: string;
329
- riskModel: string;
330
- borrowFeeKey: string;
331
- supplyLimitKey: string;
332
- borrowLimitKey: string;
333
- isolatedAssetKey: string;
334
- isIsolated: boolean;
335
- spool: string;
336
- spoolReward: string;
337
- sCoinType: string;
338
- sCoinTreasury: string;
339
- sCoinMetadataId: string;
340
- sCoinSymbol: string;
341
- sCoinName: string;
342
- coinMetadataId: string;
343
- coinType: string;
344
- spoolName: string;
345
- decimals: number;
346
- pythFeed: string;
347
- pythFeedObjectId: string;
348
- flashloanFeeObject: string;
349
- };
350
- sca: {
351
- coinName: string;
352
- symbol: string;
353
- lendingPoolAddress: string;
354
- collateralPoolAddress: string;
355
- borrowDynamic: string;
356
- interestModel: string;
357
- riskModel: string;
358
- borrowFeeKey: string;
359
- supplyLimitKey: string;
360
- borrowLimitKey: string;
361
- isolatedAssetKey: string;
362
- isIsolated: boolean;
363
- spool: string;
364
- spoolReward: string;
365
- sCoinType: string;
366
- sCoinTreasury: string;
367
- sCoinMetadataId: string;
368
- sCoinSymbol: string;
369
- sCoinName: string;
370
- coinMetadataId: string;
371
- coinType: string;
372
- spoolName: string;
373
- decimals: number;
374
- pythFeed: string;
375
- pythFeedObjectId: string;
376
- flashloanFeeObject: string;
377
- };
378
- fud: {
379
- coinName: string;
380
- symbol: string;
381
- lendingPoolAddress: string;
382
- collateralPoolAddress: string;
383
- borrowDynamic: string;
384
- interestModel: string;
385
- borrowFeeKey: string;
386
- supplyLimitKey: string;
387
- borrowLimitKey: string;
388
- isolatedAssetKey: string;
389
- isIsolated: boolean;
390
- spool: string;
391
- spoolReward: string;
392
- sCoinType: string;
393
- sCoinTreasury: string;
394
- sCoinMetadataId: string;
395
- sCoinSymbol: string;
396
- sCoinName: string;
397
- coinMetadataId: string;
398
- coinType: string;
399
- spoolName: string;
400
- decimals: number;
401
- pythFeed: string;
402
- pythFeedObjectId: string;
403
- flashloanFeeObject: string;
404
- };
405
- deep: {
406
- coinName: string;
407
- symbol: string;
408
- lendingPoolAddress: string;
409
- collateralPoolAddress: string;
410
- borrowDynamic: string;
411
- interestModel: string;
412
- borrowFeeKey: string;
413
- supplyLimitKey: string;
414
- borrowLimitKey: string;
415
- isolatedAssetKey: string;
416
- isIsolated: boolean;
417
- spool: string;
418
- spoolReward: string;
419
- sCoinType: string;
420
- sCoinTreasury: string;
421
- sCoinMetadataId: string;
422
- sCoinSymbol: string;
423
- sCoinName: string;
424
- coinMetadataId: string;
425
- coinType: string;
426
- spoolName: string;
427
- decimals: number;
428
- pythFeed: string;
429
- pythFeedObjectId: string;
430
- flashloanFeeObject: string;
431
- };
432
- afsui: {
433
- coinName: string;
434
- symbol: string;
435
- lendingPoolAddress: string;
436
- collateralPoolAddress: string;
437
- borrowDynamic: string;
438
- interestModel: string;
439
- riskModel: string;
440
- borrowFeeKey: string;
441
- supplyLimitKey: string;
442
- borrowLimitKey: string;
443
- isolatedAssetKey: string;
444
- isIsolated: boolean;
445
- spool: string;
446
- spoolReward: string;
447
- sCoinType: string;
448
- sCoinTreasury: string;
449
- sCoinMetadataId: string;
450
- sCoinSymbol: string;
451
- sCoinName: string;
452
- coinMetadataId: string;
453
- coinType: string;
454
- spoolName: string;
455
- decimals: number;
456
- pythFeed: string;
457
- pythFeedObjectId: string;
458
- flashloanFeeObject: string;
459
- };
460
- };
461
-
462
- declare const UNLOCK_ROUND_DURATION: number;
463
- declare const MAX_LOCK_ROUNDS: 1460;
464
- declare const MAX_LOCK_DURATION: number;
465
- declare const MIN_INITIAL_LOCK_AMOUNT: 10000000000;
466
- declare const MIN_TOP_UP_AMOUNT: 1000000000;
467
-
468
- type PoolAddress = {
469
- coinName: string;
470
- symbol: string;
471
- coinType: string;
472
- coinMetadataId: string;
473
- decimals: number;
474
- isIsolated: boolean;
475
- pythFeed?: string;
476
- pythFeedObjectId?: string;
477
- lendingPoolAddress?: string;
478
- borrowDynamic?: string;
479
- interestModel?: string;
480
- borrowFeeKey?: string;
481
- flashloanFeeObject?: string;
482
- coinGeckoId?: string;
483
- collateralPoolAddress?: string;
484
- riskModel?: string;
485
- supplyLimitKey?: string;
486
- borrowLimitKey?: string;
487
- sCoinType?: string;
488
- sCoinName?: string;
489
- sCoinSymbol?: string;
490
- sCoinMetadataId?: string;
491
- sCoinTreasury?: string;
492
- isolatedAssetKey: string;
493
- spool?: string;
494
- spoolReward?: string;
495
- spoolName?: string;
496
- };
497
- type Whitelist = {
498
- lending: Set<string>;
499
- borrowing: Set<string>;
500
- collateral: Set<string>;
501
- packages: Set<string>;
502
- spool: Set<string>;
503
- scoin: Set<string>;
504
- suiBridge: Set<string>;
505
- wormhole: Set<string>;
506
- oracles: Set<string>;
507
- borrowIncentiveRewards: Set<string>;
508
- rewardsAsPoint: Set<string>;
509
- pythEndpoints: Set<string>;
510
- deprecated: Set<string>;
511
- emerging: Set<string>;
512
- };
513
- type CoinWrappedType = {
514
- from: string;
515
- type: string;
516
- } | undefined;
517
-
518
- type ScallopQueryClientParams = {
519
- queryClient?: QueryClient;
520
- queryClientConfig?: QueryClientConfig;
521
- };
522
- declare class ScallopQueryClient {
523
- private _queryClient;
524
- constructor(params?: ScallopQueryClientParams);
525
- get queryClient(): QueryClient;
526
- set queryClient(queryClient: QueryClient);
527
- get defaultQueryClientConfig(): {
528
- defaultOptions: {
529
- queries: {
530
- staleTime: number;
531
- gcTime: number;
532
- };
533
- };
534
- };
535
- }
536
-
537
- type ScallopAxiosParams = {
538
- baseUrl?: string;
539
- axiosInstance?: AxiosInstance;
540
- axiosTimeout?: number;
541
- } & ScallopQueryClientParams;
542
- declare class ScallopAxios extends ScallopQueryClient {
543
- readonly axiosInstance: AxiosInstance;
544
- constructor(params?: ScallopAxiosParams);
545
- post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
546
- post<T = any, R = AxiosResponse<T>, D = any>(url: string, queryKey: QueryKey, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
547
- get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
548
- get<T = any, R = AxiosResponse<T>, D = any>(url: string, queryKey: QueryKey, config?: AxiosRequestConfig<D>): Promise<R>;
549
- put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
550
- put<T = any, R = AxiosResponse<T>, D = any>(url: string, queryKey: QueryKey, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
551
- delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
552
- delete<T = any, R = AxiosResponse<T>, D = any>(url: string, queryKey: QueryKey, config?: AxiosRequestConfig<D>): Promise<R>;
553
- }
554
-
555
- type ScallopAddressParams = {
556
- addressId?: string;
557
- urls?: {
558
- addresses?: string[];
559
- };
560
- auth?: string;
561
- network?: NetworkType;
562
- forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
563
- defaultValues?: {
564
- addresses?: Partial<Record<NetworkType, AddressesInterface>>;
154
+ auth?: string;
155
+ network?: NetworkType;
156
+ forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
157
+ defaultValues?: {
158
+ addresses?: Partial<Record<NetworkType, AddressesInterface>>;
565
159
  };
566
160
  } & ScallopAxiosParams;
567
161
  declare class ScallopAddress {
@@ -783,891 +377,88 @@ declare class ScallopConstants extends ScallopAddress {
783
377
  readPoolAddresses(): Promise<Record<string, PoolAddress>>;
784
378
  }
785
379
 
786
- interface BorrowIncentiveAccountKey {
787
- id: string;
788
- onwerId: string;
789
- }
790
- type OptionalKeys$4<T> = {
791
- [K in keyof T]?: T[K];
792
- };
793
- type BorrowIncentivePools = OptionalKeys$4<Record<string, BorrowIncentivePool>>;
794
- type BorrowIncentivePoolPoints = {
795
- symbol: string;
796
- coinName: string;
797
- coinType: string;
798
- coinDecimal: number;
799
- coinPrice: number;
800
- } & Required<Pick<ParsedBorrowIncentivePoolPointData, 'points' | 'distributedPoint' | 'weightedAmount'>> & CalculatedBorrowIncentivePoolPointData;
801
- type BorrowIncentivePool = {
802
- coinName: string;
803
- symbol: string;
804
- coinType: string;
805
- coinDecimal: number;
806
- coinPrice: number;
807
- stakedAmount: number;
808
- stakedCoin: number;
809
- stakedValue: number;
810
- points: OptionalKeys$4<Record<string, BorrowIncentivePoolPoints>>;
811
- };
812
- type OriginBorrowIncentivePoolPointData = {
813
- point_type: {
814
- name: string;
815
- };
816
- distributed_point_per_period: string;
817
- point_distribution_time: string;
818
- distributed_point: string;
819
- points: string;
820
- index: string;
821
- base_weight: string;
822
- weighted_amount: string;
823
- last_update: string;
824
- created_at: string;
825
- };
826
- type OriginBorrowIncentivePoolData = {
827
- pool_type: {
828
- name: string;
829
- };
830
- points: OriginBorrowIncentivePoolPointData[];
831
- min_stakes: string;
832
- max_stakes: string;
833
- stakes: string;
834
- created_at: string;
835
- };
836
- type ParsedBorrowIncentivePoolPointData = {
837
- pointType: string;
838
- distributedPointPerPeriod: number;
839
- period: number;
840
- distributedPoint: number;
841
- points: number;
842
- index: number;
843
- baseWeight: number;
844
- weightedAmount: number;
845
- lastUpdate: number;
846
- createdAt: number;
847
- };
848
- type ParsedBorrowIncentivePoolData = {
849
- poolType: string;
850
- poolPoints: OptionalKeys$4<Record<string, ParsedBorrowIncentivePoolPointData>>;
851
- minStakes: number;
852
- maxStakes: number;
853
- staked: number;
854
- };
855
- type CalculatedBorrowIncentivePoolPointData = {
856
- baseWeight: number;
857
- weightedStakedAmount: number;
858
- weightedStakedCoin: number;
859
- weightedStakedValue: number;
860
- distributedPointPerSec: number;
861
- accumulatedPoints: number;
862
- currentPointIndex: number;
863
- currentTotalDistributedPoint: number;
864
- rewardApr: number;
865
- rewardPerSec: number;
866
- };
867
- type BorrowIncentiveAccounts = OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountData>>;
868
- type OriginBorrowIncentiveAccountPoolData = {
869
- point_type: {
870
- name: string;
871
- };
872
- weighted_amount: string;
873
- points: string;
874
- total_points: string;
875
- index: string;
876
- };
877
- type OriginBorrowIncentiveAccountData = {
878
- points_list: OriginBorrowIncentiveAccountPoolData[];
879
- pool_type: {
880
- name: string;
881
- };
882
- debt_amount: string;
883
- };
884
- type ParsedBorrowIncentiveAccountPoolData = {
885
- pointType: string;
886
- weightedAmount: number;
887
- points: number;
888
- totalPoints: number;
889
- index: number;
890
- };
891
- type ParsedBorrowIncentiveAccountData = {
892
- pointList: OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountPoolData>>;
893
- poolType: string;
894
- debtAmount: number;
895
- };
896
- /**
897
- * The query interface for `incentive_pools_query::incentive_pools_data` inspectTxn.
898
- */
899
- interface BorrowIncentivePoolsQueryInterface {
900
- incentive_pools: OriginBorrowIncentivePoolData[];
901
- }
902
- /**
903
- * The query interface for `incentive_account_query::incentive_account_data` inspectTxn.
904
- */
905
- interface BorrowIncentiveAccountsQueryInterface {
906
- pool_records: OriginBorrowIncentiveAccountData[];
380
+ type ScallopIndexerParams = {
381
+ indexerApiUrl?: string;
382
+ } & ScallopAxiosParams;
383
+ declare class ScallopIndexer extends ScallopAxios {
384
+ constructor(params?: ScallopIndexerParams);
385
+ /**
386
+ * Get market index data.
387
+ *
388
+ * @return Market data.
389
+ */
390
+ getMarket(): Promise<Pick<Market, 'pools' | 'collaterals'>>;
391
+ /**
392
+ * Get market pools index data.
393
+ *
394
+ * @return Market pools data.
395
+ */
396
+ getMarketPools(): Promise<Required<MarketPools>>;
397
+ /**
398
+ * Get market pool index data.
399
+ *
400
+ * @return Market pool data.
401
+ */
402
+ getMarketPool(poolCoinName: string): Promise<MarketPool>;
403
+ /**
404
+ * Get market collaterals index data.
405
+ *
406
+ * @return Market collaterals data.
407
+ */
408
+ getMarketCollaterals(): Promise<Required<MarketCollaterals>>;
409
+ /**
410
+ * Get market collateral index data.
411
+ *
412
+ * @return Market collateral data.
413
+ */
414
+ getMarketCollateral(collateralCoinName: string): Promise<MarketCollateral>;
415
+ /**
416
+ * Get spools index data.
417
+ *
418
+ * @return Spools data.
419
+ */
420
+ getSpools(): Promise<Required<Spools>>;
421
+ /**
422
+ * Get spool index data.
423
+ *
424
+ * @return Spool data.
425
+ */
426
+ getSpool(marketCoinName: string): Promise<Spool>;
427
+ /**
428
+ * Get borrow incentive pools index data.
429
+ *
430
+ * @return Borrow incentive pools data.
431
+ */
432
+ getBorrowIncentivePools(): Promise<Required<BorrowIncentivePools>>;
433
+ /**
434
+ * Get borrow incentive pool index data.
435
+ *
436
+ * @return Borrow incentive pool data.
437
+ */
438
+ getBorrowIncentivePool(borrowIncentiveCoinName: string): Promise<BorrowIncentivePool>;
439
+ /**
440
+ * Get total value locked index data.
441
+ *
442
+ * @return Total value locked.
443
+ */
444
+ getTotalValueLocked(): Promise<TotalValueLocked & {
445
+ totalValueChangeRatio: number;
446
+ borrowValueChangeRatio: number;
447
+ supplyValueChangeRatio: number;
448
+ }>;
449
+ /**
450
+ * Get coin price index data.
451
+ *
452
+ * @return price data.
453
+ */
454
+ getCoinPrice(poolCoinName: string): Promise<number>;
455
+ getCoinPrices(): Promise<Record<string, number>>;
907
456
  }
908
457
 
909
- type OptionalKeys$3<T> = {
910
- [K in keyof T]?: T[K];
911
- };
912
- type MarketPools = OptionalKeys$3<Record<string, MarketPool>>;
913
- type MarketCollaterals = OptionalKeys$3<Record<string, MarketCollateral>>;
914
- type CoinAmounts = OptionalKeys$3<Record<string, number>>;
915
- type MarketCoinAmounts = OptionalKeys$3<Record<string, number>>;
916
- type SCoinAmounts = OptionalKeys$3<Record<string, number>>;
917
- type BalanceSheet = {
918
- cash: string;
919
- debt: string;
920
- market_coin_supply: string;
921
- revenue: string;
922
- };
923
- type BorrowDynamic = {
924
- borrow_index: string;
925
- interest_rate: {
926
- fields: {
927
- value: string;
928
- };
929
- };
930
- interest_rate_scale: string;
931
- last_updated: string;
932
- };
933
- type BorrowFee = {
934
- value: string;
935
- };
936
- type InterestModel = {
937
- base_borrow_rate_per_sec: {
938
- fields: {
939
- value: string;
940
- };
941
- };
942
- borrow_rate_on_high_kink: {
943
- fields: {
944
- value: string;
945
- };
946
- };
947
- borrow_rate_on_mid_kink: {
948
- fields: {
949
- value: string;
950
- };
951
- };
952
- borrow_weight: {
953
- fields: {
954
- value: string;
955
- };
956
- };
957
- borrow_fee_rate: {
958
- fields: {
959
- value: string;
960
- };
961
- };
962
- high_kink: {
963
- fields: {
964
- value: string;
965
- };
966
- };
967
- interest_rate_scale: string;
968
- max_borrow_rate: {
969
- fields: {
970
- value: string;
971
- };
972
- };
973
- mid_kink: {
974
- fields: {
975
- value: string;
976
- };
977
- };
978
- min_borrow_amount: string;
979
- revenue_factor: {
980
- fields: {
981
- value: string;
982
- };
983
- };
984
- type: {
985
- fields: {
986
- name: string;
987
- };
988
- };
989
- };
990
- type RiskModel = {
991
- collateral_factor: {
992
- fields: {
993
- value: string;
994
- };
995
- };
996
- liquidation_discount: {
997
- fields: {
998
- value: string;
999
- };
1000
- };
1001
- liquidation_factor: {
1002
- fields: {
1003
- value: string;
1004
- };
1005
- };
1006
- liquidation_penalty: {
1007
- fields: {
1008
- value: string;
1009
- };
1010
- };
1011
- liquidation_revenue_factor: {
1012
- fields: {
1013
- value: string;
1014
- };
1015
- };
1016
- max_collateral_amount: string;
1017
- type: {
1018
- fields: {
1019
- name: string;
1020
- };
1021
- };
1022
- };
1023
- type CollateralStat = {
1024
- amount: string;
1025
- };
1026
- type MarketPool = {
1027
- coinName: string;
1028
- symbol: string;
1029
- coinType: string;
1030
- marketCoinType: string;
1031
- sCoinType: string;
1032
- coinWrappedType: CoinWrappedType;
1033
- coinDecimal: number;
1034
- coinPrice: number;
1035
- maxSupplyCoin: number;
1036
- maxBorrowCoin: number;
1037
- isIsolated: boolean;
1038
- } & Required<Pick<ParsedMarketPoolData, 'highKink' | 'midKink' | 'reserveFactor' | 'borrowWeight' | 'borrowFee' | 'marketCoinSupplyAmount' | 'minBorrowAmount'>> & CalculatedMarketPoolData;
1039
- type MarketCollateral = {
1040
- coinName: string;
1041
- symbol: string;
1042
- coinType: string;
1043
- marketCoinType: string;
1044
- coinWrappedType: CoinWrappedType;
1045
- coinDecimal: number;
1046
- coinPrice: number;
1047
- isIsolated: boolean;
1048
- } & Required<Pick<ParsedMarketCollateralData, 'collateralFactor' | 'liquidationFactor' | 'liquidationDiscount' | 'liquidationPenalty' | 'liquidationReserveFactor'>> & CalculatedMarketCollateralData;
1049
- type OriginMarketPoolData = {
1050
- type: {
1051
- name: string;
1052
- };
1053
- maxBorrowRate: {
1054
- value: string;
1055
- };
1056
- interestRate: {
1057
- value: string;
1058
- };
1059
- interestRateScale: string;
1060
- borrowIndex: string;
1061
- lastUpdated: string;
1062
- cash: string;
1063
- debt: string;
1064
- marketCoinSupply: string;
1065
- reserve: string;
1066
- reserveFactor: {
1067
- value: string;
1068
- };
1069
- borrowWeight: {
1070
- value: string;
1071
- };
1072
- borrowFeeRate: {
1073
- value: string;
1074
- };
1075
- baseBorrowRatePerSec: {
1076
- value: string;
1077
- };
1078
- borrowRateOnHighKink: {
1079
- value: string;
1080
- };
1081
- borrowRateOnMidKink: {
1082
- value: string;
1083
- };
1084
- highKink: {
1085
- value: string;
1086
- };
1087
- midKink: {
1088
- value: string;
1089
- };
1090
- minBorrowAmount: string;
1091
- isIsolated: boolean;
1092
- supplyLimit: string;
1093
- borrowLimit: string;
1094
- };
1095
- type ParsedMarketPoolData = {
1096
- coinType: string;
1097
- maxBorrowRate: number;
1098
- borrowRate: number;
1099
- borrowRateScale: number;
1100
- borrowIndex: number;
1101
- lastUpdated: number;
1102
- cashAmount: number;
1103
- debtAmount: number;
1104
- marketCoinSupplyAmount: number;
1105
- reserveAmount: number;
1106
- reserveFactor: number;
1107
- borrowWeight: number;
1108
- borrowFee: number;
1109
- baseBorrowRate: number;
1110
- borrowRateOnHighKink: number;
1111
- borrowRateOnMidKink: number;
1112
- highKink: number;
1113
- midKink: number;
1114
- minBorrowAmount: number;
1115
- isIsolated: boolean;
1116
- supplyLimit: number;
1117
- borrowLimit: number;
1118
- };
1119
- type CalculatedMarketPoolData = {
1120
- baseBorrowApr: number;
1121
- baseBorrowApy: number;
1122
- borrowAprOnHighKink: number;
1123
- borrowApyOnHighKink: number;
1124
- borrowAprOnMidKink: number;
1125
- borrowApyOnMidKink: number;
1126
- coinDecimal: number;
1127
- conversionRate: number;
1128
- maxBorrowApr: number;
1129
- maxBorrowApy: number;
1130
- borrowApr: number;
1131
- borrowApy: number;
1132
- borrowIndex: number;
1133
- growthInterest: number;
1134
- supplyAmount: number;
1135
- supplyCoin: number;
1136
- borrowAmount: number;
1137
- borrowCoin: number;
1138
- reserveAmount: number;
1139
- reserveCoin: number;
1140
- utilizationRate: number;
1141
- supplyApr: number;
1142
- supplyApy: number;
1143
- isIsolated: boolean;
1144
- maxSupplyCoin: number;
1145
- maxBorrowCoin: number;
1146
- };
1147
- type OriginMarketCollateralData = {
1148
- type: {
1149
- name: string;
1150
- };
1151
- isIsolated: boolean;
1152
- collateralFactor: {
1153
- value: string;
1154
- };
1155
- liquidationFactor: {
1156
- value: string;
1157
- };
1158
- liquidationDiscount: {
1159
- value: string;
1160
- };
1161
- liquidationPenalty: {
1162
- value: string;
1163
- };
1164
- liquidationReserveFactor: {
1165
- value: string;
1166
- };
1167
- maxCollateralAmount: string;
1168
- totalCollateralAmount: string;
1169
- };
1170
- type ParsedMarketCollateralData = {
1171
- coinType: string;
1172
- collateralFactor: number;
1173
- liquidationFactor: number;
1174
- liquidationDiscount: number;
1175
- liquidationPenalty: number;
1176
- liquidationReserveFactor: number;
1177
- maxCollateralAmount: number;
1178
- totalCollateralAmount: number;
1179
- isIsolated: boolean;
1180
- };
1181
- type CalculatedMarketCollateralData = {
1182
- coinDecimal: number;
1183
- isIsolated: boolean;
1184
- maxDepositAmount: number;
1185
- maxDepositCoin: number;
1186
- depositAmount: number;
1187
- depositCoin: number;
1188
- };
1189
- type Market = {
1190
- pools: MarketPools;
1191
- collaterals: MarketCollaterals;
1192
- data?: MarketQueryInterface;
1193
- };
1194
- type Obligation = {
1195
- id: string;
1196
- keyId: string;
1197
- locked: boolean;
1198
- };
1199
- /**
1200
- * The query interface for `market_query::market_data` inspectTxn.
1201
- */
1202
- interface MarketQueryInterface {
1203
- collaterals: {
1204
- collateralFactor: {
1205
- value: string;
1206
- };
1207
- liquidationDiscount: {
1208
- value: string;
1209
- };
1210
- liquidationFactor: {
1211
- value: string;
1212
- };
1213
- liquidationPanelty: {
1214
- value: string;
1215
- };
1216
- liquidationReserveFactor: {
1217
- value: string;
1218
- };
1219
- maxCollateralAmount: string;
1220
- totalCollateralAmount: string;
1221
- type: {
1222
- name: string;
1223
- };
1224
- }[];
1225
- pools: {
1226
- baseBorrowRatePerSec: {
1227
- value: string;
1228
- };
1229
- borrowRateOnHighKink: {
1230
- value: string;
1231
- };
1232
- borrowRateOnMidKink: {
1233
- value: string;
1234
- };
1235
- maxBorrowRate: {
1236
- value: string;
1237
- };
1238
- highKink: {
1239
- value: string;
1240
- };
1241
- midKink: {
1242
- value: string;
1243
- };
1244
- interestRate: {
1245
- value: string;
1246
- };
1247
- interestRateScale: string;
1248
- borrowIndex: string;
1249
- lastUpdated: string;
1250
- cash: string;
1251
- debt: string;
1252
- marketCoinSupply: string;
1253
- minBorrowAmount: string;
1254
- reserve: string;
1255
- reserveFactor: {
1256
- value: string;
1257
- };
1258
- borrowWeight: {
1259
- value: string;
1260
- };
1261
- borrowFeeRate: {
1262
- value: string;
1263
- };
1264
- type: {
1265
- name: string;
1266
- };
1267
- }[];
1268
- }
1269
- /**
1270
- * The query interface for `obligation_query::obligation_data` inspectTxn.
1271
- */
1272
- interface ObligationQueryInterface {
1273
- collaterals: {
1274
- type: {
1275
- name: string;
1276
- };
1277
- amount: string;
1278
- }[];
1279
- debts: {
1280
- type: {
1281
- name: string;
1282
- };
1283
- amount: string;
1284
- borrowIndex: string;
1285
- }[];
1286
- }
1287
-
1288
- type LoyaltyProgramInfo = {
1289
- pendingReward: number;
1290
- totalPoolReward: number;
1291
- isClaimEnabled: boolean;
1292
- };
1293
- type VeScaLoyaltyProgramInfo = {
1294
- pendingVeScaReward: number;
1295
- pendingScaReward: number;
1296
- totalPoolReward: number;
1297
- isClaimEnabled: boolean;
1298
- };
1299
-
1300
- type OptionalKeys$2<T> = {
1301
- [K in keyof T]?: T[K];
1302
- };
1303
- type Spools = OptionalKeys$2<Record<string, Spool>>;
1304
- type Spool = {
1305
- marketCoinName: string;
1306
- symbol: string;
1307
- coinType: string;
1308
- marketCoinType: string;
1309
- rewardCoinType: string;
1310
- sCoinType: string;
1311
- coinDecimal: number;
1312
- rewardCoinDecimal: number;
1313
- coinPrice: number;
1314
- marketCoinPrice: number;
1315
- rewardCoinPrice: number;
1316
- } & Required<Pick<ParsedSpoolData, 'maxPoint' | 'distributedPoint' | 'maxStake'>> & CalculatedSpoolData & SpoolRewardPool;
1317
- type OriginSpoolData = {
1318
- stakeType: {
1319
- fields: {
1320
- name: string;
1321
- };
1322
- };
1323
- maxDistributedPoint: string;
1324
- distributedPoint: string;
1325
- distributedPointPerPeriod: string;
1326
- pointDistributionTime: string;
1327
- maxStake: string;
1328
- stakes: string;
1329
- index: string;
1330
- createdAt: string;
1331
- lastUpdate: string;
1332
- };
1333
- type SpoolData = {
1334
- created_at: string;
1335
- distributed_point: string;
1336
- distributed_point_per_period: string;
1337
- id: {
1338
- id: string;
1339
- };
1340
- index: string;
1341
- last_update: string;
1342
- max_distributed_point: string;
1343
- max_stakes: string;
1344
- point_distribution_time: string;
1345
- stake_type: {
1346
- type: string;
1347
- fields: {
1348
- name: string;
1349
- };
1350
- };
1351
- stakes: string;
1352
- };
1353
- type ParsedSpoolData = {
1354
- stakeType: string;
1355
- maxPoint: number;
1356
- distributedPoint: number;
1357
- pointPerPeriod: number;
1358
- period: number;
1359
- maxStake: number;
1360
- staked: number;
1361
- index: number;
1362
- createdAt: number;
1363
- lastUpdate: number;
1364
- };
1365
- type CalculatedSpoolData = {
1366
- stakedAmount: number;
1367
- stakedCoin: number;
1368
- stakedValue: number;
1369
- distributedPointPerSec: number;
1370
- accumulatedPoints: number;
1371
- currentPointIndex: number;
1372
- currentTotalDistributedPoint: number;
1373
- startDate: Date;
1374
- endDate: Date;
1375
- };
1376
- type SpoolRewardPool = Required<Pick<ParsedSpoolRewardPoolData, 'exchangeRateNumerator' | 'exchangeRateDenominator'>> & CalculatedSpoolRewardPoolData;
1377
- type OriginSpoolRewardPoolData = {
1378
- claimed_rewards: string;
1379
- exchange_rate_denominator: string;
1380
- exchange_rate_numerator: string;
1381
- rewards: string;
1382
- spool_id: string;
1383
- };
1384
- type ParsedSpoolRewardPoolData = {
1385
- claimedRewards: number;
1386
- exchangeRateDenominator: number;
1387
- exchangeRateNumerator: number;
1388
- rewards: number;
1389
- spoolId: string;
1390
- };
1391
- type CalculatedSpoolRewardPoolData = {
1392
- rewardApr: number;
1393
- totalRewardAmount: number;
1394
- totalRewardCoin: number;
1395
- totalRewardValue: number;
1396
- remaindRewardAmount: number;
1397
- remaindRewardCoin: number;
1398
- remaindRewardValue: number;
1399
- claimedRewardAmount: number;
1400
- claimedRewardCoin: number;
1401
- claimedRewardValue: number;
1402
- rewardPerSec: number;
1403
- };
1404
- type StakePools = OptionalKeys$2<Record<string, StakePool>>;
1405
- type StakeRewardPools = OptionalKeys$2<Record<string, StakeRewardPool>>;
1406
- type StakeAccounts = Record<string, StakeAccount[]>;
1407
- interface StakeAccount {
1408
- id: string;
1409
- type: string;
1410
- stakePoolId: string;
1411
- stakeType: string;
1412
- staked: number;
1413
- index: number;
1414
- points: number;
1415
- totalPoints: number;
1416
- }
1417
- interface StakePool {
1418
- id: string;
1419
- type: string;
1420
- maxPoint: number;
1421
- distributedPoint: number;
1422
- pointPerPeriod: number;
1423
- period: number;
1424
- maxStake: number;
1425
- stakeType: string;
1426
- totalStaked: number;
1427
- index: number;
1428
- createdAt: number;
1429
- lastUpdate: number;
1430
- }
1431
- interface StakeRewardPool {
1432
- id: string;
1433
- type: string;
1434
- stakePoolId: string;
1435
- ratioDenominator: number;
1436
- ratioNumerator: number;
1437
- rewards: number;
1438
- claimedRewards: number;
1439
- }
1440
-
1441
- type OptionalKeys$1<T> = {
1442
- [K in keyof T]?: T[K];
1443
- };
1444
- type Lendings = OptionalKeys$1<Record<string, Lending>>;
1445
- type ObligationAccounts = OptionalKeys$1<Record<string, ObligationAccount>>;
1446
- type Lending = Required<Pick<MarketPool, 'coinName' | 'symbol' | 'coinType' | 'marketCoinType' | 'sCoinType' | 'coinDecimal' | 'coinPrice' | 'conversionRate' | 'isIsolated'> & Pick<Spool, 'marketCoinPrice'>> & {
1447
- supplyApr: number;
1448
- supplyApy: number;
1449
- rewardApr: number;
1450
- suppliedAmount: number;
1451
- suppliedCoin: number;
1452
- suppliedValue: number;
1453
- stakedMarketAmount: number;
1454
- stakedMarketCoin: number;
1455
- stakedAmount: number;
1456
- stakedCoin: number;
1457
- stakedValue: number;
1458
- unstakedMarketAmount: number;
1459
- unstakedMarketCoin: number;
1460
- unstakedAmount: number;
1461
- unstakedCoin: number;
1462
- unstakedValue: number;
1463
- availableSupplyAmount: number;
1464
- availableSupplyCoin: number;
1465
- availableWithdrawAmount: number;
1466
- availableWithdrawCoin: number;
1467
- availableStakeAmount: number;
1468
- availableStakeCoin: number;
1469
- availableUnstakeAmount: number;
1470
- availableUnstakeCoin: number;
1471
- availableClaimAmount: number;
1472
- availableClaimCoin: number;
1473
- };
1474
- type ObligationAccount = {
1475
- obligationId: string;
1476
- totalDepositedValue: number;
1477
- totalBorrowedValue: number;
1478
- totalBalanceValue: number;
1479
- totalBorrowCapacityValue: number;
1480
- totalAvailableCollateralValue: number;
1481
- totalBorrowedValueWithWeight: number;
1482
- totalRequiredCollateralValue: number;
1483
- totalUnhealthyCollateralValue: number;
1484
- totalRiskLevel: number;
1485
- totalDepositedPools: number;
1486
- totalBorrowedPools: number;
1487
- totalRewardedPools: number;
1488
- collaterals: OptionalKeys$1<Record<string, ObligationCollateral>>;
1489
- debts: OptionalKeys$1<Record<string, ObligationDebt>>;
1490
- borrowIncentives: OptionalKeys$1<Record<string, ObligationBorrowIncentive>>;
1491
- };
1492
- type ObligationCollateral = {
1493
- coinName: string;
1494
- coinType: string;
1495
- symbol: string;
1496
- coinDecimal: number;
1497
- coinPrice: number;
1498
- depositedAmount: number;
1499
- depositedCoin: number;
1500
- depositedValue: number;
1501
- borrowCapacityValue: number;
1502
- requiredCollateralValue: number;
1503
- availableDepositAmount: number;
1504
- availableDepositCoin: number;
1505
- availableWithdrawAmount: number;
1506
- availableWithdrawCoin: number;
1507
- };
1508
- type ObligationDebt = {
1509
- coinName: string;
1510
- coinType: string;
1511
- symbol: string;
1512
- coinDecimal: number;
1513
- coinPrice: number;
1514
- borrowedAmount: number;
1515
- borrowedCoin: number;
1516
- borrowedValue: number;
1517
- borrowedValueWithWeight: number;
1518
- borrowIndex: number;
1519
- requiredRepayAmount: number;
1520
- requiredRepayCoin: number;
1521
- availableBorrowAmount: number;
1522
- availableBorrowCoin: number;
1523
- availableRepayAmount: number;
1524
- availableRepayCoin: number;
1525
- };
1526
- type ObligationBorrowIncentiveReward = {
1527
- coinName: string;
1528
- coinType: string;
1529
- symbol: string;
1530
- coinDecimal: number;
1531
- coinPrice: number;
1532
- weightedBorrowAmount: number;
1533
- availableClaimCoin: number;
1534
- availableClaimAmount: number;
1535
- boostValue: number;
1536
- };
1537
- type ObligationBorrowIncentive = {
1538
- coinName: string;
1539
- coinType: string;
1540
- symbol: string;
1541
- coinDecimal: number;
1542
- coinPrice: number;
1543
- rewards: ObligationBorrowIncentiveReward[];
1544
- };
1545
- type TotalValueLocked = {
1546
- supplyLendingValue: number;
1547
- supplyCollateralValue: number;
1548
- supplyValue: number;
1549
- borrowValue: number;
1550
- totalValue: number;
1551
- supplyValueChangeRatio?: number;
1552
- supplyLendingValueChangeRatio?: number;
1553
- supplyCollateralValueChangeRatio?: number;
1554
- borrowValueChangeRatio?: number;
1555
- totalValueChangeRatio?: number;
1556
- };
1557
-
1558
- type Vesca = {
1559
- id: string;
1560
- keyId: string;
1561
- keyObject?: SuiObjectRef;
1562
- object: SuiObjectRef;
1563
- lockedScaAmount: string;
1564
- lockedScaCoin: number;
1565
- currentVeScaBalance: number;
1566
- unlockAt: number;
1567
- };
1568
- type VeScaTreasuryFields = {
1569
- total_ve_sca_amount: string;
1570
- sca_balance: string;
1571
- unlock_schedule: {
1572
- fields: {
1573
- locked_sca_amount: string;
1574
- };
1575
- };
1576
- };
1577
- type VeScaTreasuryInfo = {
1578
- totalLockedSca: number;
1579
- totalVeSca: number;
1580
- averageLockingPeriod: number;
1581
- averageLockingPeriodUnit: string;
1582
- };
1583
-
1584
- type ScallopIndexerParams = {
1585
- indexerApiUrl?: string;
1586
- } & ScallopAxiosParams;
1587
- declare class ScallopIndexer extends ScallopAxios {
1588
- constructor(params?: ScallopIndexerParams);
1589
- /**
1590
- * Get market index data.
1591
- *
1592
- * @return Market data.
1593
- */
1594
- getMarket(): Promise<Pick<Market, 'pools' | 'collaterals'>>;
1595
- /**
1596
- * Get market pools index data.
1597
- *
1598
- * @return Market pools data.
1599
- */
1600
- getMarketPools(): Promise<Required<MarketPools>>;
1601
- /**
1602
- * Get market pool index data.
1603
- *
1604
- * @return Market pool data.
1605
- */
1606
- getMarketPool(poolCoinName: string): Promise<MarketPool>;
1607
- /**
1608
- * Get market collaterals index data.
1609
- *
1610
- * @return Market collaterals data.
1611
- */
1612
- getMarketCollaterals(): Promise<Required<MarketCollaterals>>;
1613
- /**
1614
- * Get market collateral index data.
1615
- *
1616
- * @return Market collateral data.
1617
- */
1618
- getMarketCollateral(collateralCoinName: string): Promise<MarketCollateral>;
1619
- /**
1620
- * Get spools index data.
1621
- *
1622
- * @return Spools data.
1623
- */
1624
- getSpools(): Promise<Required<Spools>>;
1625
- /**
1626
- * Get spool index data.
1627
- *
1628
- * @return Spool data.
1629
- */
1630
- getSpool(marketCoinName: string): Promise<Spool>;
1631
- /**
1632
- * Get borrow incentive pools index data.
1633
- *
1634
- * @return Borrow incentive pools data.
1635
- */
1636
- getBorrowIncentivePools(): Promise<Required<BorrowIncentivePools>>;
1637
- /**
1638
- * Get borrow incentive pool index data.
1639
- *
1640
- * @return Borrow incentive pool data.
1641
- */
1642
- getBorrowIncentivePool(borrowIncentiveCoinName: string): Promise<BorrowIncentivePool>;
1643
- /**
1644
- * Get total value locked index data.
1645
- *
1646
- * @return Total value locked.
1647
- */
1648
- getTotalValueLocked(): Promise<TotalValueLocked & {
1649
- totalValueChangeRatio: number;
1650
- borrowValueChangeRatio: number;
1651
- supplyValueChangeRatio: number;
1652
- }>;
1653
- /**
1654
- * Get coin price index data.
1655
- *
1656
- * @return price data.
1657
- */
1658
- getCoinPrice(poolCoinName: string): Promise<number>;
1659
- getCoinPrices(): Promise<Record<string, number>>;
1660
- }
1661
-
1662
- type OptionalKeys<T> = {
1663
- [K in keyof T]?: T[K];
1664
- };
1665
- type CoinPrices = OptionalKeys<Record<string, number>>;
1666
-
1667
- type QueryInspectTxnParams = {
1668
- queryTarget: string;
1669
- args: SuiObjectArg[];
1670
- typeArgs?: any[];
458
+ type QueryInspectTxnParams = {
459
+ queryTarget: string;
460
+ args: SuiObjectArg[];
461
+ typeArgs?: any[];
1671
462
  };
1672
463
  type ScallopSuiKitParams = {
1673
464
  suiKit?: SuiKit;
@@ -1978,7 +769,7 @@ declare class ScallopQuery implements ScallopQueryInterface {
1978
769
  * @param ownerAddress - The owner address.
1979
770
  * @return Borrow incentive accounts data.
1980
771
  */
1981
- getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef$1, coinNames?: string[]): Promise<{
772
+ getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef, coinNames?: string[]): Promise<{
1982
773
  [x: string]: ParsedBorrowIncentiveAccountData | undefined;
1983
774
  }>;
1984
775
  /**
@@ -2008,13 +799,13 @@ declare class ScallopQuery implements ScallopQueryInterface {
2008
799
  indexer?: boolean;
2009
800
  }): Promise<Lending>;
2010
801
  /**
2011
- * Get user all obligation accounts information.
802
+ * Get user all obligation accounts information from ownerAddress.
2012
803
  *
2013
804
  * @description
2014
805
  * All collateral and borrowing information in all obligation accounts owned by the user.
2015
806
  *
2016
807
  * @param ownerAddress - The owner address.
2017
- * @param indexer - Whether to use indexer.
808
+ * @param args - Additional arguments.
2018
809
  * @return All obligation accounts information.
2019
810
  */
2020
811
  getObligationAccounts(ownerAddress?: string, args?: {
@@ -2027,6 +818,42 @@ declare class ScallopQuery implements ScallopQueryInterface {
2027
818
  }): Promise<{
2028
819
  [x: string]: ObligationAccount | undefined;
2029
820
  }>;
821
+ /**
822
+ * Get user all obligation accounts information from obligationIds.
823
+ *
824
+ * @description
825
+ * All collateral and borrowing information in all obligation accounts.
826
+ *
827
+ * @param obligationIds - Obligation IDs.
828
+ * @param args - Additional arguments.
829
+ * @return All obligation accounts information.
830
+ */
831
+ getObligationAccountsByIds(obligationIds: string[], args?: {
832
+ market?: {
833
+ collaterals: MarketCollaterals;
834
+ pools: MarketPools;
835
+ };
836
+ coinPrices?: CoinPrices;
837
+ indexer?: boolean;
838
+ }): Promise<ObligationAccount[]>;
839
+ /**
840
+ * Get obligation account by id
841
+ *
842
+ * @description
843
+ * All collateral and borrowing information in obligation account.
844
+ *
845
+ * @param obligationId - Obligation ID.
846
+ * @param args - Additional arguments.
847
+ * @return All obligation accounts information.
848
+ */
849
+ getObligationAccountById(obligationId: string, args?: {
850
+ market?: {
851
+ collaterals: MarketCollaterals;
852
+ pools: MarketPools;
853
+ };
854
+ coinPrices?: CoinPrices;
855
+ indexer?: boolean;
856
+ }): Promise<ObligationAccount>;
2030
857
  /**
2031
858
  * Get obligation account information for specific id.
2032
859
  *
@@ -2035,7 +862,7 @@ declare class ScallopQuery implements ScallopQueryInterface {
2035
862
  *
2036
863
  * @param obligationId - The obligation id.
2037
864
  * @param ownerAddress - The owner address.
2038
- * @param indexer - Whether to use indexer.
865
+ * @param args - Additional arguments.
2039
866
  * @return Borrowing and collateral information.
2040
867
  */
2041
868
  getObligationAccount(obligationId: string, ownerAddress?: string, args?: {
@@ -2248,292 +1075,30 @@ declare class ScallopQuery implements ScallopQueryInterface {
2248
1075
  totalSupplyValue: number;
2249
1076
  }>;
2250
1077
  /**
2251
- * Get both primary and secondary price update policy objects
2252
- * @returns price update policies
2253
- */
2254
- getPriceUpdatePolicies(): Promise<{
2255
- primary: _mysten_sui_dist_cjs_client.SuiObjectResponse | null;
2256
- secondary: _mysten_sui_dist_cjs_client.SuiObjectResponse | null;
2257
- }>;
2258
- /**
2259
- * Return the supported primary and secondary oracles for all supported pool assets
2260
- */
2261
- getAssetOracles(): Promise<Record<string, xOracleRules>>;
2262
- /**
2263
- * Get switchboard on-demand aggregator object id based on coinType
2264
- * @param coinType
2265
- * @returns
2266
- */
2267
- getSwitchboardOnDemandAggregatorObjectIds(coinName: string[]): Promise<string[]>;
2268
- }
2269
-
2270
- type CoreIds = {
2271
- protocolPkg: string;
2272
- market: string;
2273
- version: string;
2274
- coinDecimalsRegistry: string;
2275
- xOracle: string;
2276
- };
2277
- type NestedResult = Extract<Argument, {
2278
- $kind: 'NestedResult';
2279
- }>;
2280
- type ResultAsObligation = NestedResult;
2281
- type ResultAsObligationKey = NestedResult;
2282
- type ResultAsObligationHotPotato = NestedResult;
2283
- type CoreNormalMethods = {
2284
- openObligation: () => [
2285
- ResultAsObligation,
2286
- ResultAsObligationKey,
2287
- ResultAsObligationHotPotato
2288
- ];
2289
- returnObligation: (obligation: SuiObjectArg, obligationHotPotato: SuiObjectArg) => void;
2290
- openObligationEntry: () => void;
2291
- addCollateral: (obligation: SuiObjectArg, coin: SuiObjectArg, collateralCoinName: string) => void;
2292
- takeCollateral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, collateralCoinName: string) => TransactionResult;
2293
- deposit: (coin: SuiObjectArg, poolCoinName: string) => TransactionResult;
2294
- depositEntry: (coin: SuiObjectArg, poolCoinName: string) => TransactionResult;
2295
- withdraw: (marketCoin: SuiObjectArg, poolCoinName: string) => TransactionResult;
2296
- withdrawEntry: (marketCoin: SuiObjectArg, poolCoinName: string) => TransactionResult;
2297
- borrow: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: string) => TransactionResult;
2298
- borrowWithReferral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, borrowReferral: SuiObjectArg, amount: number | SuiTxArg, poolCoinName: string) => TransactionResult;
2299
- borrowEntry: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: string) => TransactionResult;
2300
- repay: (obligation: SuiObjectArg, coin: SuiObjectArg, poolCoinName: string) => void;
2301
- borrowFlashLoan: (amount: number | SuiTxArg, poolCoinName: string) => TransactionResult;
2302
- repayFlashLoan: (coin: SuiObjectArg, loan: SuiObjectArg, poolCoinName: string) => void;
2303
- };
2304
- type CoreQuickMethods = {
2305
- addCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg) => Promise<void>;
2306
- takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg) => Promise<TransactionResult>;
2307
- borrowQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg) => Promise<TransactionResult>;
2308
- borrowWithReferralQuick: (amount: number, poolCoinName: string, borrowReferral: SuiObjectArg, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg) => Promise<TransactionResult>;
2309
- depositQuick: (amount: number, poolCoinName: string, returnSCoin?: boolean) => Promise<TransactionResult>;
2310
- withdrawQuick: (amount: number, poolCoinName: string) => Promise<TransactionResult>;
2311
- repayQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg) => Promise<void>;
2312
- updateAssetPricesQuick: (assetCoinNames?: string[]) => Promise<void>;
2313
- };
2314
- type SuiTxBlockWithCoreNormalMethods = SuiTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
2315
- type CoreTxBlock = SuiTxBlockWithCoreNormalMethods & CoreQuickMethods;
2316
- type GenerateCoreNormalMethod = (params: {
2317
- builder: ScallopBuilder;
2318
- txBlock: SuiTxBlock;
2319
- }) => CoreNormalMethods;
2320
- type GenerateCoreQuickMethod = (params: {
2321
- builder: ScallopBuilder;
2322
- txBlock: SuiTxBlockWithCoreNormalMethods;
2323
- }) => CoreQuickMethods;
2324
-
2325
- type SpoolIds = {
2326
- spoolPkg: string;
2327
- };
2328
- type SpoolNormalMethods = {
2329
- createStakeAccount: (stakeMarketCoinName: string) => TransactionResult;
2330
- stake: (stakeAccount: SuiAddressArg, coin: SuiObjectArg, stakeMarketCoinName: string) => void;
2331
- unstake: (stakeAccount: SuiAddressArg, amount: number, stakeMarketCoinName: string) => TransactionResult;
2332
- claim: (stakeAccount: SuiAddressArg, stakeMarketCoinName: string) => TransactionResult;
2333
- };
2334
- type SpoolQuickMethods = {
2335
- stakeQuick(amountOrMarketCoin: SuiObjectArg | number, stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg): Promise<void>;
2336
- unstakeQuick(amount: number, stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg, returnSCoin?: boolean): Promise<TransactionResult | undefined>;
2337
- claimQuick(stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg): Promise<TransactionResult[]>;
2338
- };
2339
- type SuiTxBlockWithSpoolNormalMethods = SuiTxBlock & SuiTxBlockWithSCoin & SpoolNormalMethods;
2340
- type SpoolTxBlock = SuiTxBlockWithSpoolNormalMethods & SpoolQuickMethods;
2341
- type GenerateSpoolNormalMethod = (params: {
2342
- builder: ScallopBuilder;
2343
- txBlock: SuiTxBlock;
2344
- }) => SpoolNormalMethods;
2345
- type GenerateSpoolQuickMethod = (params: {
2346
- builder: ScallopBuilder;
2347
- txBlock: SuiTxBlockWithSpoolNormalMethods;
2348
- }) => SpoolQuickMethods;
2349
-
2350
- type BorrowIncentiveIds = {
2351
- borrowIncentivePkg: string;
2352
- query: string;
2353
- config: string;
2354
- incentivePools: string;
2355
- incentiveAccounts: string;
2356
- obligationAccessStore: string;
2357
- };
2358
- type BorrowIncentiveNormalMethods = {
2359
- stakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
2360
- stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey: SuiObjectArg) => void;
2361
- unstakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
2362
- claimBorrowIncentive: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, rewardType: string) => TransactionResult;
2363
- deactivateBoost: (obligation: SuiObjectArg, veScaKey: SuiObjectArg) => void;
2364
- };
2365
- type BorrowIncentiveQuickMethods = {
2366
- stakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
2367
- stakeObligationWithVeScaQuick(obligation?: string, obligationKey?: string, veScaKey?: string): Promise<void>;
2368
- unstakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
2369
- claimBorrowIncentiveQuick(rewardType: string, obligation?: string, obligationKey?: string): Promise<TransactionResult>;
2370
- };
2371
- type SuiTxBlockWithBorrowIncentiveNormalMethods = SuiTxBlock & BorrowIncentiveNormalMethods;
2372
- type BorrowIncentiveTxBlock = SuiTxBlockWithBorrowIncentiveNormalMethods & BorrowIncentiveQuickMethods;
2373
- type GenerateBorrowIncentiveNormalMethod = (params: {
2374
- builder: ScallopBuilder;
2375
- txBlock: SuiTxBlock;
2376
- }) => BorrowIncentiveNormalMethods;
2377
- type GenerateBorrowIncentiveQuickMethod = (params: {
2378
- builder: ScallopBuilder;
2379
- txBlock: SuiTxBlockWithBorrowIncentiveNormalMethods;
2380
- }) => BorrowIncentiveQuickMethods;
2381
-
2382
- type VeScaNormalMethods = {
2383
- lockSca: (scaCoin: SuiObjectArg, unlockAtInSecondTimestamp: number) => TransactionResult;
2384
- extendLockPeriod: (veScaKey: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
2385
- extendLockAmount: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg) => void;
2386
- renewExpiredVeSca: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
2387
- redeemSca: (veScaKey: SuiObjectArg) => TransactionResult;
2388
- mintEmptyVeSca: () => TransactionResult;
2389
- splitVeSca: (veScaKey: SuiObjectArg, splitAmount: string) => TransactionResult;
2390
- mergeVeSca: (targetVeScaKey: SuiObjectArg, sourceVeScaKey: SuiObjectArg) => void;
2391
- };
2392
- type QuickMethodReturnType<T extends boolean> = T extends true ? void : TransactionResult;
2393
- type VeScaQuickMethods = {
2394
- /**
2395
- * Quick methods to automate
2396
- * lock initial SCA, extend lock period, lock more SCA, renew expired VeSCA, and redeem SCA
2397
- *
2398
- * **Flow:**
2399
- * - If only `amountOrCoin` is provided, it will lock the amount of existing not expired veSCA
2400
- * - If only `lockPeriodInDays` is provided, it will extend the lock period of existing not expired veSCA
2401
- *
2402
- * **Note:**
2403
- * - If one or both flow above is used on a expired veSCA, it will claim the unlocked SCA
2404
- * and renew the veSCA first, and then flow continues
2405
- * - If users has no veSCA yet, they need to provide both `amountOrCoin` and `lockPeriodInDays` for initial lock
2406
- * @param amountOrCoin
2407
- * @param lockPeriodInDays
2408
- * @param autoCheck
1078
+ * Get both primary and secondary price update policy objects
1079
+ * @returns price update policies
2409
1080
  */
2410
- lockScaQuick(params: {
2411
- amountOrCoin?: SuiObjectArg | number;
2412
- lockPeriodInDays?: number;
2413
- autoCheck?: boolean;
2414
- veScaKey?: SuiObjectData$1 | string;
2415
- }): Promise<void>;
2416
- extendLockPeriodQuick: (params: {
2417
- lockPeriodInDays: number;
2418
- autoCheck?: boolean;
2419
- veScaKey?: SuiObjectData$1 | string;
2420
- }) => Promise<void>;
2421
- extendLockAmountQuick: (params: {
2422
- scaAmount: number;
2423
- autoCheck?: boolean;
2424
- veScaKey?: SuiObjectData$1 | string;
2425
- }) => Promise<void>;
2426
- renewExpiredVeScaQuick: (params: {
2427
- scaAmount: number;
2428
- lockPeriodInDays: number;
2429
- autoCheck?: boolean;
2430
- veScaKey?: SuiObjectData$1 | string;
2431
- }) => Promise<void>;
2432
- redeemScaQuick: <T extends boolean>(params: {
2433
- veScaKey?: SuiObjectData$1 | string;
2434
- transferSca?: T;
2435
- }) => Promise<QuickMethodReturnType<T> | undefined>;
2436
- splitVeScaQuick: <T extends boolean>(params: {
2437
- splitAmount: string;
2438
- veScaKey: string;
2439
- transferVeScaKey?: T;
2440
- }) => Promise<QuickMethodReturnType<T> | undefined>;
2441
- mergeVeScaQuick: (params: {
2442
- targetVeScaKey: string;
2443
- sourceVeScaKey: string;
2444
- }) => Promise<void>;
2445
- };
2446
- type SuiTxBlockWithVeScaNormalMethods = SuiTxBlock & VeScaNormalMethods;
2447
- type VeScaTxBlock = SuiTxBlockWithVeScaNormalMethods & VeScaQuickMethods;
2448
- type GenerateVeScaNormalMethod = (params: {
2449
- builder: ScallopBuilder;
2450
- txBlock: SuiTxBlock;
2451
- }) => VeScaNormalMethods;
2452
- type GenerateVeScaQuickMethod = (params: {
2453
- builder: ScallopBuilder;
2454
- txBlock: SuiTxBlockWithVeScaNormalMethods;
2455
- }) => VeScaQuickMethods;
2456
-
2457
- type LoyaltyProgramNormalMethods = {
2458
- claimLoyaltyRevenue: (veScaKey: SuiObjectArg) => TransactionResult$1;
2459
- claimVeScaLoyaltyReward: (veScaKey: SuiObjectArg) => TransactionResult$1;
2460
- };
2461
- type LoyaltyProgramQuickMethods = {
2462
- claimLoyaltyRevenueQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
2463
- claimVeScaLoyaltyRewardQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
2464
- };
2465
- type SuiTxBlockWithLoyaltyProgramNormalMethods = SuiTxBlock & LoyaltyProgramNormalMethods;
2466
- type LoyaltyProgramTxBlock = SuiTxBlockWithLoyaltyProgramNormalMethods & LoyaltyProgramQuickMethods;
2467
- type GenerateLoyaltyProgramNormalMethod = (params: {
2468
- builder: ScallopBuilder;
2469
- txBlock: SuiTxBlock;
2470
- }) => LoyaltyProgramNormalMethods;
2471
- type GenerateLoyaltyProgramQuickMethod = (params: {
2472
- builder: ScallopBuilder;
2473
- txBlock: SuiTxBlockWithLoyaltyProgramNormalMethods;
2474
- }) => LoyaltyProgramQuickMethods;
2475
-
2476
- type sCoinPkgIds = {
2477
- pkgId: string;
2478
- };
2479
- type sCoinNormalMethods = {
1081
+ getPriceUpdatePolicies(): Promise<{
1082
+ primary: _mysten_sui_dist_cjs_client.SuiObjectResponse | null;
1083
+ secondary: _mysten_sui_dist_cjs_client.SuiObjectResponse | null;
1084
+ }>;
2480
1085
  /**
2481
- * Lock marketCoin and return sCoin
2482
- * @param marketCoinName
2483
- * @param marketCoin
1086
+ * Return the supported primary and secondary oracles for all supported pool assets
2484
1087
  * @returns
2485
1088
  */
2486
- mintSCoin: (marketCoinName: string, marketCoin: SuiObjectArg) => TransactionResult$1;
1089
+ getAssetOracles(): Promise<Record<string, xOracleRules>>;
2487
1090
  /**
2488
- * Burn sCoin and return marketCoin
2489
- * @param sCoinName
2490
- * @param sCoin
1091
+ * Get switchboard on-demand aggregator object id based on coinType
1092
+ * @param coinType
2491
1093
  * @returns
2492
1094
  */
2493
- burnSCoin: (sCoinName: string, sCoin: SuiObjectArg) => TransactionResult$1;
2494
- };
2495
- type sCoinQuickMethods = {
2496
- mintSCoinQuick: (marketCoinName: string, amount: number) => Promise<TransactionResult$1>;
2497
- burnSCoinQuick: (sCoinName: string, amount: number) => Promise<TransactionResult$1>;
2498
- };
2499
- type SuiTxBlockWithSCoinNormalMethods = SuiTxBlock & BaseScallopTxBlock & sCoinNormalMethods;
2500
- type SCoinTxBlock = SuiTxBlockWithSCoinNormalMethods & sCoinQuickMethods;
2501
- type GenerateSCoinNormalMethod = (params: {
2502
- builder: ScallopBuilder;
2503
- txBlock: SuiTxBlock;
2504
- }) => sCoinNormalMethods;
2505
- type GenerateSCoinQuickMethod = (params: {
2506
- builder: ScallopBuilder;
2507
- txBlock: SuiTxBlockWithSCoinNormalMethods;
2508
- }) => sCoinQuickMethods;
2509
-
2510
- type ReferralNormalMethods = {
2511
- bindToReferral: (veScaKeyId: string) => void;
2512
- claimReferralTicket: (poolCoinName: string) => TransactionResult$1;
2513
- burnReferralTicket: (ticket: SuiObjectArg, poolCoinName: string) => void;
2514
- claimReferralRevenue: (veScaKey: SuiObjectArg, poolCoinName: string) => TransactionResult$1;
2515
- };
2516
- type ReferralQuickMethods = {
2517
- claimReferralRevenueQuick: (veScaKey: SuiObjectArg, coinNames: string[]) => Promise<void>;
2518
- };
2519
- type SuiTxBlockWithReferralNormalMethods = SuiTxBlock & ReferralNormalMethods;
2520
- type ReferralTxBlock = SuiTxBlockWithReferralNormalMethods & ReferralQuickMethods;
2521
-
2522
- type BaseScallopTxBlock = ReferralTxBlock & LoyaltyProgramTxBlock & BorrowIncentiveTxBlock & VeScaTxBlock;
2523
- type SuiTxBlockWithSCoin = BaseScallopTxBlock & SCoinTxBlock;
2524
- type SuiTxBlockWithSpool = SuiTxBlockWithSCoin & SpoolTxBlock;
2525
- type ScallopTxBlock = SuiTxBlockWithSpool & CoreTxBlock;
2526
- type SelectCoinReturnType<T extends string> = T extends 'sui' ? {
2527
- takeCoin: NestedResult;
2528
- } : {
2529
- takeCoin: NestedResult;
2530
- leftCoin: NestedResult;
2531
- };
1095
+ getSwitchboardOnDemandAggregatorObjectIds(coinName: string[]): Promise<string[]>;
1096
+ }
2532
1097
 
2533
1098
  type ScallopBuilderParams = {
2534
1099
  query?: ScallopQuery;
2535
1100
  usePythPullModel?: boolean;
2536
- pythSponsoredFeeds?: string[];
1101
+ sponsoredFeeds?: string[];
2537
1102
  useOnChainXOracleList?: boolean;
2538
1103
  } & ScallopQueryParams;
2539
1104
  /**
@@ -2551,7 +1116,7 @@ declare class ScallopBuilder implements ScallopBuilderInterface {
2551
1116
  readonly query: ScallopQuery;
2552
1117
  readonly usePythPullModel: boolean;
2553
1118
  readonly useOnChainXOracleList: boolean;
2554
- readonly pythSponsoredFeeds: string[];
1119
+ readonly sponsoredFeeds: string[];
2555
1120
  constructor(params: ScallopBuilderParams);
2556
1121
  get utils(): ScallopUtils;
2557
1122
  get constants(): ScallopConstants;
@@ -2579,9 +1144,19 @@ declare class ScallopBuilder implements ScallopBuilderInterface {
2579
1144
  * @param assetCoinName - Specific support asset coin name.
2580
1145
  * @param amount - Amount of coins to be selected.
2581
1146
  * @param sender - Sender address.
1147
+ * @param isSponsored - Whether the transaction is a sponsored transaction.
2582
1148
  * @return Take coin and left coin.
2583
1149
  */
2584
- selectCoin<T extends string>(txBlock: ScallopTxBlock | SuiTxBlock, assetCoinName: T, amount: number, sender?: string): Promise<SelectCoinReturnType<T>>;
1150
+ selectCoin(txBlock: ScallopTxBlock | SuiTxBlock, assetCoinName: string, amount: number, sender?: string, isSponsored?: boolean): Promise<{
1151
+ takeCoin: {
1152
+ $kind: "NestedResult";
1153
+ NestedResult: [number, number];
1154
+ };
1155
+ leftCoin?: undefined;
1156
+ } | {
1157
+ takeCoin: TransactionObjectArgument;
1158
+ leftCoin: TransactionObjectArgument;
1159
+ }>;
2585
1160
  /**
2586
1161
  * Specifying the sender's amount of market coins to get coins args from transaction result.
2587
1162
  *
@@ -2654,6 +1229,7 @@ declare class ScallopUtils implements ScallopUtilsInterface {
2654
1229
  pythEndpoints: string[];
2655
1230
  readonly scallopSuiKit: ScallopSuiKit;
2656
1231
  readonly constants: ScallopConstants;
1232
+ readonly timeout: number;
2657
1233
  constructor(params?: ScallopUtilsParams);
2658
1234
  get walletAddress(): string;
2659
1235
  get suiKit(): _scallop_io_sui_kit.SuiKit;
@@ -2984,10 +1560,11 @@ declare class ScallopClient implements ScallopClientInterface {
2984
1560
  * @param sign - Decide to directly sign the transaction or return the transaction block.
2985
1561
  * @param obligationId - The obligation object.
2986
1562
  * @param walletAddress - The wallet address of the owner.
1563
+ * @param isSponsoredTx - Whether the transaction is sponsored.
2987
1564
  * @return Transaction block response or transaction block.
2988
1565
  */
2989
1566
  depositCollateral(collateralCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
2990
- depositCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign?: S, obligationId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1567
+ depositCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign?: S, obligationId?: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
2991
1568
  /**
2992
1569
  * Withdraw collateral from the specific pool.
2993
1570
  *
@@ -2997,9 +1574,10 @@ declare class ScallopClient implements ScallopClientInterface {
2997
1574
  * @param obligationId - The obligation object.
2998
1575
  * @param obligationKey - The obligation key object to verifying obligation authority.
2999
1576
  * @param walletAddress - The wallet address of the owner.
1577
+ * @param isSponsoredTx - Whether the transaction is sponsored.
3000
1578
  * @return Transaction block response or transaction block.
3001
1579
  */
3002
- withdrawCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1580
+ withdrawCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
3003
1581
  /**
3004
1582
  * Deposit asset into the specific pool.
3005
1583
  *
@@ -3043,9 +1621,10 @@ declare class ScallopClient implements ScallopClientInterface {
3043
1621
  * @param obligationId - The obligation object.
3044
1622
  * @param obligationKey - The obligation key object to verifying obligation authority.
3045
1623
  * @param walletAddress - The wallet address of the owner.
1624
+ * @param isSponsoredTx - Whether the transaction is sponsored.
3046
1625
  * @return Transaction block response or transaction block.
3047
1626
  */
3048
- borrow<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1627
+ borrow<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
3049
1628
  /**
3050
1629
  * Repay asset into the specific pool.
3051
1630
  *
@@ -3054,9 +1633,10 @@ declare class ScallopClient implements ScallopClientInterface {
3054
1633
  * @param sign - Decide to directly sign the transaction or return the transaction block.
3055
1634
  * @param obligationId - The obligation object.
3056
1635
  * @param walletAddress - The wallet address of the owner.
1636
+ * @param isSponsoredTx - Whether the transaction is sponsored.
3057
1637
  * @return Transaction block response or transaction block.
3058
1638
  */
3059
- repay<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1639
+ repay<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
3060
1640
  /**
3061
1641
  * FlashLoan asset from the specific pool.
3062
1642
  *
@@ -3090,157 +1670,1638 @@ declare class ScallopClient implements ScallopClientInterface {
3090
1670
  stake(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
3091
1671
  stake<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
3092
1672
  /**
3093
- * Unstake market coin from the specific spool.
1673
+ * Unstake market coin from the specific spool.
1674
+ *
1675
+ * @param stakeMarketCoinName - Types of mak coin.
1676
+ * @param amount - The amount of coins would deposit.
1677
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1678
+ * @param accountId - The stake account object.
1679
+ * @param walletAddress - The wallet address of the owner.
1680
+ * @return Transaction block response or transaction block.
1681
+ */
1682
+ unstake(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1683
+ unstake<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1684
+ /**
1685
+ * Unstake market coin from the specific spool and withdraw asset from the corresponding pool.
1686
+ *
1687
+ * @param marketCoinName - Types of mak coin.
1688
+ * @param amount - The amount of coins would deposit.
1689
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1690
+ * @param accountId - The stake account object.
1691
+ * @param walletAddress - The wallet address of the owner.
1692
+ * @return Transaction block response or transaction block.
1693
+ */
1694
+ unstakeAndWithdraw(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1695
+ unstakeAndWithdraw<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1696
+ /**
1697
+ * Claim reward coin from the specific spool.
1698
+ *
1699
+ * @param stakeMarketCoinName - Types of mak coin.
1700
+ * @param amount - The amount of coins would deposit.
1701
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1702
+ * @param accountId - The stake account object.
1703
+ * @param walletAddress - The wallet address of the owner.
1704
+ * @return Transaction block response or transaction block.
1705
+ */
1706
+ claim(stakeMarketCoinName: string): Promise<SuiTransactionBlockResponse>;
1707
+ claim<S extends boolean>(stakeMarketCoinName: string, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1708
+ /**
1709
+ * stake obligaion.
1710
+ *
1711
+ * @param obligationId - The obligation account object.
1712
+ * @param obligationKeyId - The obligation key account object.
1713
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1714
+ * @param walletAddress - The wallet address of the owner.
1715
+ * @return Transaction block response or transaction block
1716
+ */
1717
+ stakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1718
+ /**
1719
+ * unstake obligaion.
1720
+ *
1721
+ * @param obligationId - The obligation account object.
1722
+ * @param obligationKeyId - The obligation key account object.
1723
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1724
+ * @param walletAddress - The wallet address of the owner.
1725
+ * @return Transaction block response or transaction block
1726
+ */
1727
+ unstakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1728
+ /**
1729
+ * Claim borrow incentive reward.
1730
+ *
1731
+ * @param poolName
1732
+ * @param amount - The amount of coins would deposit.
1733
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1734
+ * @param accountId - The stake account object.
1735
+ * @param walletAddress - The wallet address of the owner.
1736
+ * @return Transaction block response or transaction block
1737
+ */
1738
+ claimBorrowIncentive<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1739
+ /**
1740
+ * Function to migrate all market coin in user wallet into sCoin
1741
+ * @returns Transaction response
1742
+ */
1743
+ migrateAllMarketCoin<S extends boolean>(includeStakePool?: boolean, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1744
+ /**
1745
+ * Claim unlocked SCA from all veSCA accounts.
1746
+ */
1747
+ claimAllUnlockedSca(): Promise<SuiTransactionBlockResponse>;
1748
+ claimAllUnlockedSca<S extends boolean>(sign?: S, walletAddress?: string): Promise<ScallopClientVeScaReturnType<S>>;
1749
+ /**
1750
+ * Mint and get test coin.
1751
+ *
1752
+ * @remarks
1753
+ * Only be used on the test network.
1754
+ *
1755
+ * @param assetCoinName - Specific asset coin name.
1756
+ * @param amount - The amount of coins minted and received.
1757
+ * @param receiveAddress - The wallet address that receives the coins.
1758
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1759
+ * @return Transaction block response or transaction block.
1760
+ */
1761
+ mintTestCoin(assetCoinName: Exclude<string, 'sui'>, amount: number): Promise<SuiTransactionBlockResponse>;
1762
+ mintTestCoin<S extends boolean>(assetCoinName: Exclude<string, 'sui'>, amount: number, sign?: S, receiveAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1763
+ }
1764
+
1765
+ /**
1766
+ * @argument params - The parameters for the Scallop instance.
1767
+ * @argument cacheOptions - The cache options for the QueryClient.
1768
+ *
1769
+ * @description
1770
+ * The main instance that controls interaction with the Scallop contract.
1771
+ *
1772
+ * @example
1773
+ * ```typescript
1774
+ * const sdk = new Scallop(<parameters>);
1775
+ * const scallopAddress = await sdk.getScallopAddress();
1776
+ * const scallopBuilder = await sdk.createScallopBuilder();
1777
+ * const scallopClient = await sdk.createScallopClient();
1778
+ * const scallopIndexer= await sdk.createScallopIndexer();
1779
+ * const scallopUtils= await sdk.createScallopUtils();
1780
+ * ```
1781
+ */
1782
+ type ScallopParams = {
1783
+ client?: ScallopClient;
1784
+ } & ScallopClientParams;
1785
+ declare class Scallop {
1786
+ readonly client: ScallopClient;
1787
+ constructor(params: ScallopParams);
1788
+ init(force?: boolean): Promise<void>;
1789
+ /**
1790
+ * Create a scallop client instance that already has initial data.
3094
1791
  *
3095
- * @param stakeMarketCoinName - Types of mak coin.
3096
- * @param amount - The amount of coins would deposit.
3097
- * @param sign - Decide to directly sign the transaction or return the transaction block.
3098
- * @param accountId - The stake account object.
3099
- * @param walletAddress - The wallet address of the owner.
3100
- * @return Transaction block response or transaction block.
1792
+ * @return Scallop Client.
3101
1793
  */
3102
- unstake(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
3103
- unstake<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1794
+ createScallopClient(): Promise<ScallopClient>;
3104
1795
  /**
3105
- * Unstake market coin from the specific spool and withdraw asset from the corresponding pool.
1796
+ * Create a scallop builder instance that already has initial data.
3106
1797
  *
3107
- * @param marketCoinName - Types of mak coin.
3108
- * @param amount - The amount of coins would deposit.
3109
- * @param sign - Decide to directly sign the transaction or return the transaction block.
3110
- * @param accountId - The stake account object.
3111
- * @param walletAddress - The wallet address of the owner.
3112
- * @return Transaction block response or transaction block.
1798
+ * @return Scallop Builder.
3113
1799
  */
3114
- unstakeAndWithdraw(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
3115
- unstakeAndWithdraw<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1800
+ createScallopBuilder(): Promise<ScallopBuilder>;
3116
1801
  /**
3117
- * Claim reward coin from the specific spool.
1802
+ * Create a scallop query instance.
3118
1803
  *
3119
- * @param stakeMarketCoinName - Types of mak coin.
3120
- * @param amount - The amount of coins would deposit.
3121
- * @param sign - Decide to directly sign the transaction or return the transaction block.
3122
- * @param accountId - The stake account object.
3123
- * @param walletAddress - The wallet address of the owner.
3124
- * @return Transaction block response or transaction block.
1804
+ * @return Scallop Query.
3125
1805
  */
3126
- claim(stakeMarketCoinName: string): Promise<SuiTransactionBlockResponse>;
3127
- claim<S extends boolean>(stakeMarketCoinName: string, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1806
+ createScallopQuery(): Promise<ScallopQuery>;
3128
1807
  /**
3129
- * stake obligaion.
1808
+ * Create a scallop utils instance.
3130
1809
  *
3131
- * @param obligationId - The obligation account object.
3132
- * @param obligationKeyId - The obligation key account object.
3133
- * @param sign - Decide to directly sign the transaction or return the transaction block.
3134
- * @param walletAddress - The wallet address of the owner.
3135
- * @return Transaction block response or transaction block
1810
+ * @return Scallop Utils.
3136
1811
  */
3137
- stakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1812
+ createScallopUtils(): Promise<ScallopUtils>;
3138
1813
  /**
3139
- * unstake obligaion.
1814
+ * Create a scallop indexer instance.
3140
1815
  *
3141
- * @param obligationId - The obligation account object.
3142
- * @param obligationKeyId - The obligation key account object.
3143
- * @param sign - Decide to directly sign the transaction or return the transaction block.
3144
- * @param walletAddress - The wallet address of the owner.
3145
- * @return Transaction block response or transaction block
1816
+ * @return Scallop Indexer.
3146
1817
  */
3147
- unstakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1818
+ createScallopIndexer(): Promise<ScallopIndexer>;
3148
1819
  /**
3149
- * Claim borrow incentive reward.
3150
- *
3151
- * @param poolName
3152
- * @param amount - The amount of coins would deposit.
3153
- * @param sign - Decide to directly sign the transaction or return the transaction block.
3154
- * @param accountId - The stake account object.
3155
- * @param walletAddress - The wallet address of the owner.
3156
- * @return Transaction block response or transaction block
1820
+ * Get a scallop constants instance that already has initial data.
1821
+ * @returns Scallop Constants
3157
1822
  */
3158
- claimBorrowIncentive<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1823
+ getScallopConstants(): Promise<ScallopConstants>;
1824
+ }
1825
+
1826
+ type CoreIds = {
1827
+ protocolPkg: string;
1828
+ market: string;
1829
+ version: string;
1830
+ coinDecimalsRegistry: string;
1831
+ xOracle: string;
1832
+ };
1833
+ type NestedResult = Extract<Argument, {
1834
+ $kind: 'NestedResult';
1835
+ }>;
1836
+ type Obligation$1 = NestedResult;
1837
+ type ObligationKey = NestedResult;
1838
+ type ObligationHotPotato = NestedResult;
1839
+ type CoreNormalMethods = {
1840
+ openObligation: () => [Obligation$1, ObligationKey, ObligationHotPotato];
1841
+ returnObligation: (obligation: SuiObjectArg, obligationHotPotato: SuiObjectArg) => void;
1842
+ openObligationEntry: () => void;
1843
+ addCollateral: (obligation: SuiObjectArg, coin: SuiObjectArg, collateralCoinName: string) => void;
1844
+ takeCollateral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, collateralCoinName: string) => TransactionResult;
1845
+ deposit: (coin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1846
+ depositEntry: (coin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1847
+ withdraw: (marketCoin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1848
+ withdrawEntry: (marketCoin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1849
+ borrow: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: string) => TransactionResult;
1850
+ borrowWithReferral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, borrowReferral: SuiObjectArg, amount: number | SuiTxArg, poolCoinName: string) => TransactionResult;
1851
+ borrowEntry: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: string) => TransactionResult;
1852
+ repay: (obligation: SuiObjectArg, coin: SuiObjectArg, poolCoinName: string) => void;
1853
+ borrowFlashLoan: (amount: number | SuiTxArg, poolCoinName: string) => TransactionResult;
1854
+ repayFlashLoan: (coin: SuiObjectArg, loan: SuiObjectArg, poolCoinName: string) => void;
1855
+ };
1856
+ type CoreQuickMethods = {
1857
+ addCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
1858
+ takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
1859
+ usePythPullModel?: boolean;
1860
+ useOnChainXOracleList?: boolean;
1861
+ sponsoredFeeds?: string[];
1862
+ isSponsoredTx?: boolean;
1863
+ }) => Promise<TransactionResult>;
1864
+ borrowQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
1865
+ usePythPullModel?: boolean;
1866
+ useOnChainXOracleList?: boolean;
1867
+ sponsoredFeeds?: string[];
1868
+ isSponsoredTx?: boolean;
1869
+ }) => Promise<TransactionResult>;
1870
+ borrowWithReferralQuick: (amount: number, poolCoinName: string, borrowReferral: SuiObjectArg, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
1871
+ usePythPullModel?: boolean;
1872
+ useOnChainXOracleList?: boolean;
1873
+ sponsoredFeeds?: string[];
1874
+ isSponsoredTx?: boolean;
1875
+ }) => Promise<TransactionResult>;
1876
+ depositQuick: (amount: number, poolCoinName: string, returnSCoin?: boolean, isSponsoredTx?: boolean) => Promise<TransactionResult>;
1877
+ withdrawQuick: (amount: number, poolCoinName: string) => Promise<TransactionResult>;
1878
+ repayQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
1879
+ updateAssetPricesQuick: (assetCoinNames?: string[], updateOracleOptions?: {
1880
+ usePythPullModel?: boolean;
1881
+ useOnChainXOracleList?: boolean;
1882
+ sponsoredFeeds?: string[];
1883
+ isSponsoredTx?: boolean;
1884
+ }) => Promise<void>;
1885
+ };
1886
+ type SuiTxBlockWithCoreNormalMethods = SuiTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
1887
+ type CoreTxBlock = SuiTxBlockWithCoreNormalMethods & CoreQuickMethods;
1888
+ type GenerateCoreNormalMethod = (params: {
1889
+ builder: ScallopBuilder;
1890
+ txBlock: SuiTxBlock;
1891
+ }) => CoreNormalMethods;
1892
+ type GenerateCoreQuickMethod = (params: {
1893
+ builder: ScallopBuilder;
1894
+ txBlock: SuiTxBlockWithCoreNormalMethods;
1895
+ }) => CoreQuickMethods;
1896
+
1897
+ type SpoolIds = {
1898
+ spoolPkg: string;
1899
+ };
1900
+ type SpoolNormalMethods = {
1901
+ createStakeAccount: (stakeMarketCoinName: string) => TransactionResult;
1902
+ stake: (stakeAccount: SuiAddressArg, coin: SuiObjectArg, stakeMarketCoinName: string) => void;
1903
+ unstake: (stakeAccount: SuiAddressArg, amount: number, stakeMarketCoinName: string) => TransactionResult;
1904
+ claim: (stakeAccount: SuiAddressArg, stakeMarketCoinName: string) => TransactionResult;
1905
+ };
1906
+ type SpoolQuickMethods = {
1907
+ stakeQuick(amountOrMarketCoin: SuiObjectArg | number, stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg): Promise<void>;
1908
+ unstakeQuick(amount: number, stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg, returnSCoin?: boolean): Promise<TransactionResult | undefined>;
1909
+ claimQuick(stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg): Promise<TransactionResult[]>;
1910
+ };
1911
+ type SuiTxBlockWithSpoolNormalMethods = SuiTxBlock & SuiTxBlockWithSCoin & SpoolNormalMethods;
1912
+ type SpoolTxBlock = SuiTxBlockWithSpoolNormalMethods & SpoolQuickMethods;
1913
+ type GenerateSpoolNormalMethod = (params: {
1914
+ builder: ScallopBuilder;
1915
+ txBlock: SuiTxBlock;
1916
+ }) => SpoolNormalMethods;
1917
+ type GenerateSpoolQuickMethod = (params: {
1918
+ builder: ScallopBuilder;
1919
+ txBlock: SuiTxBlockWithSpoolNormalMethods;
1920
+ }) => SpoolQuickMethods;
1921
+
1922
+ type BorrowIncentiveIds = {
1923
+ borrowIncentivePkg: string;
1924
+ query: string;
1925
+ config: string;
1926
+ incentivePools: string;
1927
+ incentiveAccounts: string;
1928
+ obligationAccessStore: string;
1929
+ };
1930
+ type BorrowIncentiveNormalMethods = {
1931
+ stakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
1932
+ stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey: SuiObjectArg) => void;
1933
+ unstakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
1934
+ claimBorrowIncentive: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, rewardType: string) => TransactionResult;
1935
+ deactivateBoost: (obligation: SuiObjectArg, veScaKey: SuiObjectArg) => void;
1936
+ };
1937
+ type BorrowIncentiveQuickMethods = {
1938
+ stakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
1939
+ stakeObligationWithVeScaQuick(obligation?: string, obligationKey?: string, veScaKey?: string): Promise<void>;
1940
+ unstakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
1941
+ claimBorrowIncentiveQuick(rewardType: string, obligation?: string, obligationKey?: string): Promise<TransactionResult>;
1942
+ };
1943
+ type SuiTxBlockWithBorrowIncentiveNormalMethods = SuiTxBlock & BorrowIncentiveNormalMethods;
1944
+ type BorrowIncentiveTxBlock = SuiTxBlockWithBorrowIncentiveNormalMethods & BorrowIncentiveQuickMethods;
1945
+ type GenerateBorrowIncentiveNormalMethod = (params: {
1946
+ builder: ScallopBuilder;
1947
+ txBlock: SuiTxBlock;
1948
+ }) => BorrowIncentiveNormalMethods;
1949
+ type GenerateBorrowIncentiveQuickMethod = (params: {
1950
+ builder: ScallopBuilder;
1951
+ txBlock: SuiTxBlockWithBorrowIncentiveNormalMethods;
1952
+ }) => BorrowIncentiveQuickMethods;
1953
+
1954
+ type VeScaNormalMethods = {
1955
+ lockSca: (scaCoin: SuiObjectArg, unlockAtInSecondTimestamp: number) => TransactionResult;
1956
+ extendLockPeriod: (veScaKey: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
1957
+ extendLockAmount: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg) => void;
1958
+ renewExpiredVeSca: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
1959
+ redeemSca: (veScaKey: SuiObjectArg) => TransactionResult;
1960
+ mintEmptyVeSca: () => TransactionResult;
1961
+ splitVeSca: (veScaKey: SuiObjectArg, splitAmount: string) => TransactionResult;
1962
+ mergeVeSca: (targetVeScaKey: SuiObjectArg, sourceVeScaKey: SuiObjectArg) => void;
1963
+ };
1964
+ type QuickMethodReturnType<T extends boolean> = T extends true ? void : TransactionResult;
1965
+ type VeScaQuickMethods = {
3159
1966
  /**
3160
- * Function to migrate all market coin in user wallet into sCoin
3161
- * @returns Transaction response
1967
+ * Quick methods to automate
1968
+ * lock initial SCA, extend lock period, lock more SCA, renew expired VeSCA, and redeem SCA
1969
+ *
1970
+ * **Flow:**
1971
+ * - If only `amountOrCoin` is provided, it will lock the amount of existing not expired veSCA
1972
+ * - If only `lockPeriodInDays` is provided, it will extend the lock period of existing not expired veSCA
1973
+ *
1974
+ * **Note:**
1975
+ * - If one or both flow above is used on a expired veSCA, it will claim the unlocked SCA
1976
+ * and renew the veSCA first, and then flow continues
1977
+ * - If users has no veSCA yet, they need to provide both `amountOrCoin` and `lockPeriodInDays` for initial lock
1978
+ * @param amountOrCoin
1979
+ * @param lockPeriodInDays
1980
+ * @param autoCheck
3162
1981
  */
3163
- migrateAllMarketCoin<S extends boolean>(includeStakePool?: boolean, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1982
+ lockScaQuick(params: {
1983
+ amountOrCoin?: SuiObjectArg | number;
1984
+ lockPeriodInDays?: number;
1985
+ autoCheck?: boolean;
1986
+ veScaKey?: SuiObjectData$1 | string;
1987
+ }): Promise<void>;
1988
+ extendLockPeriodQuick: (params: {
1989
+ lockPeriodInDays: number;
1990
+ autoCheck?: boolean;
1991
+ veScaKey?: SuiObjectData$1 | string;
1992
+ }) => Promise<void>;
1993
+ extendLockAmountQuick: (params: {
1994
+ scaAmount: number;
1995
+ autoCheck?: boolean;
1996
+ veScaKey?: SuiObjectData$1 | string;
1997
+ }) => Promise<void>;
1998
+ renewExpiredVeScaQuick: (params: {
1999
+ scaAmount: number;
2000
+ lockPeriodInDays: number;
2001
+ autoCheck?: boolean;
2002
+ veScaKey?: SuiObjectData$1 | string;
2003
+ }) => Promise<void>;
2004
+ redeemScaQuick: <T extends boolean>(params: {
2005
+ veScaKey?: SuiObjectData$1 | string;
2006
+ transferSca?: T;
2007
+ }) => Promise<QuickMethodReturnType<T> | undefined>;
2008
+ splitVeScaQuick: <T extends boolean>(params: {
2009
+ splitAmount: string;
2010
+ veScaKey: string;
2011
+ transferVeScaKey?: T;
2012
+ }) => Promise<QuickMethodReturnType<T> | undefined>;
2013
+ mergeVeScaQuick: (params: {
2014
+ targetVeScaKey: string;
2015
+ sourceVeScaKey: string;
2016
+ }) => Promise<void>;
2017
+ };
2018
+ type SuiTxBlockWithVeScaNormalMethods = SuiTxBlock & VeScaNormalMethods;
2019
+ type VeScaTxBlock = SuiTxBlockWithVeScaNormalMethods & VeScaQuickMethods;
2020
+ type GenerateVeScaNormalMethod = (params: {
2021
+ builder: ScallopBuilder;
2022
+ txBlock: SuiTxBlock;
2023
+ }) => VeScaNormalMethods;
2024
+ type GenerateVeScaQuickMethod = (params: {
2025
+ builder: ScallopBuilder;
2026
+ txBlock: SuiTxBlockWithVeScaNormalMethods;
2027
+ }) => VeScaQuickMethods;
2028
+
2029
+ type ReferralNormalMethods = {
2030
+ bindToReferral: (veScaKeyId: string) => void;
2031
+ claimReferralTicket: (poolCoinName: string) => TransactionResult$1;
2032
+ burnReferralTicket: (ticket: SuiObjectArg, poolCoinName: string) => void;
2033
+ claimReferralRevenue: (veScaKey: SuiObjectArg, poolCoinName: string) => TransactionResult$1;
2034
+ };
2035
+ type ReferralQuickMethods = {
2036
+ claimReferralRevenueQuick: (veScaKey: SuiObjectArg, coinNames: string[]) => Promise<void>;
2037
+ };
2038
+ type SuiTxBlockWithReferralNormalMethods = SuiTxBlock & ReferralNormalMethods;
2039
+ type ReferralTxBlock = SuiTxBlockWithReferralNormalMethods & ReferralQuickMethods;
2040
+
2041
+ type LoyaltyProgramNormalMethods = {
2042
+ claimLoyaltyRevenue: (veScaKey: SuiObjectArg) => TransactionResult$1;
2043
+ claimVeScaLoyaltyReward: (veScaKey: SuiObjectArg) => TransactionResult$1;
2044
+ };
2045
+ type LoyaltyProgramQuickMethods = {
2046
+ claimLoyaltyRevenueQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
2047
+ claimVeScaLoyaltyRewardQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
2048
+ };
2049
+ type SuiTxBlockWithLoyaltyProgramNormalMethods = SuiTxBlock & LoyaltyProgramNormalMethods;
2050
+ type LoyaltyProgramTxBlock = SuiTxBlockWithLoyaltyProgramNormalMethods & LoyaltyProgramQuickMethods;
2051
+ type GenerateLoyaltyProgramNormalMethod = (params: {
2052
+ builder: ScallopBuilder;
2053
+ txBlock: SuiTxBlock;
2054
+ }) => LoyaltyProgramNormalMethods;
2055
+ type GenerateLoyaltyProgramQuickMethod = (params: {
2056
+ builder: ScallopBuilder;
2057
+ txBlock: SuiTxBlockWithLoyaltyProgramNormalMethods;
2058
+ }) => LoyaltyProgramQuickMethods;
2059
+
2060
+ type sCoinPkgIds = {
2061
+ pkgId: string;
2062
+ };
2063
+ type sCoinNormalMethods = {
3164
2064
  /**
3165
- * Claim unlocked SCA from all veSCA accounts.
2065
+ * Lock marketCoin and return sCoin
2066
+ * @param marketCoinName
2067
+ * @param marketCoin
2068
+ * @returns
3166
2069
  */
3167
- claimAllUnlockedSca(): Promise<SuiTransactionBlockResponse>;
3168
- claimAllUnlockedSca<S extends boolean>(sign?: S, walletAddress?: string): Promise<ScallopClientVeScaReturnType<S>>;
2070
+ mintSCoin: (marketCoinName: string, marketCoin: SuiObjectArg) => TransactionResult$1;
3169
2071
  /**
3170
- * Mint and get test coin.
3171
- *
3172
- * @remarks
3173
- * Only be used on the test network.
3174
- *
3175
- * @param assetCoinName - Specific asset coin name.
3176
- * @param amount - The amount of coins minted and received.
3177
- * @param receiveAddress - The wallet address that receives the coins.
3178
- * @param sign - Decide to directly sign the transaction or return the transaction block.
3179
- * @return Transaction block response or transaction block.
2072
+ * Burn sCoin and return marketCoin
2073
+ * @param sCoinName
2074
+ * @param sCoin
2075
+ * @returns
3180
2076
  */
3181
- mintTestCoin(assetCoinName: Exclude<string, 'sui'>, amount: number): Promise<SuiTransactionBlockResponse>;
3182
- mintTestCoin<S extends boolean>(assetCoinName: Exclude<string, 'sui'>, amount: number, sign?: S, receiveAddress?: string): Promise<ScallopClientFnReturnType<S>>;
2077
+ burnSCoin: (sCoinName: string, sCoin: SuiObjectArg) => TransactionResult$1;
2078
+ };
2079
+ type sCoinQuickMethods = {
2080
+ mintSCoinQuick: (marketCoinName: string, amount: number) => Promise<TransactionResult$1>;
2081
+ burnSCoinQuick: (sCoinName: string, amount: number) => Promise<TransactionResult$1>;
2082
+ };
2083
+ type SuiTxBlockWithSCoinNormalMethods = SuiTxBlock & BaseScallopTxBlock & sCoinNormalMethods;
2084
+ type SCoinTxBlock = SuiTxBlockWithSCoinNormalMethods & sCoinQuickMethods;
2085
+ type GenerateSCoinNormalMethod = (params: {
2086
+ builder: ScallopBuilder;
2087
+ txBlock: SuiTxBlock;
2088
+ }) => sCoinNormalMethods;
2089
+ type GenerateSCoinQuickMethod = (params: {
2090
+ builder: ScallopBuilder;
2091
+ txBlock: SuiTxBlockWithSCoinNormalMethods;
2092
+ }) => sCoinQuickMethods;
2093
+
2094
+ type BaseScallopTxBlock = ReferralTxBlock & LoyaltyProgramTxBlock & BorrowIncentiveTxBlock & VeScaTxBlock;
2095
+ type SuiTxBlockWithSCoin = BaseScallopTxBlock & SCoinTxBlock;
2096
+ type SuiTxBlockWithSpool = SuiTxBlockWithSCoin & SpoolTxBlock;
2097
+ type ScallopTxBlock = SuiTxBlockWithSpool & CoreTxBlock;
2098
+
2099
+ type PoolAddress = {
2100
+ coinName: string;
2101
+ symbol: string;
2102
+ coinType: string;
2103
+ coinMetadataId: string;
2104
+ decimals: number;
2105
+ isIsolated: boolean;
2106
+ pythFeed?: string;
2107
+ pythFeedObjectId?: string;
2108
+ lendingPoolAddress?: string;
2109
+ borrowDynamic?: string;
2110
+ interestModel?: string;
2111
+ borrowFeeKey?: string;
2112
+ flashloanFeeObject?: string;
2113
+ coinGeckoId?: string;
2114
+ collateralPoolAddress?: string;
2115
+ riskModel?: string;
2116
+ supplyLimitKey?: string;
2117
+ borrowLimitKey?: string;
2118
+ sCoinType?: string;
2119
+ sCoinName?: string;
2120
+ sCoinSymbol?: string;
2121
+ sCoinMetadataId?: string;
2122
+ sCoinTreasury?: string;
2123
+ isolatedAssetKey: string;
2124
+ spool?: string;
2125
+ spoolReward?: string;
2126
+ spoolName?: string;
2127
+ };
2128
+ type Whitelist = {
2129
+ lending: Set<string>;
2130
+ borrowing: Set<string>;
2131
+ collateral: Set<string>;
2132
+ packages: Set<string>;
2133
+ spool: Set<string>;
2134
+ scoin: Set<string>;
2135
+ suiBridge: Set<string>;
2136
+ wormhole: Set<string>;
2137
+ oracles: Set<string>;
2138
+ borrowIncentiveRewards: Set<string>;
2139
+ rewardsAsPoint: Set<string>;
2140
+ pythEndpoints: Set<string>;
2141
+ deprecated: Set<string>;
2142
+ emerging: Set<string>;
2143
+ };
2144
+ type CoinWrappedType = {
2145
+ from: string;
2146
+ type: string;
2147
+ } | undefined;
2148
+
2149
+ type Coins = {
2150
+ [K in string]: K;
2151
+ };
2152
+ type AssetCoins = {
2153
+ [K in string]: K;
2154
+ };
2155
+ type MarketCoins = {
2156
+ [K in string]: K;
2157
+ };
2158
+ type SCoins = {
2159
+ [K in string]: K;
2160
+ };
2161
+ type StakeMarketCoins = {
2162
+ [K in string]: K;
2163
+ };
2164
+ type StakeRewardCoins = {
2165
+ [key in string]: string;
2166
+ };
2167
+ type SuiBridgeCoins = {
2168
+ [K in string]: K;
2169
+ };
2170
+ type BorrowIncentiveRewardCoins = {
2171
+ [key in string]: string[];
2172
+ };
2173
+ type AssetCoinIds = {
2174
+ [key in string]: string;
2175
+ };
2176
+ type SCoinIds = {
2177
+ [key in string]: string;
2178
+ };
2179
+ type SCoinTreasuryCaps = {
2180
+ [key in string]: string;
2181
+ };
2182
+ type SCoinConverterTreasury = {
2183
+ [key in string]: string;
2184
+ };
2185
+ type PickFromUnion<T, K extends string> = K extends T ? K : never;
2186
+ type WormholeCoinIds = {
2187
+ [key in PickFromUnion<string, 'weth' | 'wbtc' | 'wusdc' | 'wusdt' | 'wapt' | 'wsol'>]: string;
2188
+ };
2189
+ type VoloCoinIds = {
2190
+ [key in PickFromUnion<string, 'vsui'>]: string;
2191
+ };
2192
+ type SuiBridgedCoinPackageIds = {
2193
+ [key in string]: string;
2194
+ };
2195
+
2196
+ declare const _SUPPORT_ORACLES: readonly ["supra", "switchboard", "pyth"];
2197
+ type SupportOracleType = (typeof _SUPPORT_ORACLES)[number];
2198
+ type xOracleRules = {
2199
+ primary: SupportOracleType[];
2200
+ secondary: SupportOracleType[];
2201
+ };
2202
+ type xOracleRuleType = keyof xOracleRules;
2203
+ type xOracleListType = {
2204
+ [key in string]: xOracleRules;
2205
+ };
2206
+
2207
+ interface BorrowIncentiveAccountKey {
2208
+ id: string;
2209
+ onwerId: string;
2210
+ }
2211
+ type OptionalKeys$4<T> = {
2212
+ [K in keyof T]?: T[K];
2213
+ };
2214
+ type BorrowIncentivePools = OptionalKeys$4<Record<string, BorrowIncentivePool>>;
2215
+ type BorrowIncentivePoolPoints = {
2216
+ symbol: string;
2217
+ coinName: string;
2218
+ coinType: string;
2219
+ coinDecimal: number;
2220
+ coinPrice: number;
2221
+ } & Required<Pick<ParsedBorrowIncentivePoolPointData, 'points' | 'distributedPoint' | 'weightedAmount'>> & CalculatedBorrowIncentivePoolPointData;
2222
+ type BorrowIncentivePool = {
2223
+ coinName: string;
2224
+ symbol: string;
2225
+ coinType: string;
2226
+ coinDecimal: number;
2227
+ coinPrice: number;
2228
+ stakedAmount: number;
2229
+ stakedCoin: number;
2230
+ stakedValue: number;
2231
+ points: OptionalKeys$4<Record<string, BorrowIncentivePoolPoints>>;
2232
+ };
2233
+ type OriginBorrowIncentivePoolPointData = {
2234
+ point_type: {
2235
+ name: string;
2236
+ };
2237
+ distributed_point_per_period: string;
2238
+ point_distribution_time: string;
2239
+ distributed_point: string;
2240
+ points: string;
2241
+ index: string;
2242
+ base_weight: string;
2243
+ weighted_amount: string;
2244
+ last_update: string;
2245
+ created_at: string;
2246
+ };
2247
+ type OriginBorrowIncentivePoolData = {
2248
+ pool_type: {
2249
+ name: string;
2250
+ };
2251
+ points: OriginBorrowIncentivePoolPointData[];
2252
+ min_stakes: string;
2253
+ max_stakes: string;
2254
+ stakes: string;
2255
+ created_at: string;
2256
+ };
2257
+ type ParsedBorrowIncentivePoolPointData = {
2258
+ pointType: string;
2259
+ distributedPointPerPeriod: number;
2260
+ period: number;
2261
+ distributedPoint: number;
2262
+ points: number;
2263
+ index: number;
2264
+ baseWeight: number;
2265
+ weightedAmount: number;
2266
+ lastUpdate: number;
2267
+ createdAt: number;
2268
+ };
2269
+ type ParsedBorrowIncentivePoolData = {
2270
+ poolType: string;
2271
+ poolPoints: OptionalKeys$4<Record<string, ParsedBorrowIncentivePoolPointData>>;
2272
+ minStakes: number;
2273
+ maxStakes: number;
2274
+ staked: number;
2275
+ };
2276
+ type CalculatedBorrowIncentivePoolPointData = {
2277
+ baseWeight: number;
2278
+ weightedStakedAmount: number;
2279
+ weightedStakedCoin: number;
2280
+ weightedStakedValue: number;
2281
+ distributedPointPerSec: number;
2282
+ accumulatedPoints: number;
2283
+ currentPointIndex: number;
2284
+ currentTotalDistributedPoint: number;
2285
+ rewardApr: number;
2286
+ rewardPerSec: number;
2287
+ };
2288
+ type BorrowIncentiveAccounts = OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountData>>;
2289
+ type OriginBorrowIncentiveAccountPoolData = {
2290
+ point_type: {
2291
+ name: string;
2292
+ };
2293
+ weighted_amount: string;
2294
+ points: string;
2295
+ total_points: string;
2296
+ index: string;
2297
+ };
2298
+ type OriginBorrowIncentiveAccountData = {
2299
+ points_list: OriginBorrowIncentiveAccountPoolData[];
2300
+ pool_type: {
2301
+ name: string;
2302
+ };
2303
+ debt_amount: string;
2304
+ };
2305
+ type ParsedBorrowIncentiveAccountPoolData = {
2306
+ pointType: string;
2307
+ weightedAmount: number;
2308
+ points: number;
2309
+ totalPoints: number;
2310
+ index: number;
2311
+ };
2312
+ type ParsedBorrowIncentiveAccountData = {
2313
+ pointList: OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountPoolData>>;
2314
+ poolType: string;
2315
+ debtAmount: number;
2316
+ };
2317
+ /**
2318
+ * The query interface for `incentive_pools_query::incentive_pools_data` inspectTxn.
2319
+ */
2320
+ interface BorrowIncentivePoolsQueryInterface {
2321
+ incentive_pools: OriginBorrowIncentivePoolData[];
2322
+ }
2323
+ /**
2324
+ * The query interface for `incentive_account_query::incentive_account_data` inspectTxn.
2325
+ */
2326
+ interface BorrowIncentiveAccountsQueryInterface {
2327
+ pool_records: OriginBorrowIncentiveAccountData[];
2328
+ }
2329
+
2330
+ type OptionalKeys$3<T> = {
2331
+ [K in keyof T]?: T[K];
2332
+ };
2333
+ type MarketPools = OptionalKeys$3<Record<string, MarketPool>>;
2334
+ type MarketCollaterals = OptionalKeys$3<Record<string, MarketCollateral>>;
2335
+ type CoinAmounts = OptionalKeys$3<Record<string, number>>;
2336
+ type MarketCoinAmounts = OptionalKeys$3<Record<string, number>>;
2337
+ type SCoinAmounts = OptionalKeys$3<Record<string, number>>;
2338
+ type BalanceSheet = {
2339
+ cash: string;
2340
+ debt: string;
2341
+ market_coin_supply: string;
2342
+ revenue: string;
2343
+ };
2344
+ type BorrowDynamic = {
2345
+ borrow_index: string;
2346
+ interest_rate: {
2347
+ fields: {
2348
+ value: string;
2349
+ };
2350
+ };
2351
+ interest_rate_scale: string;
2352
+ last_updated: string;
2353
+ };
2354
+ type BorrowFee = {
2355
+ value: string;
2356
+ };
2357
+ type InterestModel = {
2358
+ base_borrow_rate_per_sec: {
2359
+ fields: {
2360
+ value: string;
2361
+ };
2362
+ };
2363
+ borrow_rate_on_high_kink: {
2364
+ fields: {
2365
+ value: string;
2366
+ };
2367
+ };
2368
+ borrow_rate_on_mid_kink: {
2369
+ fields: {
2370
+ value: string;
2371
+ };
2372
+ };
2373
+ borrow_weight: {
2374
+ fields: {
2375
+ value: string;
2376
+ };
2377
+ };
2378
+ borrow_fee_rate: {
2379
+ fields: {
2380
+ value: string;
2381
+ };
2382
+ };
2383
+ high_kink: {
2384
+ fields: {
2385
+ value: string;
2386
+ };
2387
+ };
2388
+ interest_rate_scale: string;
2389
+ max_borrow_rate: {
2390
+ fields: {
2391
+ value: string;
2392
+ };
2393
+ };
2394
+ mid_kink: {
2395
+ fields: {
2396
+ value: string;
2397
+ };
2398
+ };
2399
+ min_borrow_amount: string;
2400
+ revenue_factor: {
2401
+ fields: {
2402
+ value: string;
2403
+ };
2404
+ };
2405
+ type: {
2406
+ fields: {
2407
+ name: string;
2408
+ };
2409
+ };
2410
+ };
2411
+ type RiskModel = {
2412
+ collateral_factor: {
2413
+ fields: {
2414
+ value: string;
2415
+ };
2416
+ };
2417
+ liquidation_discount: {
2418
+ fields: {
2419
+ value: string;
2420
+ };
2421
+ };
2422
+ liquidation_factor: {
2423
+ fields: {
2424
+ value: string;
2425
+ };
2426
+ };
2427
+ liquidation_penalty: {
2428
+ fields: {
2429
+ value: string;
2430
+ };
2431
+ };
2432
+ liquidation_revenue_factor: {
2433
+ fields: {
2434
+ value: string;
2435
+ };
2436
+ };
2437
+ max_collateral_amount: string;
2438
+ type: {
2439
+ fields: {
2440
+ name: string;
2441
+ };
2442
+ };
2443
+ };
2444
+ type CollateralStat = {
2445
+ amount: string;
2446
+ };
2447
+ type MarketPool = {
2448
+ coinName: string;
2449
+ symbol: string;
2450
+ coinType: string;
2451
+ marketCoinType: string;
2452
+ sCoinType: string;
2453
+ coinWrappedType: CoinWrappedType;
2454
+ coinDecimal: number;
2455
+ coinPrice: number;
2456
+ maxSupplyCoin: number;
2457
+ maxBorrowCoin: number;
2458
+ isIsolated: boolean;
2459
+ } & Required<Pick<ParsedMarketPoolData, 'highKink' | 'midKink' | 'reserveFactor' | 'borrowWeight' | 'borrowFee' | 'marketCoinSupplyAmount' | 'minBorrowAmount'>> & CalculatedMarketPoolData;
2460
+ type MarketCollateral = {
2461
+ coinName: string;
2462
+ symbol: string;
2463
+ coinType: string;
2464
+ marketCoinType: string;
2465
+ coinWrappedType: CoinWrappedType;
2466
+ coinDecimal: number;
2467
+ coinPrice: number;
2468
+ isIsolated: boolean;
2469
+ } & Required<Pick<ParsedMarketCollateralData, 'collateralFactor' | 'liquidationFactor' | 'liquidationDiscount' | 'liquidationPenalty' | 'liquidationReserveFactor'>> & CalculatedMarketCollateralData;
2470
+ type OriginMarketPoolData = {
2471
+ type: {
2472
+ name: string;
2473
+ };
2474
+ maxBorrowRate: {
2475
+ value: string;
2476
+ };
2477
+ interestRate: {
2478
+ value: string;
2479
+ };
2480
+ interestRateScale: string;
2481
+ borrowIndex: string;
2482
+ lastUpdated: string;
2483
+ cash: string;
2484
+ debt: string;
2485
+ marketCoinSupply: string;
2486
+ reserve: string;
2487
+ reserveFactor: {
2488
+ value: string;
2489
+ };
2490
+ borrowWeight: {
2491
+ value: string;
2492
+ };
2493
+ borrowFeeRate: {
2494
+ value: string;
2495
+ };
2496
+ baseBorrowRatePerSec: {
2497
+ value: string;
2498
+ };
2499
+ borrowRateOnHighKink: {
2500
+ value: string;
2501
+ };
2502
+ borrowRateOnMidKink: {
2503
+ value: string;
2504
+ };
2505
+ highKink: {
2506
+ value: string;
2507
+ };
2508
+ midKink: {
2509
+ value: string;
2510
+ };
2511
+ minBorrowAmount: string;
2512
+ isIsolated: boolean;
2513
+ supplyLimit: string;
2514
+ borrowLimit: string;
2515
+ };
2516
+ type ParsedMarketPoolData = {
2517
+ coinType: string;
2518
+ maxBorrowRate: number;
2519
+ borrowRate: number;
2520
+ borrowRateScale: number;
2521
+ borrowIndex: number;
2522
+ lastUpdated: number;
2523
+ cashAmount: number;
2524
+ debtAmount: number;
2525
+ marketCoinSupplyAmount: number;
2526
+ reserveAmount: number;
2527
+ reserveFactor: number;
2528
+ borrowWeight: number;
2529
+ borrowFee: number;
2530
+ baseBorrowRate: number;
2531
+ borrowRateOnHighKink: number;
2532
+ borrowRateOnMidKink: number;
2533
+ highKink: number;
2534
+ midKink: number;
2535
+ minBorrowAmount: number;
2536
+ isIsolated: boolean;
2537
+ supplyLimit: number;
2538
+ borrowLimit: number;
2539
+ };
2540
+ type CalculatedMarketPoolData = {
2541
+ baseBorrowApr: number;
2542
+ baseBorrowApy: number;
2543
+ borrowAprOnHighKink: number;
2544
+ borrowApyOnHighKink: number;
2545
+ borrowAprOnMidKink: number;
2546
+ borrowApyOnMidKink: number;
2547
+ coinDecimal: number;
2548
+ conversionRate: number;
2549
+ maxBorrowApr: number;
2550
+ maxBorrowApy: number;
2551
+ borrowApr: number;
2552
+ borrowApy: number;
2553
+ borrowIndex: number;
2554
+ growthInterest: number;
2555
+ supplyAmount: number;
2556
+ supplyCoin: number;
2557
+ borrowAmount: number;
2558
+ borrowCoin: number;
2559
+ reserveAmount: number;
2560
+ reserveCoin: number;
2561
+ utilizationRate: number;
2562
+ supplyApr: number;
2563
+ supplyApy: number;
2564
+ isIsolated: boolean;
2565
+ maxSupplyCoin: number;
2566
+ maxBorrowCoin: number;
2567
+ };
2568
+ type OriginMarketCollateralData = {
2569
+ type: {
2570
+ name: string;
2571
+ };
2572
+ isIsolated: boolean;
2573
+ collateralFactor: {
2574
+ value: string;
2575
+ };
2576
+ liquidationFactor: {
2577
+ value: string;
2578
+ };
2579
+ liquidationDiscount: {
2580
+ value: string;
2581
+ };
2582
+ liquidationPenalty: {
2583
+ value: string;
2584
+ };
2585
+ liquidationReserveFactor: {
2586
+ value: string;
2587
+ };
2588
+ maxCollateralAmount: string;
2589
+ totalCollateralAmount: string;
2590
+ };
2591
+ type ParsedMarketCollateralData = {
2592
+ coinType: string;
2593
+ collateralFactor: number;
2594
+ liquidationFactor: number;
2595
+ liquidationDiscount: number;
2596
+ liquidationPenalty: number;
2597
+ liquidationReserveFactor: number;
2598
+ maxCollateralAmount: number;
2599
+ totalCollateralAmount: number;
2600
+ isIsolated: boolean;
2601
+ };
2602
+ type CalculatedMarketCollateralData = {
2603
+ coinDecimal: number;
2604
+ isIsolated: boolean;
2605
+ maxDepositAmount: number;
2606
+ maxDepositCoin: number;
2607
+ depositAmount: number;
2608
+ depositCoin: number;
2609
+ };
2610
+ type Market = {
2611
+ pools: MarketPools;
2612
+ collaterals: MarketCollaterals;
2613
+ data?: MarketQueryInterface;
2614
+ };
2615
+ type Obligation = {
2616
+ id: string;
2617
+ keyId: string;
2618
+ locked: boolean;
2619
+ };
2620
+ /**
2621
+ * The query interface for `market_query::market_data` inspectTxn.
2622
+ */
2623
+ interface MarketQueryInterface {
2624
+ collaterals: {
2625
+ collateralFactor: {
2626
+ value: string;
2627
+ };
2628
+ liquidationDiscount: {
2629
+ value: string;
2630
+ };
2631
+ liquidationFactor: {
2632
+ value: string;
2633
+ };
2634
+ liquidationPanelty: {
2635
+ value: string;
2636
+ };
2637
+ liquidationReserveFactor: {
2638
+ value: string;
2639
+ };
2640
+ maxCollateralAmount: string;
2641
+ totalCollateralAmount: string;
2642
+ type: {
2643
+ name: string;
2644
+ };
2645
+ }[];
2646
+ pools: {
2647
+ baseBorrowRatePerSec: {
2648
+ value: string;
2649
+ };
2650
+ borrowRateOnHighKink: {
2651
+ value: string;
2652
+ };
2653
+ borrowRateOnMidKink: {
2654
+ value: string;
2655
+ };
2656
+ maxBorrowRate: {
2657
+ value: string;
2658
+ };
2659
+ highKink: {
2660
+ value: string;
2661
+ };
2662
+ midKink: {
2663
+ value: string;
2664
+ };
2665
+ interestRate: {
2666
+ value: string;
2667
+ };
2668
+ interestRateScale: string;
2669
+ borrowIndex: string;
2670
+ lastUpdated: string;
2671
+ cash: string;
2672
+ debt: string;
2673
+ marketCoinSupply: string;
2674
+ minBorrowAmount: string;
2675
+ reserve: string;
2676
+ reserveFactor: {
2677
+ value: string;
2678
+ };
2679
+ borrowWeight: {
2680
+ value: string;
2681
+ };
2682
+ borrowFeeRate: {
2683
+ value: string;
2684
+ };
2685
+ type: {
2686
+ name: string;
2687
+ };
2688
+ }[];
2689
+ }
2690
+ /**
2691
+ * The query interface for `obligation_query::obligation_data` inspectTxn.
2692
+ */
2693
+ interface ObligationQueryInterface {
2694
+ collaterals: {
2695
+ type: {
2696
+ name: string;
2697
+ };
2698
+ amount: string;
2699
+ }[];
2700
+ debts: {
2701
+ type: {
2702
+ name: string;
2703
+ };
2704
+ amount: string;
2705
+ borrowIndex: string;
2706
+ }[];
2707
+ }
2708
+
2709
+ type LoyaltyProgramInfo = {
2710
+ pendingReward: number;
2711
+ totalPoolReward: number;
2712
+ isClaimEnabled: boolean;
2713
+ };
2714
+ type VeScaLoyaltyProgramInfo = {
2715
+ pendingVeScaReward: number;
2716
+ pendingScaReward: number;
2717
+ totalPoolReward: number;
2718
+ isClaimEnabled: boolean;
2719
+ };
2720
+
2721
+ type OptionalKeys$2<T> = {
2722
+ [K in keyof T]?: T[K];
2723
+ };
2724
+ type Spools = OptionalKeys$2<Record<string, Spool>>;
2725
+ type Spool = {
2726
+ marketCoinName: string;
2727
+ symbol: string;
2728
+ coinType: string;
2729
+ marketCoinType: string;
2730
+ rewardCoinType: string;
2731
+ sCoinType: string;
2732
+ coinDecimal: number;
2733
+ rewardCoinDecimal: number;
2734
+ coinPrice: number;
2735
+ marketCoinPrice: number;
2736
+ rewardCoinPrice: number;
2737
+ } & Required<Pick<ParsedSpoolData, 'maxPoint' | 'distributedPoint' | 'maxStake'>> & CalculatedSpoolData & SpoolRewardPool;
2738
+ type OriginSpoolData = {
2739
+ stakeType: {
2740
+ fields: {
2741
+ name: string;
2742
+ };
2743
+ };
2744
+ maxDistributedPoint: string;
2745
+ distributedPoint: string;
2746
+ distributedPointPerPeriod: string;
2747
+ pointDistributionTime: string;
2748
+ maxStake: string;
2749
+ stakes: string;
2750
+ index: string;
2751
+ createdAt: string;
2752
+ lastUpdate: string;
2753
+ };
2754
+ type SpoolData = {
2755
+ created_at: string;
2756
+ distributed_point: string;
2757
+ distributed_point_per_period: string;
2758
+ id: {
2759
+ id: string;
2760
+ };
2761
+ index: string;
2762
+ last_update: string;
2763
+ max_distributed_point: string;
2764
+ max_stakes: string;
2765
+ point_distribution_time: string;
2766
+ stake_type: {
2767
+ type: string;
2768
+ fields: {
2769
+ name: string;
2770
+ };
2771
+ };
2772
+ stakes: string;
2773
+ };
2774
+ type ParsedSpoolData = {
2775
+ stakeType: string;
2776
+ maxPoint: number;
2777
+ distributedPoint: number;
2778
+ pointPerPeriod: number;
2779
+ period: number;
2780
+ maxStake: number;
2781
+ staked: number;
2782
+ index: number;
2783
+ createdAt: number;
2784
+ lastUpdate: number;
2785
+ };
2786
+ type CalculatedSpoolData = {
2787
+ stakedAmount: number;
2788
+ stakedCoin: number;
2789
+ stakedValue: number;
2790
+ distributedPointPerSec: number;
2791
+ accumulatedPoints: number;
2792
+ currentPointIndex: number;
2793
+ currentTotalDistributedPoint: number;
2794
+ startDate: Date;
2795
+ endDate: Date;
2796
+ };
2797
+ type SpoolRewardPool = Required<Pick<ParsedSpoolRewardPoolData, 'exchangeRateNumerator' | 'exchangeRateDenominator'>> & CalculatedSpoolRewardPoolData;
2798
+ type OriginSpoolRewardPoolData = {
2799
+ claimed_rewards: string;
2800
+ exchange_rate_denominator: string;
2801
+ exchange_rate_numerator: string;
2802
+ rewards: string;
2803
+ spool_id: string;
2804
+ };
2805
+ type ParsedSpoolRewardPoolData = {
2806
+ claimedRewards: number;
2807
+ exchangeRateDenominator: number;
2808
+ exchangeRateNumerator: number;
2809
+ rewards: number;
2810
+ spoolId: string;
2811
+ };
2812
+ type CalculatedSpoolRewardPoolData = {
2813
+ rewardApr: number;
2814
+ totalRewardAmount: number;
2815
+ totalRewardCoin: number;
2816
+ totalRewardValue: number;
2817
+ remaindRewardAmount: number;
2818
+ remaindRewardCoin: number;
2819
+ remaindRewardValue: number;
2820
+ claimedRewardAmount: number;
2821
+ claimedRewardCoin: number;
2822
+ claimedRewardValue: number;
2823
+ rewardPerSec: number;
2824
+ };
2825
+ type StakePools = OptionalKeys$2<Record<string, StakePool>>;
2826
+ type StakeRewardPools = OptionalKeys$2<Record<string, StakeRewardPool>>;
2827
+ type StakeAccounts = Record<string, StakeAccount[]>;
2828
+ interface StakeAccount {
2829
+ id: string;
2830
+ type: string;
2831
+ stakePoolId: string;
2832
+ stakeType: string;
2833
+ staked: number;
2834
+ index: number;
2835
+ points: number;
2836
+ totalPoints: number;
2837
+ }
2838
+ interface StakePool {
2839
+ id: string;
2840
+ type: string;
2841
+ maxPoint: number;
2842
+ distributedPoint: number;
2843
+ pointPerPeriod: number;
2844
+ period: number;
2845
+ maxStake: number;
2846
+ stakeType: string;
2847
+ totalStaked: number;
2848
+ index: number;
2849
+ createdAt: number;
2850
+ lastUpdate: number;
2851
+ }
2852
+ interface StakeRewardPool {
2853
+ id: string;
2854
+ type: string;
2855
+ stakePoolId: string;
2856
+ ratioDenominator: number;
2857
+ ratioNumerator: number;
2858
+ rewards: number;
2859
+ claimedRewards: number;
2860
+ }
2861
+
2862
+ type OptionalKeys$1<T> = {
2863
+ [K in keyof T]?: T[K];
2864
+ };
2865
+ type Lendings = OptionalKeys$1<Record<string, Lending>>;
2866
+ type ObligationAccounts = OptionalKeys$1<Record<string, ObligationAccount>>;
2867
+ type Lending = Required<Pick<MarketPool, 'coinName' | 'symbol' | 'coinType' | 'marketCoinType' | 'sCoinType' | 'coinDecimal' | 'coinPrice' | 'conversionRate' | 'isIsolated'> & Pick<Spool, 'marketCoinPrice'>> & {
2868
+ supplyApr: number;
2869
+ supplyApy: number;
2870
+ rewardApr: number;
2871
+ suppliedAmount: number;
2872
+ suppliedCoin: number;
2873
+ suppliedValue: number;
2874
+ stakedMarketAmount: number;
2875
+ stakedMarketCoin: number;
2876
+ stakedAmount: number;
2877
+ stakedCoin: number;
2878
+ stakedValue: number;
2879
+ unstakedMarketAmount: number;
2880
+ unstakedMarketCoin: number;
2881
+ unstakedAmount: number;
2882
+ unstakedCoin: number;
2883
+ unstakedValue: number;
2884
+ availableSupplyAmount: number;
2885
+ availableSupplyCoin: number;
2886
+ availableWithdrawAmount: number;
2887
+ availableWithdrawCoin: number;
2888
+ availableStakeAmount: number;
2889
+ availableStakeCoin: number;
2890
+ availableUnstakeAmount: number;
2891
+ availableUnstakeCoin: number;
2892
+ availableClaimAmount: number;
2893
+ availableClaimCoin: number;
2894
+ };
2895
+ type ObligationAccount = {
2896
+ obligationId: string;
2897
+ totalDepositedValue: number;
2898
+ totalBorrowedValue: number;
2899
+ totalBalanceValue: number;
2900
+ totalBorrowCapacityValue: number;
2901
+ totalAvailableCollateralValue: number;
2902
+ totalBorrowedValueWithWeight: number;
2903
+ totalRequiredCollateralValue: number;
2904
+ totalUnhealthyCollateralValue: number;
2905
+ totalRiskLevel: number;
2906
+ totalDepositedPools: number;
2907
+ totalBorrowedPools: number;
2908
+ totalRewardedPools: number;
2909
+ collaterals: OptionalKeys$1<Record<string, ObligationCollateral>>;
2910
+ debts: OptionalKeys$1<Record<string, ObligationDebt>>;
2911
+ borrowIncentives: OptionalKeys$1<Record<string, ObligationBorrowIncentive>>;
2912
+ };
2913
+ type ObligationCollateral = {
2914
+ coinName: string;
2915
+ coinType: string;
2916
+ symbol: string;
2917
+ coinDecimal: number;
2918
+ coinPrice: number;
2919
+ depositedAmount: number;
2920
+ depositedCoin: number;
2921
+ depositedValue: number;
2922
+ borrowCapacityValue: number;
2923
+ requiredCollateralValue: number;
2924
+ availableDepositAmount: number;
2925
+ availableDepositCoin: number;
2926
+ availableWithdrawAmount: number;
2927
+ availableWithdrawCoin: number;
2928
+ };
2929
+ type ObligationDebt = {
2930
+ coinName: string;
2931
+ coinType: string;
2932
+ symbol: string;
2933
+ coinDecimal: number;
2934
+ coinPrice: number;
2935
+ borrowedAmount: number;
2936
+ borrowedCoin: number;
2937
+ borrowedValue: number;
2938
+ borrowedValueWithWeight: number;
2939
+ borrowIndex: number;
2940
+ requiredRepayAmount: number;
2941
+ requiredRepayCoin: number;
2942
+ availableBorrowAmount: number;
2943
+ availableBorrowCoin: number;
2944
+ availableRepayAmount: number;
2945
+ availableRepayCoin: number;
2946
+ };
2947
+ type ObligationBorrowIncentiveReward = {
2948
+ coinName: string;
2949
+ coinType: string;
2950
+ symbol: string;
2951
+ coinDecimal: number;
2952
+ coinPrice: number;
2953
+ weightedBorrowAmount: number;
2954
+ availableClaimCoin: number;
2955
+ availableClaimAmount: number;
2956
+ boostValue: number;
2957
+ };
2958
+ type ObligationBorrowIncentive = {
2959
+ coinName: string;
2960
+ coinType: string;
2961
+ symbol: string;
2962
+ coinDecimal: number;
2963
+ coinPrice: number;
2964
+ rewards: ObligationBorrowIncentiveReward[];
2965
+ };
2966
+ type TotalValueLocked = {
2967
+ supplyLendingValue: number;
2968
+ supplyCollateralValue: number;
2969
+ supplyValue: number;
2970
+ borrowValue: number;
2971
+ totalValue: number;
2972
+ supplyValueChangeRatio?: number;
2973
+ supplyLendingValueChangeRatio?: number;
2974
+ supplyCollateralValueChangeRatio?: number;
2975
+ borrowValueChangeRatio?: number;
2976
+ totalValueChangeRatio?: number;
2977
+ };
2978
+
2979
+ type sCoinBalance = number;
2980
+
2981
+ type Vesca = {
2982
+ id: string;
2983
+ keyId: string;
2984
+ keyObject?: SuiObjectRef$1;
2985
+ object: SuiObjectRef$1;
2986
+ lockedScaAmount: string;
2987
+ lockedScaCoin: number;
2988
+ currentVeScaBalance: number;
2989
+ unlockAt: number;
2990
+ };
2991
+ type VeScaTreasuryFields = {
2992
+ total_ve_sca_amount: string;
2993
+ sca_balance: string;
2994
+ unlock_schedule: {
2995
+ fields: {
2996
+ locked_sca_amount: string;
2997
+ };
2998
+ };
2999
+ };
3000
+ type VeScaTreasuryInfo = {
3001
+ totalLockedSca: number;
3002
+ totalVeSca: number;
3003
+ averageLockingPeriod: number;
3004
+ averageLockingPeriodUnit: string;
3005
+ };
3006
+
3007
+ interface AddressesInterface {
3008
+ id?: string;
3009
+ core: {
3010
+ version: string;
3011
+ versionCap: string;
3012
+ object: string;
3013
+ market: string;
3014
+ adminCap: string;
3015
+ coinDecimalsRegistry: string;
3016
+ obligationAccessStore: string;
3017
+ coins: Partial<Record<string, {
3018
+ id: string;
3019
+ treasury: string;
3020
+ metaData: string;
3021
+ coinType: string;
3022
+ symbol: string;
3023
+ decimals: number;
3024
+ oracle: {
3025
+ [K in SupportOracleType]: K extends (typeof _SUPPORT_ORACLES)[0] ? string : K extends (typeof _SUPPORT_ORACLES)[1] ? string : K extends (typeof _SUPPORT_ORACLES)[2] ? {
3026
+ feed: string;
3027
+ feedObject: string;
3028
+ } : never;
3029
+ };
3030
+ }>>;
3031
+ oracles: {
3032
+ [K in SupportOracleType]: K extends (typeof _SUPPORT_ORACLES)[0] ? {
3033
+ registry: string;
3034
+ registryCap: string;
3035
+ holder: string;
3036
+ } : K extends (typeof _SUPPORT_ORACLES)[1] ? {
3037
+ registry: string;
3038
+ registryCap: string;
3039
+ registryTableId: string;
3040
+ state: string;
3041
+ } : K extends (typeof _SUPPORT_ORACLES)[2] ? {
3042
+ registry: string;
3043
+ registryCap: string;
3044
+ state: string;
3045
+ wormhole: string;
3046
+ wormholeState: string;
3047
+ } : never;
3048
+ } & {
3049
+ xOracle: string;
3050
+ xOracleCap: string;
3051
+ primaryPriceUpdatePolicyObject: string;
3052
+ secondaryPriceUpdatePolicyObject: string;
3053
+ primaryPriceUpdatePolicyVecsetId: string;
3054
+ secondaryPriceUpdatePolicyVecsetId: string;
3055
+ };
3056
+ packages: Partial<Record<string, {
3057
+ id: string;
3058
+ object?: string;
3059
+ upgradeCap: string;
3060
+ }>>;
3061
+ };
3062
+ spool: {
3063
+ id: string;
3064
+ adminCap: string;
3065
+ object: string;
3066
+ config: string;
3067
+ pools: Partial<Record<string, {
3068
+ id: string;
3069
+ rewardPoolId: string;
3070
+ }>>;
3071
+ };
3072
+ borrowIncentive: {
3073
+ id: string;
3074
+ adminCap: string;
3075
+ object: string;
3076
+ query: string;
3077
+ config: string;
3078
+ incentivePools: string;
3079
+ incentiveAccounts: string;
3080
+ };
3081
+ vesca: {
3082
+ id: string;
3083
+ object: string;
3084
+ adminCap: string;
3085
+ tableId: string;
3086
+ table: string;
3087
+ treasury: string;
3088
+ config: string;
3089
+ subsTable: string;
3090
+ subsTableId: string;
3091
+ subsWhitelist: string;
3092
+ };
3093
+ referral: {
3094
+ id: string;
3095
+ version: string;
3096
+ object: string;
3097
+ adminCap: string;
3098
+ referralBindings: string;
3099
+ bindingTableId: string;
3100
+ referralRevenuePool: string;
3101
+ revenueTableId: string;
3102
+ referralTiers: string;
3103
+ tiersTableId: string;
3104
+ authorizedWitnessList: string;
3105
+ };
3106
+ loyaltyProgram: {
3107
+ id: string;
3108
+ adminCap?: string;
3109
+ object: string;
3110
+ rewardPool: string;
3111
+ userRewardTableId: string;
3112
+ };
3113
+ veScaLoyaltyProgram: {
3114
+ id: string;
3115
+ adminCap?: string;
3116
+ object: string;
3117
+ veScaRewardPool: string;
3118
+ veScaRewardTableId: string;
3119
+ };
3120
+ scoin: {
3121
+ id: string;
3122
+ coins: Partial<Record<string, {
3123
+ coinType: string;
3124
+ symbol: string;
3125
+ treasury: string;
3126
+ metaData: string;
3127
+ }>>;
3128
+ };
3183
3129
  }
3130
+ type AddressPathsProps<T> = T extends string ? [] : {
3131
+ [K in Extract<keyof T, string>]: [K, ...AddressPathsProps<T[K]>];
3132
+ }[Extract<keyof T, string>];
3133
+ type Join<T extends string[], D extends string> = T extends [] ? never : T extends [infer F] ? F : T extends [infer F, ...infer R] ? F extends string ? `${F}${D}${Join<Extract<R, string[]>, D>}` : never : string;
3134
+ type AddressStringPath = Join<AddressPathsProps<AddressesInterface>, '.'>;
3184
3135
 
3185
- /**
3186
- * @argument params - The parameters for the Scallop instance.
3187
- * @argument cacheOptions - The cache options for the QueryClient.
3188
- *
3189
- * @description
3190
- * The main instance that controls interaction with the Scallop contract.
3191
- *
3192
- * @example
3193
- * ```typescript
3194
- * const sdk = new Scallop(<parameters>);
3195
- * const scallopAddress = await sdk.getScallopAddress();
3196
- * const scallopBuilder = await sdk.createScallopBuilder();
3197
- * const scallopClient = await sdk.createScallopClient();
3198
- * const scallopIndexer= await sdk.createScallopIndexer();
3199
- * const scallopUtils= await sdk.createScallopUtils();
3200
- * ```
3201
- */
3202
- type ScallopParams = {
3203
- client?: ScallopClient;
3204
- } & ScallopClientParams;
3205
- declare class Scallop {
3206
- readonly client: ScallopClient;
3207
- constructor(params: ScallopParams);
3208
- init(force?: boolean): Promise<void>;
3209
- /**
3210
- * Create a scallop client instance that already has initial data.
3211
- *
3212
- * @return Scallop Client.
3213
- */
3214
- createScallopClient(): Promise<ScallopClient>;
3215
- /**
3216
- * Create a scallop builder instance that already has initial data.
3217
- *
3218
- * @return Scallop Builder.
3219
- */
3220
- createScallopBuilder(): Promise<ScallopBuilder>;
3221
- /**
3222
- * Create a scallop query instance.
3223
- *
3224
- * @return Scallop Query.
3225
- */
3226
- createScallopQuery(): Promise<ScallopQuery>;
3227
- /**
3228
- * Create a scallop utils instance.
3229
- *
3230
- * @return Scallop Utils.
3231
- */
3232
- createScallopUtils(): Promise<ScallopUtils>;
3233
- /**
3234
- * Create a scallop indexer instance.
3235
- *
3236
- * @return Scallop Indexer.
3237
- */
3238
- createScallopIndexer(): Promise<ScallopIndexer>;
3239
- /**
3240
- * Get a scallop constants instance that already has initial data.
3241
- * @returns Scallop Constants
3242
- */
3243
- getScallopConstants(): Promise<ScallopConstants>;
3244
- }
3136
+ type OptionalKeys<T> = {
3137
+ [K in keyof T]?: T[K];
3138
+ };
3139
+ type CoinPrices = OptionalKeys<Record<string, number>>;
3140
+
3141
+ declare const TEST_ADDRESSES: AddressesInterface;
3142
+ declare const WHITELIST: {
3143
+ lending: Set<string>;
3144
+ collateral: Set<string>;
3145
+ borrowing: Set<string>;
3146
+ packages: Set<string>;
3147
+ spool: Set<string>;
3148
+ scoin: Set<string>;
3149
+ suiBridge: Set<string>;
3150
+ wormhole: Set<string>;
3151
+ oracles: Set<string>;
3152
+ pythEndpoints: Set<string>;
3153
+ deprecated: Set<string>;
3154
+ borrowIncentiveRewards: Set<string>;
3155
+ rewardsAsPoint: Set<string>;
3156
+ emerging: Set<string>;
3157
+ };
3158
+ declare const POOL_ADDRESSES: {
3159
+ usdc: {
3160
+ coinName: string;
3161
+ symbol: string;
3162
+ lendingPoolAddress: string;
3163
+ collateralPoolAddress: string;
3164
+ borrowDynamic: string;
3165
+ interestModel: string;
3166
+ riskModel: string;
3167
+ borrowFeeKey: string;
3168
+ supplyLimitKey: string;
3169
+ borrowLimitKey: string;
3170
+ isolatedAssetKey: string;
3171
+ isIsolated: boolean;
3172
+ spool: string;
3173
+ spoolReward: string;
3174
+ sCoinType: string;
3175
+ sCoinTreasury: string;
3176
+ sCoinMetadataId: string;
3177
+ sCoinSymbol: string;
3178
+ sCoinName: string;
3179
+ coinMetadataId: string;
3180
+ coinType: string;
3181
+ spoolName: string;
3182
+ decimals: number;
3183
+ pythFeed: string;
3184
+ pythFeedObjectId: string;
3185
+ flashloanFeeObject: string;
3186
+ };
3187
+ sui: {
3188
+ coinName: string;
3189
+ symbol: string;
3190
+ lendingPoolAddress: string;
3191
+ collateralPoolAddress: string;
3192
+ borrowDynamic: string;
3193
+ interestModel: string;
3194
+ riskModel: string;
3195
+ borrowFeeKey: string;
3196
+ supplyLimitKey: string;
3197
+ borrowLimitKey: string;
3198
+ isolatedAssetKey: string;
3199
+ isIsolated: boolean;
3200
+ spool: string;
3201
+ spoolReward: string;
3202
+ sCoinType: string;
3203
+ sCoinTreasury: string;
3204
+ sCoinMetadataId: string;
3205
+ sCoinSymbol: string;
3206
+ sCoinName: string;
3207
+ coinMetadataId: string;
3208
+ coinType: string;
3209
+ spoolName: string;
3210
+ decimals: number;
3211
+ pythFeed: string;
3212
+ pythFeedObjectId: string;
3213
+ flashloanFeeObject: string;
3214
+ };
3215
+ sca: {
3216
+ coinName: string;
3217
+ symbol: string;
3218
+ lendingPoolAddress: string;
3219
+ collateralPoolAddress: string;
3220
+ borrowDynamic: string;
3221
+ interestModel: string;
3222
+ riskModel: string;
3223
+ borrowFeeKey: string;
3224
+ supplyLimitKey: string;
3225
+ borrowLimitKey: string;
3226
+ isolatedAssetKey: string;
3227
+ isIsolated: boolean;
3228
+ spool: string;
3229
+ spoolReward: string;
3230
+ sCoinType: string;
3231
+ sCoinTreasury: string;
3232
+ sCoinMetadataId: string;
3233
+ sCoinSymbol: string;
3234
+ sCoinName: string;
3235
+ coinMetadataId: string;
3236
+ coinType: string;
3237
+ spoolName: string;
3238
+ decimals: number;
3239
+ pythFeed: string;
3240
+ pythFeedObjectId: string;
3241
+ flashloanFeeObject: string;
3242
+ };
3243
+ fud: {
3244
+ coinName: string;
3245
+ symbol: string;
3246
+ lendingPoolAddress: string;
3247
+ collateralPoolAddress: string;
3248
+ borrowDynamic: string;
3249
+ interestModel: string;
3250
+ borrowFeeKey: string;
3251
+ supplyLimitKey: string;
3252
+ borrowLimitKey: string;
3253
+ isolatedAssetKey: string;
3254
+ isIsolated: boolean;
3255
+ spool: string;
3256
+ spoolReward: string;
3257
+ sCoinType: string;
3258
+ sCoinTreasury: string;
3259
+ sCoinMetadataId: string;
3260
+ sCoinSymbol: string;
3261
+ sCoinName: string;
3262
+ coinMetadataId: string;
3263
+ coinType: string;
3264
+ spoolName: string;
3265
+ decimals: number;
3266
+ pythFeed: string;
3267
+ pythFeedObjectId: string;
3268
+ flashloanFeeObject: string;
3269
+ };
3270
+ deep: {
3271
+ coinName: string;
3272
+ symbol: string;
3273
+ lendingPoolAddress: string;
3274
+ collateralPoolAddress: string;
3275
+ borrowDynamic: string;
3276
+ interestModel: string;
3277
+ borrowFeeKey: string;
3278
+ supplyLimitKey: string;
3279
+ borrowLimitKey: string;
3280
+ isolatedAssetKey: string;
3281
+ isIsolated: boolean;
3282
+ spool: string;
3283
+ spoolReward: string;
3284
+ sCoinType: string;
3285
+ sCoinTreasury: string;
3286
+ sCoinMetadataId: string;
3287
+ sCoinSymbol: string;
3288
+ sCoinName: string;
3289
+ coinMetadataId: string;
3290
+ coinType: string;
3291
+ spoolName: string;
3292
+ decimals: number;
3293
+ pythFeed: string;
3294
+ pythFeedObjectId: string;
3295
+ flashloanFeeObject: string;
3296
+ };
3297
+ };
3298
+
3299
+ declare const UNLOCK_ROUND_DURATION: number;
3300
+ declare const MAX_LOCK_ROUNDS: 1460;
3301
+ declare const MAX_LOCK_DURATION: number;
3302
+ declare const MIN_INITIAL_LOCK_AMOUNT: 10000000000;
3303
+ declare const MIN_TOP_UP_AMOUNT: 1000000000;
3304
+
3305
+ declare const xOracleList: xOracleListType;
3245
3306
 
3246
- export { API_BASE_URL, type AddressStringPath, type AddressesInterface, type BalanceSheet, type BasePackage, type BaseScallopTxBlock, type BorrowDynamic, type BorrowFee, type BorrowIncentiveAccountKey, type BorrowIncentiveAccounts, type BorrowIncentiveAccountsQueryInterface, type BorrowIncentiveIds, type BorrowIncentiveNormalMethods, type BorrowIncentivePool, type BorrowIncentivePoolPoints, type BorrowIncentivePools, type BorrowIncentivePoolsQueryInterface, type BorrowIncentiveQuickMethods, type BorrowIncentiveTxBlock, type CalculatedBorrowIncentivePoolPointData, type CalculatedMarketCollateralData, type CalculatedMarketPoolData, type CalculatedSpoolData, type CalculatedSpoolRewardPoolData, type CoinAmounts, type CoinPrices, type CoinWrappedType, type CollateralStat, type CoreIds, type CoreNormalMethods, type CoreQuickMethods, type CoreTxBlock, DEFAULT_CACHE_OPTIONS, type GenerateBorrowIncentiveNormalMethod, type GenerateBorrowIncentiveQuickMethod, type GenerateCoreNormalMethod, type GenerateCoreQuickMethod, type GenerateLoyaltyProgramNormalMethod, type GenerateLoyaltyProgramQuickMethod, type GenerateSCoinNormalMethod, type GenerateSCoinQuickMethod, type GenerateSpoolNormalMethod, type GenerateSpoolQuickMethod, type GenerateVeScaNormalMethod, type GenerateVeScaQuickMethod, IS_VE_SCA_TEST, type InterestModel, type Lending, type Lendings, type LoyaltyProgramInfo, type LoyaltyProgramNormalMethods, type LoyaltyProgramQuickMethods, type LoyaltyProgramTxBlock, MAX_LOCK_DURATION, MAX_LOCK_ROUNDS, MIN_INITIAL_LOCK_AMOUNT, MIN_TOP_UP_AMOUNT, type Market, type MarketCoinAmounts, type MarketCollateral, type MarketCollaterals, type MarketPool, type MarketPools, type MarketQueryInterface, type NestedResult, OLD_BORROW_INCENTIVE_PROTOCOL_ID, type Obligation, type ObligationAccount, type ObligationAccounts, type ObligationBorrowIncentive, type ObligationBorrowIncentiveReward, type ObligationCollateral, type ObligationDebt, type ObligationQueryInterface, type OptionalKeys, type OracleLst, type OracleLstConfig, type OracleLstPackage, type OriginBorrowIncentiveAccountData, type OriginBorrowIncentiveAccountPoolData, type OriginBorrowIncentivePoolData, type OriginBorrowIncentivePoolPointData, type OriginMarketCollateralData, type OriginMarketPoolData, type OriginSpoolData, type OriginSpoolRewardPoolData, type PackageName, type ParsedBorrowIncentiveAccountData, type ParsedBorrowIncentiveAccountPoolData, type ParsedBorrowIncentivePoolData, type ParsedBorrowIncentivePoolPointData, type ParsedMarketCollateralData, type ParsedMarketPoolData, type ParsedSpoolData, type ParsedSpoolRewardPoolData, type PoolAddress, QueryKeys, type QuickMethodReturnType, RPC_PROVIDERS, type RiskModel, SCA_COIN_TYPE, type SCoinAmounts, type SCoinTxBlock, SDK_API_BASE_URL, SUPPORT_ORACLES, SUPPORT_ORACLE_LST, SUPPORT_SUI_LST, Scallop, ScallopAddress, ScallopBuilder, ScallopClient, ScallopConstants, ScallopIndexer, ScallopQuery, ScallopSuiKit, type ScallopTxBlock, ScallopUtils, type SelectCoinReturnType, type Spool, type SpoolData, type SpoolIds, type SpoolNormalMethods, type SpoolQuickMethods, type SpoolRewardPool, type SpoolTxBlock, type Spools, type StakeAccount, type StakeAccounts, type StakePool, type StakePools, type StakeRewardPool, type StakeRewardPools, type SuiTxBlockWithBorrowIncentiveNormalMethods, type SuiTxBlockWithCoreNormalMethods, type SuiTxBlockWithLoyaltyProgramNormalMethods, type SuiTxBlockWithSCoin, type SuiTxBlockWithSCoinNormalMethods, type SuiTxBlockWithSpool, type SuiTxBlockWithSpoolNormalMethods, type SuiTxBlockWithVeScaNormalMethods, type SupportOracleLst, type SupportOracleType, type SupportedOracleSuiLst, TEST_ADDRESSES, TEST_POOL_ADDRESSES, TEST_WHITELIST, type TotalValueLocked, UNLOCK_ROUND_DURATION, USE_TEST_ADDRESS, type VeScaLoyaltyProgramInfo, type VeScaNormalMethods, type VeScaQuickMethods, type VeScaTreasuryFields, type VeScaTreasuryInfo, type VeScaTxBlock, type Vesca, type Whitelist, X_ORACLE_LIST, X_ORACLE_RULES, queryKeys, type sCoinNormalMethods, type sCoinPkgIds, type sCoinQuickMethods, type xOracleListType, type xOracleRuleType, type xOracleRules };
3307
+ export { API_BASE_URL, type AddressStringPath, type AddressesInterface, type AssetCoinIds, type AssetCoins, type BalanceSheet, type BaseScallopTxBlock, type BorrowDynamic, type BorrowFee, type BorrowIncentiveAccountKey, type BorrowIncentiveAccounts, type BorrowIncentiveAccountsQueryInterface, type BorrowIncentiveIds, type BorrowIncentiveNormalMethods, type BorrowIncentivePool, type BorrowIncentivePoolPoints, type BorrowIncentivePools, type BorrowIncentivePoolsQueryInterface, type BorrowIncentiveQuickMethods, type BorrowIncentiveRewardCoins, type BorrowIncentiveTxBlock, type CalculatedBorrowIncentivePoolPointData, type CalculatedMarketCollateralData, type CalculatedMarketPoolData, type CalculatedSpoolData, type CalculatedSpoolRewardPoolData, type CoinAmounts, type CoinPrices, type CoinWrappedType, type Coins, type CollateralStat, type CoreIds, type CoreNormalMethods, type CoreQuickMethods, type CoreTxBlock, DEFAULT_CACHE_OPTIONS, type GenerateBorrowIncentiveNormalMethod, type GenerateBorrowIncentiveQuickMethod, type GenerateCoreNormalMethod, type GenerateCoreQuickMethod, type GenerateLoyaltyProgramNormalMethod, type GenerateLoyaltyProgramQuickMethod, type GenerateSCoinNormalMethod, type GenerateSCoinQuickMethod, type GenerateSpoolNormalMethod, type GenerateSpoolQuickMethod, type GenerateVeScaNormalMethod, type GenerateVeScaQuickMethod, IS_VE_SCA_TEST, type InterestModel, type Lending, type Lendings, type LoyaltyProgramInfo, type LoyaltyProgramNormalMethods, type LoyaltyProgramQuickMethods, type LoyaltyProgramTxBlock, MAX_LOCK_DURATION, MAX_LOCK_ROUNDS, MIN_INITIAL_LOCK_AMOUNT, MIN_TOP_UP_AMOUNT, type Market, type MarketCoinAmounts, type MarketCoins, type MarketCollateral, type MarketCollaterals, type MarketPool, type MarketPools, type MarketQueryInterface, type NestedResult, OLD_BORROW_INCENTIVE_PROTOCOL_ID, type Obligation, type ObligationAccount, type ObligationAccounts, type ObligationBorrowIncentive, type ObligationBorrowIncentiveReward, type ObligationCollateral, type ObligationDebt, type ObligationQueryInterface, type OptionalKeys, type OriginBorrowIncentiveAccountData, type OriginBorrowIncentiveAccountPoolData, type OriginBorrowIncentivePoolData, type OriginBorrowIncentivePoolPointData, type OriginMarketCollateralData, type OriginMarketPoolData, type OriginSpoolData, type OriginSpoolRewardPoolData, POOL_ADDRESSES, type ParsedBorrowIncentiveAccountData, type ParsedBorrowIncentiveAccountPoolData, type ParsedBorrowIncentivePoolData, type ParsedBorrowIncentivePoolPointData, type ParsedMarketCollateralData, type ParsedMarketPoolData, type ParsedSpoolData, type ParsedSpoolRewardPoolData, type PoolAddress, type QuickMethodReturnType, RPC_PROVIDERS, type RiskModel, SCA_COIN_TYPE, type SCoinAmounts, type SCoinConverterTreasury, type SCoinIds, type SCoinTreasuryCaps, type SCoinTxBlock, type SCoins, SDK_API_BASE_URL, Scallop, ScallopAddress, ScallopBuilder, ScallopClient, ScallopConstants, ScallopIndexer, ScallopQuery, ScallopSuiKit, type ScallopTxBlock, ScallopUtils, type Spool, type SpoolData, type SpoolIds, type SpoolNormalMethods, type SpoolQuickMethods, type SpoolRewardPool, type SpoolTxBlock, type Spools, type StakeAccount, type StakeAccounts, type StakeMarketCoins, type StakePool, type StakePools, type StakeRewardCoins, type StakeRewardPool, type StakeRewardPools, type SuiBridgeCoins, type SuiBridgedCoinPackageIds, type SuiTxBlockWithBorrowIncentiveNormalMethods, type SuiTxBlockWithCoreNormalMethods, type SuiTxBlockWithLoyaltyProgramNormalMethods, type SuiTxBlockWithSCoin, type SuiTxBlockWithSCoinNormalMethods, type SuiTxBlockWithSpool, type SuiTxBlockWithSpoolNormalMethods, type SuiTxBlockWithVeScaNormalMethods, type SupportOracleType, TEST_ADDRESSES, type TotalValueLocked, UNLOCK_ROUND_DURATION, USE_TEST_ADDRESS, type VeScaLoyaltyProgramInfo, type VeScaNormalMethods, type VeScaQuickMethods, type VeScaTreasuryFields, type VeScaTreasuryInfo, type VeScaTxBlock, type Vesca, type VoloCoinIds, WHITELIST, type Whitelist, type WormholeCoinIds, _SUPPORT_ORACLES, queryKeys, type sCoinBalance, type sCoinNormalMethods, type sCoinPkgIds, type sCoinQuickMethods, xOracleList, type xOracleListType, type xOracleRuleType, type xOracleRules };