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

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