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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/index.d.mts +1811 -1783
  2. package/dist/index.d.ts +1811 -1783
  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 +2 -2
  15. package/src/builders/vescaBuilder.ts +5 -5
  16. package/src/constants/common.ts +3 -0
  17. package/src/constants/index.ts +1 -1
  18. package/src/constants/queryKeys.ts +1 -1
  19. package/src/constants/testAddress.ts +99 -271
  20. package/src/constants/xoracle.ts +2 -8
  21. package/src/index.ts +1 -1
  22. package/src/models/index.ts +1 -2
  23. package/src/models/interface.ts +6 -6
  24. package/src/models/rateLimiter.ts +55 -0
  25. package/src/models/scallop.ts +1 -1
  26. package/src/models/scallopAddress.ts +5 -33
  27. package/src/models/scallopBuilder.ts +14 -11
  28. package/src/models/scallopClient.ts +31 -14
  29. package/src/models/scallopConstants.ts +3 -3
  30. package/src/models/scallopIndexer.ts +3 -4
  31. package/src/models/scallopQuery.ts +112 -56
  32. package/src/models/scallopQueryClient.ts +1 -1
  33. package/src/models/scallopSuiKit.ts +1 -1
  34. package/src/models/scallopUtils.ts +12 -7
  35. package/src/queries/borrowIncentiveQuery.ts +4 -3
  36. package/src/queries/coreQuery.ts +114 -186
  37. package/src/queries/index.ts +3 -4
  38. package/src/queries/loyaltyProgramQuery.ts +2 -2
  39. package/src/queries/ownerQuery.ts +32 -0
  40. package/src/queries/poolAddressesQuery.ts +1 -3
  41. package/src/queries/portfolioQuery.ts +68 -16
  42. package/src/queries/priceQuery.ts +2 -3
  43. package/src/queries/sCoinQuery.ts +2 -2
  44. package/src/queries/spoolQuery.ts +57 -74
  45. package/src/queries/vescaQuery.ts +3 -3
  46. package/src/queries/xOracleQuery.ts +4 -21
  47. package/src/types/address.ts +47 -98
  48. package/src/types/builder/core.ts +40 -15
  49. package/src/types/builder/index.ts +17 -1
  50. package/src/types/constant/enum.ts +64 -0
  51. package/src/types/constant/index.ts +1 -2
  52. package/src/types/constant/xOracle.ts +7 -10
  53. package/src/types/index.ts +1 -1
  54. package/src/types/query/core.ts +3 -0
  55. package/src/types/query/index.ts +1 -0
  56. package/src/types/query/sCoin.ts +1 -0
  57. package/src/{builders/utils.ts → utils/builder.ts} +1 -1
  58. package/src/utils/core.ts +18 -0
  59. package/src/utils/index.ts +5 -0
  60. package/src/utils/indexer.ts +47 -0
  61. package/src/{queries/utils.ts → utils/query.ts} +7 -25
  62. package/src/utils/util.ts +42 -0
  63. package/src/builders/oracles/error.ts +0 -18
  64. package/src/builders/oracles/oraclePackageRegistry.ts +0 -336
  65. package/src/builders/oracles/priceFeedUpdater.ts +0 -112
  66. package/src/builders/oracles/priceUpdateRequester.ts +0 -50
  67. package/src/builders/oracles/xOracleUpdateStrategy.ts +0 -214
  68. package/src/builders/oracles/xOracleUpdater.ts +0 -153
  69. package/src/constants/api.ts +0 -2
  70. package/src/models/utils.ts +0 -97
  71. package/src/types/builder/type.ts +0 -25
  72. package/src/types/constant/package.ts +0 -16
  73. /package/src/types/{util.ts → utils.ts} +0 -0
package/dist/index.d.mts CHANGED
@@ -1,15 +1,12 @@
1
1
  import * as _mysten_sui_dist_cjs_client from '@mysten/sui/dist/cjs/client';
2
- import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectRef as SuiObjectRef$1 } from '@mysten/sui/dist/cjs/client';
2
+ import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectRef } from '@mysten/sui/dist/cjs/client';
3
3
  import * as _scallop_io_sui_kit from '@scallop-io/sui-kit';
4
- import { SuiObjectArg, SuiTxArg, NetworkType, SuiKit, SuiKitParams, Transaction, SuiTxBlock, DerivePathParams, SuiAddressArg, TransactionResult as TransactionResult$1, SuiVecTxArg, SuiAmountsArg } from '@scallop-io/sui-kit';
4
+ import { SuiObjectArg, SuiTxArg, NetworkType, SuiKit, Transaction, SuiTxBlock, DerivePathParams, SuiKitParams, SuiVecTxArg, SuiAmountsArg, SuiAddressArg, TransactionResult as TransactionResult$1 } from '@scallop-io/sui-kit';
5
5
  import * as _tanstack_query_core from '@tanstack/query-core';
6
6
  import { QueryClient, QueryClientConfig, QueryKey } from '@tanstack/query-core';
7
7
  import { AxiosInstance, AxiosResponse, AxiosRequestConfig } from 'axios';
8
- import { SuiObjectRef, SuiObjectDataOptions as SuiObjectDataOptions$1, SuiObjectResponse, SuiObjectData as SuiObjectData$1, GetOwnedObjectsParams as GetOwnedObjectsParams$1, GetDynamicFieldsParams as GetDynamicFieldsParams$1, DynamicFieldPage, GetDynamicFieldObjectParams as GetDynamicFieldObjectParams$1, CoinBalance, GetBalanceParams, DevInspectResults, SuiTransactionBlockResponse } from '@mysten/sui/client';
9
- import { Argument, TransactionResult, Transaction as Transaction$1, TransactionObjectArgument } from '@mysten/sui/transactions';
10
-
11
- declare const API_BASE_URL: "https://sui.apis.scallop.io";
12
- declare const SDK_API_BASE_URL: "https://sdk.api.scallop.io";
8
+ import { SuiObjectDataOptions as SuiObjectDataOptions$1, SuiObjectResponse, SuiObjectData as SuiObjectData$1, GetOwnedObjectsParams as GetOwnedObjectsParams$1, GetDynamicFieldsParams as GetDynamicFieldsParams$1, DynamicFieldPage, GetDynamicFieldObjectParams as GetDynamicFieldObjectParams$1, CoinBalance, GetBalanceParams, DevInspectResults, SuiTransactionBlockResponse, SuiObjectRef as SuiObjectRef$1 } from '@mysten/sui/client';
9
+ import { Transaction as Transaction$1, TransactionObjectArgument, TransactionResult, Argument } from '@mysten/sui/transactions';
13
10
 
14
11
  /**
15
12
  * Default cache options for the QueryClient.
@@ -26,6 +23,8 @@ declare const DEFAULT_CACHE_OPTIONS: {
26
23
  };
27
24
  };
28
25
 
26
+ declare const API_BASE_URL: "https://sui.apis.scallop.io";
27
+ declare const SDK_API_BASE_URL: "https://sdk.api.scallop.io";
29
28
  declare const IS_VE_SCA_TEST: boolean;
30
29
  declare const USE_TEST_ADDRESS: boolean;
31
30
  declare const SCA_COIN_TYPE: "0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA" | "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
@@ -77,7 +76,7 @@ declare const queryKeys: {
77
76
  getPoolAddresses: () => string[];
78
77
  getMarket: () => string[];
79
78
  getSpools: () => string[];
80
- getBorrowIncentivePool: () => string[];
79
+ getBorrowIncentivePools: () => string[];
81
80
  getTotalValueLocked: () => string[];
82
81
  };
83
82
  rpc: {
@@ -110,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
+ network?: 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;
@@ -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?: {
@@ -2281,292 +1075,30 @@ declare class ScallopQuery implements ScallopQueryInterface {
2281
1075
  totalSupplyValue: number;
2282
1076
  }>;
2283
1077
  /**
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
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,7 +1116,7 @@ declare class ScallopBuilder implements ScallopBuilderInterface {
2584
1116
  readonly query: ScallopQuery;
2585
1117
  readonly usePythPullModel: boolean;
2586
1118
  readonly useOnChainXOracleList: boolean;
2587
- readonly pythSponsoredFeeds: string[];
1119
+ readonly sponsoredFeeds: string[];
2588
1120
  constructor(params: ScallopBuilderParams);
2589
1121
  get utils(): ScallopUtils;
2590
1122
  get constants(): ScallopConstants;
@@ -2612,9 +1144,19 @@ 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
+ } | {
1157
+ takeCoin: TransactionObjectArgument;
1158
+ leftCoin: TransactionObjectArgument;
1159
+ }>;
2618
1160
  /**
2619
1161
  * Specifying the sender's amount of market coins to get coins args from transaction result.
2620
1162
  *
@@ -2687,6 +1229,7 @@ declare class ScallopUtils implements ScallopUtilsInterface {
2687
1229
  pythEndpoints: string[];
2688
1230
  readonly scallopSuiKit: ScallopSuiKit;
2689
1231
  readonly constants: ScallopConstants;
1232
+ readonly timeout: number;
2690
1233
  constructor(params?: ScallopUtilsParams);
2691
1234
  get walletAddress(): string;
2692
1235
  get suiKit(): _scallop_io_sui_kit.SuiKit;
@@ -3017,10 +1560,11 @@ declare class ScallopClient implements ScallopClientInterface {
3017
1560
  * @param sign - Decide to directly sign the transaction or return the transaction block.
3018
1561
  * @param obligationId - The obligation object.
3019
1562
  * @param walletAddress - The wallet address of the owner.
1563
+ * @param isSponsoredTx - Whether the transaction is sponsored.
3020
1564
  * @return Transaction block response or transaction block.
3021
1565
  */
3022
1566
  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>>;
1567
+ depositCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign?: S, obligationId?: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
3024
1568
  /**
3025
1569
  * Withdraw collateral from the specific pool.
3026
1570
  *
@@ -3030,9 +1574,10 @@ declare class ScallopClient implements ScallopClientInterface {
3030
1574
  * @param obligationId - The obligation object.
3031
1575
  * @param obligationKey - The obligation key object to verifying obligation authority.
3032
1576
  * @param walletAddress - The wallet address of the owner.
1577
+ * @param isSponsoredTx - Whether the transaction is sponsored.
3033
1578
  * @return Transaction block response or transaction block.
3034
1579
  */
3035
- withdrawCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1580
+ withdrawCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
3036
1581
  /**
3037
1582
  * Deposit asset into the specific pool.
3038
1583
  *
@@ -3076,9 +1621,10 @@ declare class ScallopClient implements ScallopClientInterface {
3076
1621
  * @param obligationId - The obligation object.
3077
1622
  * @param obligationKey - The obligation key object to verifying obligation authority.
3078
1623
  * @param walletAddress - The wallet address of the owner.
1624
+ * @param isSponsoredTx - Whether the transaction is sponsored.
3079
1625
  * @return Transaction block response or transaction block.
3080
1626
  */
3081
- borrow<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1627
+ borrow<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
3082
1628
  /**
3083
1629
  * Repay asset into the specific pool.
3084
1630
  *
@@ -3087,9 +1633,10 @@ declare class ScallopClient implements ScallopClientInterface {
3087
1633
  * @param sign - Decide to directly sign the transaction or return the transaction block.
3088
1634
  * @param obligationId - The obligation object.
3089
1635
  * @param walletAddress - The wallet address of the owner.
1636
+ * @param isSponsoredTx - Whether the transaction is sponsored.
3090
1637
  * @return Transaction block response or transaction block.
3091
1638
  */
3092
- repay<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1639
+ repay<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
3093
1640
  /**
3094
1641
  * FlashLoan asset from the specific pool.
3095
1642
  *
@@ -3123,157 +1670,1638 @@ declare class ScallopClient implements ScallopClientInterface {
3123
1670
  stake(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
3124
1671
  stake<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
3125
1672
  /**
3126
- * Unstake market coin from the specific spool.
1673
+ * Unstake market coin from the specific spool.
1674
+ *
1675
+ * @param stakeMarketCoinName - Types of mak coin.
1676
+ * @param amount - The amount of coins would deposit.
1677
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1678
+ * @param accountId - The stake account object.
1679
+ * @param walletAddress - The wallet address of the owner.
1680
+ * @return Transaction block response or transaction block.
1681
+ */
1682
+ unstake(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1683
+ unstake<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1684
+ /**
1685
+ * Unstake market coin from the specific spool and withdraw asset from the corresponding pool.
1686
+ *
1687
+ * @param marketCoinName - Types of mak coin.
1688
+ * @param amount - The amount of coins would deposit.
1689
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1690
+ * @param accountId - The stake account object.
1691
+ * @param walletAddress - The wallet address of the owner.
1692
+ * @return Transaction block response or transaction block.
1693
+ */
1694
+ unstakeAndWithdraw(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1695
+ unstakeAndWithdraw<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1696
+ /**
1697
+ * Claim reward coin from the specific spool.
1698
+ *
1699
+ * @param stakeMarketCoinName - Types of mak coin.
1700
+ * @param amount - The amount of coins would deposit.
1701
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1702
+ * @param accountId - The stake account object.
1703
+ * @param walletAddress - The wallet address of the owner.
1704
+ * @return Transaction block response or transaction block.
1705
+ */
1706
+ claim(stakeMarketCoinName: string): Promise<SuiTransactionBlockResponse>;
1707
+ claim<S extends boolean>(stakeMarketCoinName: string, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1708
+ /**
1709
+ * stake obligaion.
1710
+ *
1711
+ * @param obligationId - The obligation account object.
1712
+ * @param obligationKeyId - The obligation key account object.
1713
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1714
+ * @param walletAddress - The wallet address of the owner.
1715
+ * @return Transaction block response or transaction block
1716
+ */
1717
+ stakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1718
+ /**
1719
+ * unstake obligaion.
1720
+ *
1721
+ * @param obligationId - The obligation account object.
1722
+ * @param obligationKeyId - The obligation key account object.
1723
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1724
+ * @param walletAddress - The wallet address of the owner.
1725
+ * @return Transaction block response or transaction block
1726
+ */
1727
+ unstakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1728
+ /**
1729
+ * Claim borrow incentive reward.
1730
+ *
1731
+ * @param poolName
1732
+ * @param amount - The amount of coins would deposit.
1733
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1734
+ * @param accountId - The stake account object.
1735
+ * @param walletAddress - The wallet address of the owner.
1736
+ * @return Transaction block response or transaction block
1737
+ */
1738
+ claimBorrowIncentive<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1739
+ /**
1740
+ * Function to migrate all market coin in user wallet into sCoin
1741
+ * @returns Transaction response
1742
+ */
1743
+ migrateAllMarketCoin<S extends boolean>(includeStakePool?: boolean, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1744
+ /**
1745
+ * Claim unlocked SCA from all veSCA accounts.
1746
+ */
1747
+ claimAllUnlockedSca(): Promise<SuiTransactionBlockResponse>;
1748
+ claimAllUnlockedSca<S extends boolean>(sign?: S, walletAddress?: string): Promise<ScallopClientVeScaReturnType<S>>;
1749
+ /**
1750
+ * Mint and get test coin.
1751
+ *
1752
+ * @remarks
1753
+ * Only be used on the test network.
1754
+ *
1755
+ * @param assetCoinName - Specific asset coin name.
1756
+ * @param amount - The amount of coins minted and received.
1757
+ * @param receiveAddress - The wallet address that receives the coins.
1758
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1759
+ * @return Transaction block response or transaction block.
1760
+ */
1761
+ mintTestCoin(assetCoinName: Exclude<string, 'sui'>, amount: number): Promise<SuiTransactionBlockResponse>;
1762
+ mintTestCoin<S extends boolean>(assetCoinName: Exclude<string, 'sui'>, amount: number, sign?: S, receiveAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1763
+ }
1764
+
1765
+ /**
1766
+ * @argument params - The parameters for the Scallop instance.
1767
+ * @argument cacheOptions - The cache options for the QueryClient.
1768
+ *
1769
+ * @description
1770
+ * The main instance that controls interaction with the Scallop contract.
1771
+ *
1772
+ * @example
1773
+ * ```typescript
1774
+ * const sdk = new Scallop(<parameters>);
1775
+ * const scallopAddress = await sdk.getScallopAddress();
1776
+ * const scallopBuilder = await sdk.createScallopBuilder();
1777
+ * const scallopClient = await sdk.createScallopClient();
1778
+ * const scallopIndexer= await sdk.createScallopIndexer();
1779
+ * const scallopUtils= await sdk.createScallopUtils();
1780
+ * ```
1781
+ */
1782
+ type ScallopParams = {
1783
+ client?: ScallopClient;
1784
+ } & ScallopClientParams;
1785
+ declare class Scallop {
1786
+ readonly client: ScallopClient;
1787
+ constructor(params: ScallopParams);
1788
+ init(force?: boolean): Promise<void>;
1789
+ /**
1790
+ * Create a scallop client instance that already has initial data.
3127
1791
  *
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.
1792
+ * @return Scallop Client.
3134
1793
  */
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>>;
1794
+ createScallopClient(): Promise<ScallopClient>;
3137
1795
  /**
3138
- * Unstake market coin from the specific spool and withdraw asset from the corresponding pool.
1796
+ * Create a scallop builder instance that already has initial data.
3139
1797
  *
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.
1798
+ * @return Scallop Builder.
3146
1799
  */
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>>;
1800
+ createScallopBuilder(): Promise<ScallopBuilder>;
3149
1801
  /**
3150
- * Claim reward coin from the specific spool.
1802
+ * Create a scallop query instance.
3151
1803
  *
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.
1804
+ * @return Scallop Query.
3158
1805
  */
3159
- claim(stakeMarketCoinName: string): Promise<SuiTransactionBlockResponse>;
3160
- claim<S extends boolean>(stakeMarketCoinName: string, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1806
+ createScallopQuery(): Promise<ScallopQuery>;
3161
1807
  /**
3162
- * stake obligaion.
1808
+ * Create a scallop utils instance.
3163
1809
  *
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
1810
+ * @return Scallop Utils.
3169
1811
  */
3170
- stakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1812
+ createScallopUtils(): Promise<ScallopUtils>;
3171
1813
  /**
3172
- * unstake obligaion.
1814
+ * Create a scallop indexer instance.
3173
1815
  *
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
1816
+ * @return Scallop Indexer.
3179
1817
  */
3180
- unstakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1818
+ createScallopIndexer(): Promise<ScallopIndexer>;
3181
1819
  /**
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
1820
+ * Get a scallop constants instance that already has initial data.
1821
+ * @returns Scallop Constants
3190
1822
  */
3191
- claimBorrowIncentive<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1823
+ getScallopConstants(): Promise<ScallopConstants>;
1824
+ }
1825
+
1826
+ type CoreIds = {
1827
+ protocolPkg: string;
1828
+ market: string;
1829
+ version: string;
1830
+ coinDecimalsRegistry: string;
1831
+ xOracle: string;
1832
+ };
1833
+ type NestedResult = Extract<Argument, {
1834
+ $kind: 'NestedResult';
1835
+ }>;
1836
+ type Obligation$1 = NestedResult;
1837
+ type ObligationKey = NestedResult;
1838
+ type ObligationHotPotato = NestedResult;
1839
+ type CoreNormalMethods = {
1840
+ openObligation: () => [Obligation$1, ObligationKey, ObligationHotPotato];
1841
+ returnObligation: (obligation: SuiObjectArg, obligationHotPotato: SuiObjectArg) => void;
1842
+ openObligationEntry: () => void;
1843
+ addCollateral: (obligation: SuiObjectArg, coin: SuiObjectArg, collateralCoinName: string) => void;
1844
+ takeCollateral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, collateralCoinName: string) => TransactionResult;
1845
+ deposit: (coin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1846
+ depositEntry: (coin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1847
+ withdraw: (marketCoin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1848
+ withdrawEntry: (marketCoin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1849
+ borrow: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: string) => TransactionResult;
1850
+ borrowWithReferral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, borrowReferral: SuiObjectArg, amount: number | SuiTxArg, poolCoinName: string) => TransactionResult;
1851
+ borrowEntry: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: string) => TransactionResult;
1852
+ repay: (obligation: SuiObjectArg, coin: SuiObjectArg, poolCoinName: string) => void;
1853
+ borrowFlashLoan: (amount: number | SuiTxArg, poolCoinName: string) => TransactionResult;
1854
+ repayFlashLoan: (coin: SuiObjectArg, loan: SuiObjectArg, poolCoinName: string) => void;
1855
+ };
1856
+ type CoreQuickMethods = {
1857
+ addCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
1858
+ takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
1859
+ usePythPullModel?: boolean;
1860
+ useOnChainXOracleList?: boolean;
1861
+ sponsoredFeeds?: string[];
1862
+ isSponsoredTx?: boolean;
1863
+ }) => Promise<TransactionResult>;
1864
+ borrowQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
1865
+ usePythPullModel?: boolean;
1866
+ useOnChainXOracleList?: boolean;
1867
+ sponsoredFeeds?: string[];
1868
+ isSponsoredTx?: boolean;
1869
+ }) => Promise<TransactionResult>;
1870
+ borrowWithReferralQuick: (amount: number, poolCoinName: string, borrowReferral: SuiObjectArg, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
1871
+ usePythPullModel?: boolean;
1872
+ useOnChainXOracleList?: boolean;
1873
+ sponsoredFeeds?: string[];
1874
+ isSponsoredTx?: boolean;
1875
+ }) => Promise<TransactionResult>;
1876
+ depositQuick: (amount: number, poolCoinName: string, returnSCoin?: boolean, isSponsoredTx?: boolean) => Promise<TransactionResult>;
1877
+ withdrawQuick: (amount: number, poolCoinName: string) => Promise<TransactionResult>;
1878
+ repayQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
1879
+ updateAssetPricesQuick: (assetCoinNames?: string[], updateOracleOptions?: {
1880
+ usePythPullModel?: boolean;
1881
+ useOnChainXOracleList?: boolean;
1882
+ sponsoredFeeds?: string[];
1883
+ isSponsoredTx?: boolean;
1884
+ }) => Promise<void>;
1885
+ };
1886
+ type SuiTxBlockWithCoreNormalMethods = SuiTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
1887
+ type CoreTxBlock = SuiTxBlockWithCoreNormalMethods & CoreQuickMethods;
1888
+ type GenerateCoreNormalMethod = (params: {
1889
+ builder: ScallopBuilder;
1890
+ txBlock: SuiTxBlock;
1891
+ }) => CoreNormalMethods;
1892
+ type GenerateCoreQuickMethod = (params: {
1893
+ builder: ScallopBuilder;
1894
+ txBlock: SuiTxBlockWithCoreNormalMethods;
1895
+ }) => CoreQuickMethods;
1896
+
1897
+ type SpoolIds = {
1898
+ spoolPkg: string;
1899
+ };
1900
+ type SpoolNormalMethods = {
1901
+ createStakeAccount: (stakeMarketCoinName: string) => TransactionResult;
1902
+ stake: (stakeAccount: SuiAddressArg, coin: SuiObjectArg, stakeMarketCoinName: string) => void;
1903
+ unstake: (stakeAccount: SuiAddressArg, amount: number, stakeMarketCoinName: string) => TransactionResult;
1904
+ claim: (stakeAccount: SuiAddressArg, stakeMarketCoinName: string) => TransactionResult;
1905
+ };
1906
+ type SpoolQuickMethods = {
1907
+ stakeQuick(amountOrMarketCoin: SuiObjectArg | number, stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg): Promise<void>;
1908
+ unstakeQuick(amount: number, stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg, returnSCoin?: boolean): Promise<TransactionResult | undefined>;
1909
+ claimQuick(stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg): Promise<TransactionResult[]>;
1910
+ };
1911
+ type SuiTxBlockWithSpoolNormalMethods = SuiTxBlock & SuiTxBlockWithSCoin & SpoolNormalMethods;
1912
+ type SpoolTxBlock = SuiTxBlockWithSpoolNormalMethods & SpoolQuickMethods;
1913
+ type GenerateSpoolNormalMethod = (params: {
1914
+ builder: ScallopBuilder;
1915
+ txBlock: SuiTxBlock;
1916
+ }) => SpoolNormalMethods;
1917
+ type GenerateSpoolQuickMethod = (params: {
1918
+ builder: ScallopBuilder;
1919
+ txBlock: SuiTxBlockWithSpoolNormalMethods;
1920
+ }) => SpoolQuickMethods;
1921
+
1922
+ type BorrowIncentiveIds = {
1923
+ borrowIncentivePkg: string;
1924
+ query: string;
1925
+ config: string;
1926
+ incentivePools: string;
1927
+ incentiveAccounts: string;
1928
+ obligationAccessStore: string;
1929
+ };
1930
+ type BorrowIncentiveNormalMethods = {
1931
+ stakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
1932
+ stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey: SuiObjectArg) => void;
1933
+ unstakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
1934
+ claimBorrowIncentive: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, rewardType: string) => TransactionResult;
1935
+ deactivateBoost: (obligation: SuiObjectArg, veScaKey: SuiObjectArg) => void;
1936
+ };
1937
+ type BorrowIncentiveQuickMethods = {
1938
+ stakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
1939
+ stakeObligationWithVeScaQuick(obligation?: string, obligationKey?: string, veScaKey?: string): Promise<void>;
1940
+ unstakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
1941
+ claimBorrowIncentiveQuick(rewardType: string, obligation?: string, obligationKey?: string): Promise<TransactionResult>;
1942
+ };
1943
+ type SuiTxBlockWithBorrowIncentiveNormalMethods = SuiTxBlock & BorrowIncentiveNormalMethods;
1944
+ type BorrowIncentiveTxBlock = SuiTxBlockWithBorrowIncentiveNormalMethods & BorrowIncentiveQuickMethods;
1945
+ type GenerateBorrowIncentiveNormalMethod = (params: {
1946
+ builder: ScallopBuilder;
1947
+ txBlock: SuiTxBlock;
1948
+ }) => BorrowIncentiveNormalMethods;
1949
+ type GenerateBorrowIncentiveQuickMethod = (params: {
1950
+ builder: ScallopBuilder;
1951
+ txBlock: SuiTxBlockWithBorrowIncentiveNormalMethods;
1952
+ }) => BorrowIncentiveQuickMethods;
1953
+
1954
+ type VeScaNormalMethods = {
1955
+ lockSca: (scaCoin: SuiObjectArg, unlockAtInSecondTimestamp: number) => TransactionResult;
1956
+ extendLockPeriod: (veScaKey: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
1957
+ extendLockAmount: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg) => void;
1958
+ renewExpiredVeSca: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
1959
+ redeemSca: (veScaKey: SuiObjectArg) => TransactionResult;
1960
+ mintEmptyVeSca: () => TransactionResult;
1961
+ splitVeSca: (veScaKey: SuiObjectArg, splitAmount: string) => TransactionResult;
1962
+ mergeVeSca: (targetVeScaKey: SuiObjectArg, sourceVeScaKey: SuiObjectArg) => void;
1963
+ };
1964
+ type QuickMethodReturnType<T extends boolean> = T extends true ? void : TransactionResult;
1965
+ type VeScaQuickMethods = {
3192
1966
  /**
3193
- * Function to migrate all market coin in user wallet into sCoin
3194
- * @returns Transaction response
1967
+ * Quick methods to automate
1968
+ * lock initial SCA, extend lock period, lock more SCA, renew expired VeSCA, and redeem SCA
1969
+ *
1970
+ * **Flow:**
1971
+ * - If only `amountOrCoin` is provided, it will lock the amount of existing not expired veSCA
1972
+ * - If only `lockPeriodInDays` is provided, it will extend the lock period of existing not expired veSCA
1973
+ *
1974
+ * **Note:**
1975
+ * - If one or both flow above is used on a expired veSCA, it will claim the unlocked SCA
1976
+ * and renew the veSCA first, and then flow continues
1977
+ * - If users has no veSCA yet, they need to provide both `amountOrCoin` and `lockPeriodInDays` for initial lock
1978
+ * @param amountOrCoin
1979
+ * @param lockPeriodInDays
1980
+ * @param autoCheck
3195
1981
  */
3196
- migrateAllMarketCoin<S extends boolean>(includeStakePool?: boolean, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1982
+ lockScaQuick(params: {
1983
+ amountOrCoin?: SuiObjectArg | number;
1984
+ lockPeriodInDays?: number;
1985
+ autoCheck?: boolean;
1986
+ veScaKey?: SuiObjectData$1 | string;
1987
+ }): Promise<void>;
1988
+ extendLockPeriodQuick: (params: {
1989
+ lockPeriodInDays: number;
1990
+ autoCheck?: boolean;
1991
+ veScaKey?: SuiObjectData$1 | string;
1992
+ }) => Promise<void>;
1993
+ extendLockAmountQuick: (params: {
1994
+ scaAmount: number;
1995
+ autoCheck?: boolean;
1996
+ veScaKey?: SuiObjectData$1 | string;
1997
+ }) => Promise<void>;
1998
+ renewExpiredVeScaQuick: (params: {
1999
+ scaAmount: number;
2000
+ lockPeriodInDays: number;
2001
+ autoCheck?: boolean;
2002
+ veScaKey?: SuiObjectData$1 | string;
2003
+ }) => Promise<void>;
2004
+ redeemScaQuick: <T extends boolean>(params: {
2005
+ veScaKey?: SuiObjectData$1 | string;
2006
+ transferSca?: T;
2007
+ }) => Promise<QuickMethodReturnType<T> | undefined>;
2008
+ splitVeScaQuick: <T extends boolean>(params: {
2009
+ splitAmount: string;
2010
+ veScaKey: string;
2011
+ transferVeScaKey?: T;
2012
+ }) => Promise<QuickMethodReturnType<T> | undefined>;
2013
+ mergeVeScaQuick: (params: {
2014
+ targetVeScaKey: string;
2015
+ sourceVeScaKey: string;
2016
+ }) => Promise<void>;
2017
+ };
2018
+ type SuiTxBlockWithVeScaNormalMethods = SuiTxBlock & VeScaNormalMethods;
2019
+ type VeScaTxBlock = SuiTxBlockWithVeScaNormalMethods & VeScaQuickMethods;
2020
+ type GenerateVeScaNormalMethod = (params: {
2021
+ builder: ScallopBuilder;
2022
+ txBlock: SuiTxBlock;
2023
+ }) => VeScaNormalMethods;
2024
+ type GenerateVeScaQuickMethod = (params: {
2025
+ builder: ScallopBuilder;
2026
+ txBlock: SuiTxBlockWithVeScaNormalMethods;
2027
+ }) => VeScaQuickMethods;
2028
+
2029
+ type ReferralNormalMethods = {
2030
+ bindToReferral: (veScaKeyId: string) => void;
2031
+ claimReferralTicket: (poolCoinName: string) => TransactionResult$1;
2032
+ burnReferralTicket: (ticket: SuiObjectArg, poolCoinName: string) => void;
2033
+ claimReferralRevenue: (veScaKey: SuiObjectArg, poolCoinName: string) => TransactionResult$1;
2034
+ };
2035
+ type ReferralQuickMethods = {
2036
+ claimReferralRevenueQuick: (veScaKey: SuiObjectArg, coinNames: string[]) => Promise<void>;
2037
+ };
2038
+ type SuiTxBlockWithReferralNormalMethods = SuiTxBlock & ReferralNormalMethods;
2039
+ type ReferralTxBlock = SuiTxBlockWithReferralNormalMethods & ReferralQuickMethods;
2040
+
2041
+ type LoyaltyProgramNormalMethods = {
2042
+ claimLoyaltyRevenue: (veScaKey: SuiObjectArg) => TransactionResult$1;
2043
+ claimVeScaLoyaltyReward: (veScaKey: SuiObjectArg) => TransactionResult$1;
2044
+ };
2045
+ type LoyaltyProgramQuickMethods = {
2046
+ claimLoyaltyRevenueQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
2047
+ claimVeScaLoyaltyRewardQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
2048
+ };
2049
+ type SuiTxBlockWithLoyaltyProgramNormalMethods = SuiTxBlock & LoyaltyProgramNormalMethods;
2050
+ type LoyaltyProgramTxBlock = SuiTxBlockWithLoyaltyProgramNormalMethods & LoyaltyProgramQuickMethods;
2051
+ type GenerateLoyaltyProgramNormalMethod = (params: {
2052
+ builder: ScallopBuilder;
2053
+ txBlock: SuiTxBlock;
2054
+ }) => LoyaltyProgramNormalMethods;
2055
+ type GenerateLoyaltyProgramQuickMethod = (params: {
2056
+ builder: ScallopBuilder;
2057
+ txBlock: SuiTxBlockWithLoyaltyProgramNormalMethods;
2058
+ }) => LoyaltyProgramQuickMethods;
2059
+
2060
+ type sCoinPkgIds = {
2061
+ pkgId: string;
2062
+ };
2063
+ type sCoinNormalMethods = {
3197
2064
  /**
3198
- * Claim unlocked SCA from all veSCA accounts.
2065
+ * Lock marketCoin and return sCoin
2066
+ * @param marketCoinName
2067
+ * @param marketCoin
2068
+ * @returns
3199
2069
  */
3200
- claimAllUnlockedSca(): Promise<SuiTransactionBlockResponse>;
3201
- claimAllUnlockedSca<S extends boolean>(sign?: S, walletAddress?: string): Promise<ScallopClientVeScaReturnType<S>>;
2070
+ mintSCoin: (marketCoinName: string, marketCoin: SuiObjectArg) => TransactionResult$1;
3202
2071
  /**
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.
2072
+ * Burn sCoin and return marketCoin
2073
+ * @param sCoinName
2074
+ * @param sCoin
2075
+ * @returns
3213
2076
  */
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>>;
2077
+ burnSCoin: (sCoinName: string, sCoin: SuiObjectArg) => TransactionResult$1;
2078
+ };
2079
+ type sCoinQuickMethods = {
2080
+ mintSCoinQuick: (marketCoinName: string, amount: number) => Promise<TransactionResult$1>;
2081
+ burnSCoinQuick: (sCoinName: string, amount: number) => Promise<TransactionResult$1>;
2082
+ };
2083
+ type SuiTxBlockWithSCoinNormalMethods = SuiTxBlock & BaseScallopTxBlock & sCoinNormalMethods;
2084
+ type SCoinTxBlock = SuiTxBlockWithSCoinNormalMethods & sCoinQuickMethods;
2085
+ type GenerateSCoinNormalMethod = (params: {
2086
+ builder: ScallopBuilder;
2087
+ txBlock: SuiTxBlock;
2088
+ }) => sCoinNormalMethods;
2089
+ type GenerateSCoinQuickMethod = (params: {
2090
+ builder: ScallopBuilder;
2091
+ txBlock: SuiTxBlockWithSCoinNormalMethods;
2092
+ }) => sCoinQuickMethods;
2093
+
2094
+ type BaseScallopTxBlock = ReferralTxBlock & LoyaltyProgramTxBlock & BorrowIncentiveTxBlock & VeScaTxBlock;
2095
+ type SuiTxBlockWithSCoin = BaseScallopTxBlock & SCoinTxBlock;
2096
+ type SuiTxBlockWithSpool = SuiTxBlockWithSCoin & SpoolTxBlock;
2097
+ type ScallopTxBlock = SuiTxBlockWithSpool & CoreTxBlock;
2098
+
2099
+ type PoolAddress = {
2100
+ coinName: string;
2101
+ symbol: string;
2102
+ coinType: string;
2103
+ coinMetadataId: string;
2104
+ decimals: number;
2105
+ isIsolated: boolean;
2106
+ pythFeed?: string;
2107
+ pythFeedObjectId?: string;
2108
+ lendingPoolAddress?: string;
2109
+ borrowDynamic?: string;
2110
+ interestModel?: string;
2111
+ borrowFeeKey?: string;
2112
+ flashloanFeeObject?: string;
2113
+ coinGeckoId?: string;
2114
+ collateralPoolAddress?: string;
2115
+ riskModel?: string;
2116
+ supplyLimitKey?: string;
2117
+ borrowLimitKey?: string;
2118
+ sCoinType?: string;
2119
+ sCoinName?: string;
2120
+ sCoinSymbol?: string;
2121
+ sCoinMetadataId?: string;
2122
+ sCoinTreasury?: string;
2123
+ isolatedAssetKey: string;
2124
+ spool?: string;
2125
+ spoolReward?: string;
2126
+ spoolName?: string;
2127
+ };
2128
+ type Whitelist = {
2129
+ lending: Set<string>;
2130
+ borrowing: Set<string>;
2131
+ collateral: Set<string>;
2132
+ packages: Set<string>;
2133
+ spool: Set<string>;
2134
+ scoin: Set<string>;
2135
+ suiBridge: Set<string>;
2136
+ wormhole: Set<string>;
2137
+ oracles: Set<string>;
2138
+ borrowIncentiveRewards: Set<string>;
2139
+ rewardsAsPoint: Set<string>;
2140
+ pythEndpoints: Set<string>;
2141
+ deprecated: Set<string>;
2142
+ emerging: Set<string>;
2143
+ };
2144
+ type CoinWrappedType = {
2145
+ from: string;
2146
+ type: string;
2147
+ } | undefined;
2148
+
2149
+ type Coins = {
2150
+ [K in string]: K;
2151
+ };
2152
+ type AssetCoins = {
2153
+ [K in string]: K;
2154
+ };
2155
+ type MarketCoins = {
2156
+ [K in string]: K;
2157
+ };
2158
+ type SCoins = {
2159
+ [K in string]: K;
2160
+ };
2161
+ type StakeMarketCoins = {
2162
+ [K in string]: K;
2163
+ };
2164
+ type StakeRewardCoins = {
2165
+ [key in string]: string;
2166
+ };
2167
+ type SuiBridgeCoins = {
2168
+ [K in string]: K;
2169
+ };
2170
+ type BorrowIncentiveRewardCoins = {
2171
+ [key in string]: string[];
2172
+ };
2173
+ type AssetCoinIds = {
2174
+ [key in string]: string;
2175
+ };
2176
+ type SCoinIds = {
2177
+ [key in string]: string;
2178
+ };
2179
+ type SCoinTreasuryCaps = {
2180
+ [key in string]: string;
2181
+ };
2182
+ type SCoinConverterTreasury = {
2183
+ [key in string]: string;
2184
+ };
2185
+ type PickFromUnion<T, K extends string> = K extends T ? K : never;
2186
+ type WormholeCoinIds = {
2187
+ [key in PickFromUnion<string, 'weth' | 'wbtc' | 'wusdc' | 'wusdt' | 'wapt' | 'wsol'>]: string;
2188
+ };
2189
+ type VoloCoinIds = {
2190
+ [key in PickFromUnion<string, 'vsui'>]: string;
2191
+ };
2192
+ type SuiBridgedCoinPackageIds = {
2193
+ [key in string]: string;
2194
+ };
2195
+
2196
+ declare const _SUPPORT_ORACLES: readonly ["supra", "switchboard", "pyth"];
2197
+ type SupportOracleType = (typeof _SUPPORT_ORACLES)[number];
2198
+ type xOracleRules = {
2199
+ primary: SupportOracleType[];
2200
+ secondary: SupportOracleType[];
2201
+ };
2202
+ type xOracleRuleType = keyof xOracleRules;
2203
+ type xOracleListType = {
2204
+ [key in string]: xOracleRules;
2205
+ };
2206
+
2207
+ interface BorrowIncentiveAccountKey {
2208
+ id: string;
2209
+ onwerId: string;
2210
+ }
2211
+ type OptionalKeys$4<T> = {
2212
+ [K in keyof T]?: T[K];
2213
+ };
2214
+ type BorrowIncentivePools = OptionalKeys$4<Record<string, BorrowIncentivePool>>;
2215
+ type BorrowIncentivePoolPoints = {
2216
+ symbol: string;
2217
+ coinName: string;
2218
+ coinType: string;
2219
+ coinDecimal: number;
2220
+ coinPrice: number;
2221
+ } & Required<Pick<ParsedBorrowIncentivePoolPointData, 'points' | 'distributedPoint' | 'weightedAmount'>> & CalculatedBorrowIncentivePoolPointData;
2222
+ type BorrowIncentivePool = {
2223
+ coinName: string;
2224
+ symbol: string;
2225
+ coinType: string;
2226
+ coinDecimal: number;
2227
+ coinPrice: number;
2228
+ stakedAmount: number;
2229
+ stakedCoin: number;
2230
+ stakedValue: number;
2231
+ points: OptionalKeys$4<Record<string, BorrowIncentivePoolPoints>>;
2232
+ };
2233
+ type OriginBorrowIncentivePoolPointData = {
2234
+ point_type: {
2235
+ name: string;
2236
+ };
2237
+ distributed_point_per_period: string;
2238
+ point_distribution_time: string;
2239
+ distributed_point: string;
2240
+ points: string;
2241
+ index: string;
2242
+ base_weight: string;
2243
+ weighted_amount: string;
2244
+ last_update: string;
2245
+ created_at: string;
2246
+ };
2247
+ type OriginBorrowIncentivePoolData = {
2248
+ pool_type: {
2249
+ name: string;
2250
+ };
2251
+ points: OriginBorrowIncentivePoolPointData[];
2252
+ min_stakes: string;
2253
+ max_stakes: string;
2254
+ stakes: string;
2255
+ created_at: string;
2256
+ };
2257
+ type ParsedBorrowIncentivePoolPointData = {
2258
+ pointType: string;
2259
+ distributedPointPerPeriod: number;
2260
+ period: number;
2261
+ distributedPoint: number;
2262
+ points: number;
2263
+ index: number;
2264
+ baseWeight: number;
2265
+ weightedAmount: number;
2266
+ lastUpdate: number;
2267
+ createdAt: number;
2268
+ };
2269
+ type ParsedBorrowIncentivePoolData = {
2270
+ poolType: string;
2271
+ poolPoints: OptionalKeys$4<Record<string, ParsedBorrowIncentivePoolPointData>>;
2272
+ minStakes: number;
2273
+ maxStakes: number;
2274
+ staked: number;
2275
+ };
2276
+ type CalculatedBorrowIncentivePoolPointData = {
2277
+ baseWeight: number;
2278
+ weightedStakedAmount: number;
2279
+ weightedStakedCoin: number;
2280
+ weightedStakedValue: number;
2281
+ distributedPointPerSec: number;
2282
+ accumulatedPoints: number;
2283
+ currentPointIndex: number;
2284
+ currentTotalDistributedPoint: number;
2285
+ rewardApr: number;
2286
+ rewardPerSec: number;
2287
+ };
2288
+ type BorrowIncentiveAccounts = OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountData>>;
2289
+ type OriginBorrowIncentiveAccountPoolData = {
2290
+ point_type: {
2291
+ name: string;
2292
+ };
2293
+ weighted_amount: string;
2294
+ points: string;
2295
+ total_points: string;
2296
+ index: string;
2297
+ };
2298
+ type OriginBorrowIncentiveAccountData = {
2299
+ points_list: OriginBorrowIncentiveAccountPoolData[];
2300
+ pool_type: {
2301
+ name: string;
2302
+ };
2303
+ debt_amount: string;
2304
+ };
2305
+ type ParsedBorrowIncentiveAccountPoolData = {
2306
+ pointType: string;
2307
+ weightedAmount: number;
2308
+ points: number;
2309
+ totalPoints: number;
2310
+ index: number;
2311
+ };
2312
+ type ParsedBorrowIncentiveAccountData = {
2313
+ pointList: OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountPoolData>>;
2314
+ poolType: string;
2315
+ debtAmount: number;
2316
+ };
2317
+ /**
2318
+ * The query interface for `incentive_pools_query::incentive_pools_data` inspectTxn.
2319
+ */
2320
+ interface BorrowIncentivePoolsQueryInterface {
2321
+ incentive_pools: OriginBorrowIncentivePoolData[];
2322
+ }
2323
+ /**
2324
+ * The query interface for `incentive_account_query::incentive_account_data` inspectTxn.
2325
+ */
2326
+ interface BorrowIncentiveAccountsQueryInterface {
2327
+ pool_records: OriginBorrowIncentiveAccountData[];
2328
+ }
2329
+
2330
+ type OptionalKeys$3<T> = {
2331
+ [K in keyof T]?: T[K];
2332
+ };
2333
+ type MarketPools = OptionalKeys$3<Record<string, MarketPool>>;
2334
+ type MarketCollaterals = OptionalKeys$3<Record<string, MarketCollateral>>;
2335
+ type CoinAmounts = OptionalKeys$3<Record<string, number>>;
2336
+ type MarketCoinAmounts = OptionalKeys$3<Record<string, number>>;
2337
+ type SCoinAmounts = OptionalKeys$3<Record<string, number>>;
2338
+ type BalanceSheet = {
2339
+ cash: string;
2340
+ debt: string;
2341
+ market_coin_supply: string;
2342
+ revenue: string;
2343
+ };
2344
+ type BorrowDynamic = {
2345
+ borrow_index: string;
2346
+ interest_rate: {
2347
+ fields: {
2348
+ value: string;
2349
+ };
2350
+ };
2351
+ interest_rate_scale: string;
2352
+ last_updated: string;
2353
+ };
2354
+ type BorrowFee = {
2355
+ value: string;
2356
+ };
2357
+ type InterestModel = {
2358
+ base_borrow_rate_per_sec: {
2359
+ fields: {
2360
+ value: string;
2361
+ };
2362
+ };
2363
+ borrow_rate_on_high_kink: {
2364
+ fields: {
2365
+ value: string;
2366
+ };
2367
+ };
2368
+ borrow_rate_on_mid_kink: {
2369
+ fields: {
2370
+ value: string;
2371
+ };
2372
+ };
2373
+ borrow_weight: {
2374
+ fields: {
2375
+ value: string;
2376
+ };
2377
+ };
2378
+ borrow_fee_rate: {
2379
+ fields: {
2380
+ value: string;
2381
+ };
2382
+ };
2383
+ high_kink: {
2384
+ fields: {
2385
+ value: string;
2386
+ };
2387
+ };
2388
+ interest_rate_scale: string;
2389
+ max_borrow_rate: {
2390
+ fields: {
2391
+ value: string;
2392
+ };
2393
+ };
2394
+ mid_kink: {
2395
+ fields: {
2396
+ value: string;
2397
+ };
2398
+ };
2399
+ min_borrow_amount: string;
2400
+ revenue_factor: {
2401
+ fields: {
2402
+ value: string;
2403
+ };
2404
+ };
2405
+ type: {
2406
+ fields: {
2407
+ name: string;
2408
+ };
2409
+ };
2410
+ };
2411
+ type RiskModel = {
2412
+ collateral_factor: {
2413
+ fields: {
2414
+ value: string;
2415
+ };
2416
+ };
2417
+ liquidation_discount: {
2418
+ fields: {
2419
+ value: string;
2420
+ };
2421
+ };
2422
+ liquidation_factor: {
2423
+ fields: {
2424
+ value: string;
2425
+ };
2426
+ };
2427
+ liquidation_penalty: {
2428
+ fields: {
2429
+ value: string;
2430
+ };
2431
+ };
2432
+ liquidation_revenue_factor: {
2433
+ fields: {
2434
+ value: string;
2435
+ };
2436
+ };
2437
+ max_collateral_amount: string;
2438
+ type: {
2439
+ fields: {
2440
+ name: string;
2441
+ };
2442
+ };
2443
+ };
2444
+ type CollateralStat = {
2445
+ amount: string;
2446
+ };
2447
+ type MarketPool = {
2448
+ coinName: string;
2449
+ symbol: string;
2450
+ coinType: string;
2451
+ marketCoinType: string;
2452
+ sCoinType: string;
2453
+ coinWrappedType: CoinWrappedType;
2454
+ coinDecimal: number;
2455
+ coinPrice: number;
2456
+ maxSupplyCoin: number;
2457
+ maxBorrowCoin: number;
2458
+ isIsolated: boolean;
2459
+ } & Required<Pick<ParsedMarketPoolData, 'highKink' | 'midKink' | 'reserveFactor' | 'borrowWeight' | 'borrowFee' | 'marketCoinSupplyAmount' | 'minBorrowAmount'>> & CalculatedMarketPoolData;
2460
+ type MarketCollateral = {
2461
+ coinName: string;
2462
+ symbol: string;
2463
+ coinType: string;
2464
+ marketCoinType: string;
2465
+ coinWrappedType: CoinWrappedType;
2466
+ coinDecimal: number;
2467
+ coinPrice: number;
2468
+ isIsolated: boolean;
2469
+ } & Required<Pick<ParsedMarketCollateralData, 'collateralFactor' | 'liquidationFactor' | 'liquidationDiscount' | 'liquidationPenalty' | 'liquidationReserveFactor'>> & CalculatedMarketCollateralData;
2470
+ type OriginMarketPoolData = {
2471
+ type: {
2472
+ name: string;
2473
+ };
2474
+ maxBorrowRate: {
2475
+ value: string;
2476
+ };
2477
+ interestRate: {
2478
+ value: string;
2479
+ };
2480
+ interestRateScale: string;
2481
+ borrowIndex: string;
2482
+ lastUpdated: string;
2483
+ cash: string;
2484
+ debt: string;
2485
+ marketCoinSupply: string;
2486
+ reserve: string;
2487
+ reserveFactor: {
2488
+ value: string;
2489
+ };
2490
+ borrowWeight: {
2491
+ value: string;
2492
+ };
2493
+ borrowFeeRate: {
2494
+ value: string;
2495
+ };
2496
+ baseBorrowRatePerSec: {
2497
+ value: string;
2498
+ };
2499
+ borrowRateOnHighKink: {
2500
+ value: string;
2501
+ };
2502
+ borrowRateOnMidKink: {
2503
+ value: string;
2504
+ };
2505
+ highKink: {
2506
+ value: string;
2507
+ };
2508
+ midKink: {
2509
+ value: string;
2510
+ };
2511
+ minBorrowAmount: string;
2512
+ isIsolated: boolean;
2513
+ supplyLimit: string;
2514
+ borrowLimit: string;
2515
+ };
2516
+ type ParsedMarketPoolData = {
2517
+ coinType: string;
2518
+ maxBorrowRate: number;
2519
+ borrowRate: number;
2520
+ borrowRateScale: number;
2521
+ borrowIndex: number;
2522
+ lastUpdated: number;
2523
+ cashAmount: number;
2524
+ debtAmount: number;
2525
+ marketCoinSupplyAmount: number;
2526
+ reserveAmount: number;
2527
+ reserveFactor: number;
2528
+ borrowWeight: number;
2529
+ borrowFee: number;
2530
+ baseBorrowRate: number;
2531
+ borrowRateOnHighKink: number;
2532
+ borrowRateOnMidKink: number;
2533
+ highKink: number;
2534
+ midKink: number;
2535
+ minBorrowAmount: number;
2536
+ isIsolated: boolean;
2537
+ supplyLimit: number;
2538
+ borrowLimit: number;
2539
+ };
2540
+ type CalculatedMarketPoolData = {
2541
+ baseBorrowApr: number;
2542
+ baseBorrowApy: number;
2543
+ borrowAprOnHighKink: number;
2544
+ borrowApyOnHighKink: number;
2545
+ borrowAprOnMidKink: number;
2546
+ borrowApyOnMidKink: number;
2547
+ coinDecimal: number;
2548
+ conversionRate: number;
2549
+ maxBorrowApr: number;
2550
+ maxBorrowApy: number;
2551
+ borrowApr: number;
2552
+ borrowApy: number;
2553
+ borrowIndex: number;
2554
+ growthInterest: number;
2555
+ supplyAmount: number;
2556
+ supplyCoin: number;
2557
+ borrowAmount: number;
2558
+ borrowCoin: number;
2559
+ reserveAmount: number;
2560
+ reserveCoin: number;
2561
+ utilizationRate: number;
2562
+ supplyApr: number;
2563
+ supplyApy: number;
2564
+ isIsolated: boolean;
2565
+ maxSupplyCoin: number;
2566
+ maxBorrowCoin: number;
2567
+ };
2568
+ type OriginMarketCollateralData = {
2569
+ type: {
2570
+ name: string;
2571
+ };
2572
+ isIsolated: boolean;
2573
+ collateralFactor: {
2574
+ value: string;
2575
+ };
2576
+ liquidationFactor: {
2577
+ value: string;
2578
+ };
2579
+ liquidationDiscount: {
2580
+ value: string;
2581
+ };
2582
+ liquidationPenalty: {
2583
+ value: string;
2584
+ };
2585
+ liquidationReserveFactor: {
2586
+ value: string;
2587
+ };
2588
+ maxCollateralAmount: string;
2589
+ totalCollateralAmount: string;
2590
+ };
2591
+ type ParsedMarketCollateralData = {
2592
+ coinType: string;
2593
+ collateralFactor: number;
2594
+ liquidationFactor: number;
2595
+ liquidationDiscount: number;
2596
+ liquidationPenalty: number;
2597
+ liquidationReserveFactor: number;
2598
+ maxCollateralAmount: number;
2599
+ totalCollateralAmount: number;
2600
+ isIsolated: boolean;
2601
+ };
2602
+ type CalculatedMarketCollateralData = {
2603
+ coinDecimal: number;
2604
+ isIsolated: boolean;
2605
+ maxDepositAmount: number;
2606
+ maxDepositCoin: number;
2607
+ depositAmount: number;
2608
+ depositCoin: number;
2609
+ };
2610
+ type Market = {
2611
+ pools: MarketPools;
2612
+ collaterals: MarketCollaterals;
2613
+ data?: MarketQueryInterface;
2614
+ };
2615
+ type Obligation = {
2616
+ id: string;
2617
+ keyId: string;
2618
+ locked: boolean;
2619
+ };
2620
+ /**
2621
+ * The query interface for `market_query::market_data` inspectTxn.
2622
+ */
2623
+ interface MarketQueryInterface {
2624
+ collaterals: {
2625
+ collateralFactor: {
2626
+ value: string;
2627
+ };
2628
+ liquidationDiscount: {
2629
+ value: string;
2630
+ };
2631
+ liquidationFactor: {
2632
+ value: string;
2633
+ };
2634
+ liquidationPanelty: {
2635
+ value: string;
2636
+ };
2637
+ liquidationReserveFactor: {
2638
+ value: string;
2639
+ };
2640
+ maxCollateralAmount: string;
2641
+ totalCollateralAmount: string;
2642
+ type: {
2643
+ name: string;
2644
+ };
2645
+ }[];
2646
+ pools: {
2647
+ baseBorrowRatePerSec: {
2648
+ value: string;
2649
+ };
2650
+ borrowRateOnHighKink: {
2651
+ value: string;
2652
+ };
2653
+ borrowRateOnMidKink: {
2654
+ value: string;
2655
+ };
2656
+ maxBorrowRate: {
2657
+ value: string;
2658
+ };
2659
+ highKink: {
2660
+ value: string;
2661
+ };
2662
+ midKink: {
2663
+ value: string;
2664
+ };
2665
+ interestRate: {
2666
+ value: string;
2667
+ };
2668
+ interestRateScale: string;
2669
+ borrowIndex: string;
2670
+ lastUpdated: string;
2671
+ cash: string;
2672
+ debt: string;
2673
+ marketCoinSupply: string;
2674
+ minBorrowAmount: string;
2675
+ reserve: string;
2676
+ reserveFactor: {
2677
+ value: string;
2678
+ };
2679
+ borrowWeight: {
2680
+ value: string;
2681
+ };
2682
+ borrowFeeRate: {
2683
+ value: string;
2684
+ };
2685
+ type: {
2686
+ name: string;
2687
+ };
2688
+ }[];
2689
+ }
2690
+ /**
2691
+ * The query interface for `obligation_query::obligation_data` inspectTxn.
2692
+ */
2693
+ interface ObligationQueryInterface {
2694
+ collaterals: {
2695
+ type: {
2696
+ name: string;
2697
+ };
2698
+ amount: string;
2699
+ }[];
2700
+ debts: {
2701
+ type: {
2702
+ name: string;
2703
+ };
2704
+ amount: string;
2705
+ borrowIndex: string;
2706
+ }[];
2707
+ }
2708
+
2709
+ type LoyaltyProgramInfo = {
2710
+ pendingReward: number;
2711
+ totalPoolReward: number;
2712
+ isClaimEnabled: boolean;
2713
+ };
2714
+ type VeScaLoyaltyProgramInfo = {
2715
+ pendingVeScaReward: number;
2716
+ pendingScaReward: number;
2717
+ totalPoolReward: number;
2718
+ isClaimEnabled: boolean;
2719
+ };
2720
+
2721
+ type OptionalKeys$2<T> = {
2722
+ [K in keyof T]?: T[K];
2723
+ };
2724
+ type Spools = OptionalKeys$2<Record<string, Spool>>;
2725
+ type Spool = {
2726
+ marketCoinName: string;
2727
+ symbol: string;
2728
+ coinType: string;
2729
+ marketCoinType: string;
2730
+ rewardCoinType: string;
2731
+ sCoinType: string;
2732
+ coinDecimal: number;
2733
+ rewardCoinDecimal: number;
2734
+ coinPrice: number;
2735
+ marketCoinPrice: number;
2736
+ rewardCoinPrice: number;
2737
+ } & Required<Pick<ParsedSpoolData, 'maxPoint' | 'distributedPoint' | 'maxStake'>> & CalculatedSpoolData & SpoolRewardPool;
2738
+ type OriginSpoolData = {
2739
+ stakeType: {
2740
+ fields: {
2741
+ name: string;
2742
+ };
2743
+ };
2744
+ maxDistributedPoint: string;
2745
+ distributedPoint: string;
2746
+ distributedPointPerPeriod: string;
2747
+ pointDistributionTime: string;
2748
+ maxStake: string;
2749
+ stakes: string;
2750
+ index: string;
2751
+ createdAt: string;
2752
+ lastUpdate: string;
2753
+ };
2754
+ type SpoolData = {
2755
+ created_at: string;
2756
+ distributed_point: string;
2757
+ distributed_point_per_period: string;
2758
+ id: {
2759
+ id: string;
2760
+ };
2761
+ index: string;
2762
+ last_update: string;
2763
+ max_distributed_point: string;
2764
+ max_stakes: string;
2765
+ point_distribution_time: string;
2766
+ stake_type: {
2767
+ type: string;
2768
+ fields: {
2769
+ name: string;
2770
+ };
2771
+ };
2772
+ stakes: string;
2773
+ };
2774
+ type ParsedSpoolData = {
2775
+ stakeType: string;
2776
+ maxPoint: number;
2777
+ distributedPoint: number;
2778
+ pointPerPeriod: number;
2779
+ period: number;
2780
+ maxStake: number;
2781
+ staked: number;
2782
+ index: number;
2783
+ createdAt: number;
2784
+ lastUpdate: number;
2785
+ };
2786
+ type CalculatedSpoolData = {
2787
+ stakedAmount: number;
2788
+ stakedCoin: number;
2789
+ stakedValue: number;
2790
+ distributedPointPerSec: number;
2791
+ accumulatedPoints: number;
2792
+ currentPointIndex: number;
2793
+ currentTotalDistributedPoint: number;
2794
+ startDate: Date;
2795
+ endDate: Date;
2796
+ };
2797
+ type SpoolRewardPool = Required<Pick<ParsedSpoolRewardPoolData, 'exchangeRateNumerator' | 'exchangeRateDenominator'>> & CalculatedSpoolRewardPoolData;
2798
+ type OriginSpoolRewardPoolData = {
2799
+ claimed_rewards: string;
2800
+ exchange_rate_denominator: string;
2801
+ exchange_rate_numerator: string;
2802
+ rewards: string;
2803
+ spool_id: string;
2804
+ };
2805
+ type ParsedSpoolRewardPoolData = {
2806
+ claimedRewards: number;
2807
+ exchangeRateDenominator: number;
2808
+ exchangeRateNumerator: number;
2809
+ rewards: number;
2810
+ spoolId: string;
2811
+ };
2812
+ type CalculatedSpoolRewardPoolData = {
2813
+ rewardApr: number;
2814
+ totalRewardAmount: number;
2815
+ totalRewardCoin: number;
2816
+ totalRewardValue: number;
2817
+ remaindRewardAmount: number;
2818
+ remaindRewardCoin: number;
2819
+ remaindRewardValue: number;
2820
+ claimedRewardAmount: number;
2821
+ claimedRewardCoin: number;
2822
+ claimedRewardValue: number;
2823
+ rewardPerSec: number;
2824
+ };
2825
+ type StakePools = OptionalKeys$2<Record<string, StakePool>>;
2826
+ type StakeRewardPools = OptionalKeys$2<Record<string, StakeRewardPool>>;
2827
+ type StakeAccounts = Record<string, StakeAccount[]>;
2828
+ interface StakeAccount {
2829
+ id: string;
2830
+ type: string;
2831
+ stakePoolId: string;
2832
+ stakeType: string;
2833
+ staked: number;
2834
+ index: number;
2835
+ points: number;
2836
+ totalPoints: number;
2837
+ }
2838
+ interface StakePool {
2839
+ id: string;
2840
+ type: string;
2841
+ maxPoint: number;
2842
+ distributedPoint: number;
2843
+ pointPerPeriod: number;
2844
+ period: number;
2845
+ maxStake: number;
2846
+ stakeType: string;
2847
+ totalStaked: number;
2848
+ index: number;
2849
+ createdAt: number;
2850
+ lastUpdate: number;
2851
+ }
2852
+ interface StakeRewardPool {
2853
+ id: string;
2854
+ type: string;
2855
+ stakePoolId: string;
2856
+ ratioDenominator: number;
2857
+ ratioNumerator: number;
2858
+ rewards: number;
2859
+ claimedRewards: number;
2860
+ }
2861
+
2862
+ type OptionalKeys$1<T> = {
2863
+ [K in keyof T]?: T[K];
2864
+ };
2865
+ type Lendings = OptionalKeys$1<Record<string, Lending>>;
2866
+ type ObligationAccounts = OptionalKeys$1<Record<string, ObligationAccount>>;
2867
+ type Lending = Required<Pick<MarketPool, 'coinName' | 'symbol' | 'coinType' | 'marketCoinType' | 'sCoinType' | 'coinDecimal' | 'coinPrice' | 'conversionRate' | 'isIsolated'> & Pick<Spool, 'marketCoinPrice'>> & {
2868
+ supplyApr: number;
2869
+ supplyApy: number;
2870
+ rewardApr: number;
2871
+ suppliedAmount: number;
2872
+ suppliedCoin: number;
2873
+ suppliedValue: number;
2874
+ stakedMarketAmount: number;
2875
+ stakedMarketCoin: number;
2876
+ stakedAmount: number;
2877
+ stakedCoin: number;
2878
+ stakedValue: number;
2879
+ unstakedMarketAmount: number;
2880
+ unstakedMarketCoin: number;
2881
+ unstakedAmount: number;
2882
+ unstakedCoin: number;
2883
+ unstakedValue: number;
2884
+ availableSupplyAmount: number;
2885
+ availableSupplyCoin: number;
2886
+ availableWithdrawAmount: number;
2887
+ availableWithdrawCoin: number;
2888
+ availableStakeAmount: number;
2889
+ availableStakeCoin: number;
2890
+ availableUnstakeAmount: number;
2891
+ availableUnstakeCoin: number;
2892
+ availableClaimAmount: number;
2893
+ availableClaimCoin: number;
2894
+ };
2895
+ type ObligationAccount = {
2896
+ obligationId: string;
2897
+ totalDepositedValue: number;
2898
+ totalBorrowedValue: number;
2899
+ totalBalanceValue: number;
2900
+ totalBorrowCapacityValue: number;
2901
+ totalAvailableCollateralValue: number;
2902
+ totalBorrowedValueWithWeight: number;
2903
+ totalRequiredCollateralValue: number;
2904
+ totalUnhealthyCollateralValue: number;
2905
+ totalRiskLevel: number;
2906
+ totalDepositedPools: number;
2907
+ totalBorrowedPools: number;
2908
+ totalRewardedPools: number;
2909
+ collaterals: OptionalKeys$1<Record<string, ObligationCollateral>>;
2910
+ debts: OptionalKeys$1<Record<string, ObligationDebt>>;
2911
+ borrowIncentives: OptionalKeys$1<Record<string, ObligationBorrowIncentive>>;
2912
+ };
2913
+ type ObligationCollateral = {
2914
+ coinName: string;
2915
+ coinType: string;
2916
+ symbol: string;
2917
+ coinDecimal: number;
2918
+ coinPrice: number;
2919
+ depositedAmount: number;
2920
+ depositedCoin: number;
2921
+ depositedValue: number;
2922
+ borrowCapacityValue: number;
2923
+ requiredCollateralValue: number;
2924
+ availableDepositAmount: number;
2925
+ availableDepositCoin: number;
2926
+ availableWithdrawAmount: number;
2927
+ availableWithdrawCoin: number;
2928
+ };
2929
+ type ObligationDebt = {
2930
+ coinName: string;
2931
+ coinType: string;
2932
+ symbol: string;
2933
+ coinDecimal: number;
2934
+ coinPrice: number;
2935
+ borrowedAmount: number;
2936
+ borrowedCoin: number;
2937
+ borrowedValue: number;
2938
+ borrowedValueWithWeight: number;
2939
+ borrowIndex: number;
2940
+ requiredRepayAmount: number;
2941
+ requiredRepayCoin: number;
2942
+ availableBorrowAmount: number;
2943
+ availableBorrowCoin: number;
2944
+ availableRepayAmount: number;
2945
+ availableRepayCoin: number;
2946
+ };
2947
+ type ObligationBorrowIncentiveReward = {
2948
+ coinName: string;
2949
+ coinType: string;
2950
+ symbol: string;
2951
+ coinDecimal: number;
2952
+ coinPrice: number;
2953
+ weightedBorrowAmount: number;
2954
+ availableClaimCoin: number;
2955
+ availableClaimAmount: number;
2956
+ boostValue: number;
2957
+ };
2958
+ type ObligationBorrowIncentive = {
2959
+ coinName: string;
2960
+ coinType: string;
2961
+ symbol: string;
2962
+ coinDecimal: number;
2963
+ coinPrice: number;
2964
+ rewards: ObligationBorrowIncentiveReward[];
2965
+ };
2966
+ type TotalValueLocked = {
2967
+ supplyLendingValue: number;
2968
+ supplyCollateralValue: number;
2969
+ supplyValue: number;
2970
+ borrowValue: number;
2971
+ totalValue: number;
2972
+ supplyValueChangeRatio?: number;
2973
+ supplyLendingValueChangeRatio?: number;
2974
+ supplyCollateralValueChangeRatio?: number;
2975
+ borrowValueChangeRatio?: number;
2976
+ totalValueChangeRatio?: number;
2977
+ };
2978
+
2979
+ type sCoinBalance = number;
2980
+
2981
+ type Vesca = {
2982
+ id: string;
2983
+ keyId: string;
2984
+ keyObject?: SuiObjectRef$1;
2985
+ object: SuiObjectRef$1;
2986
+ lockedScaAmount: string;
2987
+ lockedScaCoin: number;
2988
+ currentVeScaBalance: number;
2989
+ unlockAt: number;
2990
+ };
2991
+ type VeScaTreasuryFields = {
2992
+ total_ve_sca_amount: string;
2993
+ sca_balance: string;
2994
+ unlock_schedule: {
2995
+ fields: {
2996
+ locked_sca_amount: string;
2997
+ };
2998
+ };
2999
+ };
3000
+ type VeScaTreasuryInfo = {
3001
+ totalLockedSca: number;
3002
+ totalVeSca: number;
3003
+ averageLockingPeriod: number;
3004
+ averageLockingPeriodUnit: string;
3005
+ };
3006
+
3007
+ interface AddressesInterface {
3008
+ id?: string;
3009
+ core: {
3010
+ version: string;
3011
+ versionCap: string;
3012
+ object: string;
3013
+ market: string;
3014
+ adminCap: string;
3015
+ coinDecimalsRegistry: string;
3016
+ obligationAccessStore: string;
3017
+ coins: Partial<Record<string, {
3018
+ id: string;
3019
+ treasury: string;
3020
+ metaData: string;
3021
+ coinType: string;
3022
+ symbol: string;
3023
+ decimals: number;
3024
+ oracle: {
3025
+ [K in SupportOracleType]: K extends (typeof _SUPPORT_ORACLES)[0] ? string : K extends (typeof _SUPPORT_ORACLES)[1] ? string : K extends (typeof _SUPPORT_ORACLES)[2] ? {
3026
+ feed: string;
3027
+ feedObject: string;
3028
+ } : never;
3029
+ };
3030
+ }>>;
3031
+ oracles: {
3032
+ [K in SupportOracleType]: K extends (typeof _SUPPORT_ORACLES)[0] ? {
3033
+ registry: string;
3034
+ registryCap: string;
3035
+ holder: string;
3036
+ } : K extends (typeof _SUPPORT_ORACLES)[1] ? {
3037
+ registry: string;
3038
+ registryCap: string;
3039
+ registryTableId: string;
3040
+ state: string;
3041
+ } : K extends (typeof _SUPPORT_ORACLES)[2] ? {
3042
+ registry: string;
3043
+ registryCap: string;
3044
+ state: string;
3045
+ wormhole: string;
3046
+ wormholeState: string;
3047
+ } : never;
3048
+ } & {
3049
+ xOracle: string;
3050
+ xOracleCap: string;
3051
+ primaryPriceUpdatePolicyObject: string;
3052
+ secondaryPriceUpdatePolicyObject: string;
3053
+ primaryPriceUpdatePolicyVecsetId: string;
3054
+ secondaryPriceUpdatePolicyVecsetId: string;
3055
+ };
3056
+ packages: Partial<Record<string, {
3057
+ id: string;
3058
+ object?: string;
3059
+ upgradeCap: string;
3060
+ }>>;
3061
+ };
3062
+ spool: {
3063
+ id: string;
3064
+ adminCap: string;
3065
+ object: string;
3066
+ config: string;
3067
+ pools: Partial<Record<string, {
3068
+ id: string;
3069
+ rewardPoolId: string;
3070
+ }>>;
3071
+ };
3072
+ borrowIncentive: {
3073
+ id: string;
3074
+ adminCap: string;
3075
+ object: string;
3076
+ query: string;
3077
+ config: string;
3078
+ incentivePools: string;
3079
+ incentiveAccounts: string;
3080
+ };
3081
+ vesca: {
3082
+ id: string;
3083
+ object: string;
3084
+ adminCap: string;
3085
+ tableId: string;
3086
+ table: string;
3087
+ treasury: string;
3088
+ config: string;
3089
+ subsTable: string;
3090
+ subsTableId: string;
3091
+ subsWhitelist: string;
3092
+ };
3093
+ referral: {
3094
+ id: string;
3095
+ version: string;
3096
+ object: string;
3097
+ adminCap: string;
3098
+ referralBindings: string;
3099
+ bindingTableId: string;
3100
+ referralRevenuePool: string;
3101
+ revenueTableId: string;
3102
+ referralTiers: string;
3103
+ tiersTableId: string;
3104
+ authorizedWitnessList: string;
3105
+ };
3106
+ loyaltyProgram: {
3107
+ id: string;
3108
+ adminCap?: string;
3109
+ object: string;
3110
+ rewardPool: string;
3111
+ userRewardTableId: string;
3112
+ };
3113
+ veScaLoyaltyProgram: {
3114
+ id: string;
3115
+ adminCap?: string;
3116
+ object: string;
3117
+ veScaRewardPool: string;
3118
+ veScaRewardTableId: string;
3119
+ };
3120
+ scoin: {
3121
+ id: string;
3122
+ coins: Partial<Record<string, {
3123
+ coinType: string;
3124
+ symbol: string;
3125
+ treasury: string;
3126
+ metaData: string;
3127
+ }>>;
3128
+ };
3216
3129
  }
3130
+ type AddressPathsProps<T> = T extends string ? [] : {
3131
+ [K in Extract<keyof T, string>]: [K, ...AddressPathsProps<T[K]>];
3132
+ }[Extract<keyof T, string>];
3133
+ type Join<T extends string[], D extends string> = T extends [] ? never : T extends [infer F] ? F : T extends [infer F, ...infer R] ? F extends string ? `${F}${D}${Join<Extract<R, string[]>, D>}` : never : string;
3134
+ type AddressStringPath = Join<AddressPathsProps<AddressesInterface>, '.'>;
3217
3135
 
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
- }
3136
+ type OptionalKeys<T> = {
3137
+ [K in keyof T]?: T[K];
3138
+ };
3139
+ type CoinPrices = OptionalKeys<Record<string, number>>;
3140
+
3141
+ declare const TEST_ADDRESSES: AddressesInterface;
3142
+ declare const WHITELIST: {
3143
+ lending: Set<string>;
3144
+ collateral: Set<string>;
3145
+ borrowing: Set<string>;
3146
+ packages: Set<string>;
3147
+ spool: Set<string>;
3148
+ scoin: Set<string>;
3149
+ suiBridge: Set<string>;
3150
+ wormhole: Set<string>;
3151
+ oracles: Set<string>;
3152
+ pythEndpoints: Set<string>;
3153
+ deprecated: Set<string>;
3154
+ borrowIncentiveRewards: Set<string>;
3155
+ rewardsAsPoint: Set<string>;
3156
+ emerging: Set<string>;
3157
+ };
3158
+ declare const POOL_ADDRESSES: {
3159
+ usdc: {
3160
+ coinName: string;
3161
+ symbol: string;
3162
+ lendingPoolAddress: string;
3163
+ collateralPoolAddress: string;
3164
+ borrowDynamic: string;
3165
+ interestModel: string;
3166
+ riskModel: string;
3167
+ borrowFeeKey: string;
3168
+ supplyLimitKey: string;
3169
+ borrowLimitKey: string;
3170
+ isolatedAssetKey: string;
3171
+ isIsolated: boolean;
3172
+ spool: string;
3173
+ spoolReward: string;
3174
+ sCoinType: string;
3175
+ sCoinTreasury: string;
3176
+ sCoinMetadataId: string;
3177
+ sCoinSymbol: string;
3178
+ sCoinName: string;
3179
+ coinMetadataId: string;
3180
+ coinType: string;
3181
+ spoolName: string;
3182
+ decimals: number;
3183
+ pythFeed: string;
3184
+ pythFeedObjectId: string;
3185
+ flashloanFeeObject: string;
3186
+ };
3187
+ sui: {
3188
+ coinName: string;
3189
+ symbol: string;
3190
+ lendingPoolAddress: string;
3191
+ collateralPoolAddress: string;
3192
+ borrowDynamic: string;
3193
+ interestModel: string;
3194
+ riskModel: string;
3195
+ borrowFeeKey: string;
3196
+ supplyLimitKey: string;
3197
+ borrowLimitKey: string;
3198
+ isolatedAssetKey: string;
3199
+ isIsolated: boolean;
3200
+ spool: string;
3201
+ spoolReward: string;
3202
+ sCoinType: string;
3203
+ sCoinTreasury: string;
3204
+ sCoinMetadataId: string;
3205
+ sCoinSymbol: string;
3206
+ sCoinName: string;
3207
+ coinMetadataId: string;
3208
+ coinType: string;
3209
+ spoolName: string;
3210
+ decimals: number;
3211
+ pythFeed: string;
3212
+ pythFeedObjectId: string;
3213
+ flashloanFeeObject: string;
3214
+ };
3215
+ sca: {
3216
+ coinName: string;
3217
+ symbol: string;
3218
+ lendingPoolAddress: string;
3219
+ collateralPoolAddress: string;
3220
+ borrowDynamic: string;
3221
+ interestModel: string;
3222
+ riskModel: string;
3223
+ borrowFeeKey: string;
3224
+ supplyLimitKey: string;
3225
+ borrowLimitKey: string;
3226
+ isolatedAssetKey: string;
3227
+ isIsolated: boolean;
3228
+ spool: string;
3229
+ spoolReward: string;
3230
+ sCoinType: string;
3231
+ sCoinTreasury: string;
3232
+ sCoinMetadataId: string;
3233
+ sCoinSymbol: string;
3234
+ sCoinName: string;
3235
+ coinMetadataId: string;
3236
+ coinType: string;
3237
+ spoolName: string;
3238
+ decimals: number;
3239
+ pythFeed: string;
3240
+ pythFeedObjectId: string;
3241
+ flashloanFeeObject: string;
3242
+ };
3243
+ fud: {
3244
+ coinName: string;
3245
+ symbol: string;
3246
+ lendingPoolAddress: string;
3247
+ collateralPoolAddress: string;
3248
+ borrowDynamic: string;
3249
+ interestModel: string;
3250
+ borrowFeeKey: string;
3251
+ supplyLimitKey: string;
3252
+ borrowLimitKey: string;
3253
+ isolatedAssetKey: string;
3254
+ isIsolated: boolean;
3255
+ spool: string;
3256
+ spoolReward: string;
3257
+ sCoinType: string;
3258
+ sCoinTreasury: string;
3259
+ sCoinMetadataId: string;
3260
+ sCoinSymbol: string;
3261
+ sCoinName: string;
3262
+ coinMetadataId: string;
3263
+ coinType: string;
3264
+ spoolName: string;
3265
+ decimals: number;
3266
+ pythFeed: string;
3267
+ pythFeedObjectId: string;
3268
+ flashloanFeeObject: string;
3269
+ };
3270
+ deep: {
3271
+ coinName: string;
3272
+ symbol: string;
3273
+ lendingPoolAddress: string;
3274
+ collateralPoolAddress: string;
3275
+ borrowDynamic: string;
3276
+ interestModel: string;
3277
+ borrowFeeKey: string;
3278
+ supplyLimitKey: string;
3279
+ borrowLimitKey: string;
3280
+ isolatedAssetKey: string;
3281
+ isIsolated: boolean;
3282
+ spool: string;
3283
+ spoolReward: string;
3284
+ sCoinType: string;
3285
+ sCoinTreasury: string;
3286
+ sCoinMetadataId: string;
3287
+ sCoinSymbol: string;
3288
+ sCoinName: string;
3289
+ coinMetadataId: string;
3290
+ coinType: string;
3291
+ spoolName: string;
3292
+ decimals: number;
3293
+ pythFeed: string;
3294
+ pythFeedObjectId: string;
3295
+ flashloanFeeObject: string;
3296
+ };
3297
+ };
3298
+
3299
+ declare const UNLOCK_ROUND_DURATION: number;
3300
+ declare const MAX_LOCK_ROUNDS: 1460;
3301
+ declare const MAX_LOCK_DURATION: number;
3302
+ declare const MIN_INITIAL_LOCK_AMOUNT: 10000000000;
3303
+ declare const MIN_TOP_UP_AMOUNT: 1000000000;
3304
+
3305
+ declare const xOracleList: xOracleListType;
3278
3306
 
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 };
3307
+ export { API_BASE_URL, type AddressStringPath, type AddressesInterface, type AssetCoinIds, type AssetCoins, type BalanceSheet, type BaseScallopTxBlock, type BorrowDynamic, type BorrowFee, type BorrowIncentiveAccountKey, type BorrowIncentiveAccounts, type BorrowIncentiveAccountsQueryInterface, type BorrowIncentiveIds, type BorrowIncentiveNormalMethods, type BorrowIncentivePool, type BorrowIncentivePoolPoints, type BorrowIncentivePools, type BorrowIncentivePoolsQueryInterface, type BorrowIncentiveQuickMethods, type BorrowIncentiveRewardCoins, type BorrowIncentiveTxBlock, type CalculatedBorrowIncentivePoolPointData, type CalculatedMarketCollateralData, type CalculatedMarketPoolData, type CalculatedSpoolData, type CalculatedSpoolRewardPoolData, type CoinAmounts, type CoinPrices, type CoinWrappedType, type Coins, type CollateralStat, type CoreIds, type CoreNormalMethods, type CoreQuickMethods, type CoreTxBlock, DEFAULT_CACHE_OPTIONS, type GenerateBorrowIncentiveNormalMethod, type GenerateBorrowIncentiveQuickMethod, type GenerateCoreNormalMethod, type GenerateCoreQuickMethod, type GenerateLoyaltyProgramNormalMethod, type GenerateLoyaltyProgramQuickMethod, type GenerateSCoinNormalMethod, type GenerateSCoinQuickMethod, type GenerateSpoolNormalMethod, type GenerateSpoolQuickMethod, type GenerateVeScaNormalMethod, type GenerateVeScaQuickMethod, IS_VE_SCA_TEST, type InterestModel, type Lending, type Lendings, type LoyaltyProgramInfo, type LoyaltyProgramNormalMethods, type LoyaltyProgramQuickMethods, type LoyaltyProgramTxBlock, MAX_LOCK_DURATION, MAX_LOCK_ROUNDS, MIN_INITIAL_LOCK_AMOUNT, MIN_TOP_UP_AMOUNT, type Market, type MarketCoinAmounts, type MarketCoins, type MarketCollateral, type MarketCollaterals, type MarketPool, type MarketPools, type MarketQueryInterface, type NestedResult, OLD_BORROW_INCENTIVE_PROTOCOL_ID, type Obligation, type ObligationAccount, type ObligationAccounts, type ObligationBorrowIncentive, type ObligationBorrowIncentiveReward, type ObligationCollateral, type ObligationDebt, type ObligationQueryInterface, type OptionalKeys, type OriginBorrowIncentiveAccountData, type OriginBorrowIncentiveAccountPoolData, type OriginBorrowIncentivePoolData, type OriginBorrowIncentivePoolPointData, type OriginMarketCollateralData, type OriginMarketPoolData, type OriginSpoolData, type OriginSpoolRewardPoolData, POOL_ADDRESSES, type ParsedBorrowIncentiveAccountData, type ParsedBorrowIncentiveAccountPoolData, type ParsedBorrowIncentivePoolData, type ParsedBorrowIncentivePoolPointData, type ParsedMarketCollateralData, type ParsedMarketPoolData, type ParsedSpoolData, type ParsedSpoolRewardPoolData, type PoolAddress, type QuickMethodReturnType, RPC_PROVIDERS, type RiskModel, SCA_COIN_TYPE, type SCoinAmounts, type SCoinConverterTreasury, type SCoinIds, type SCoinTreasuryCaps, type SCoinTxBlock, type SCoins, SDK_API_BASE_URL, Scallop, ScallopAddress, ScallopBuilder, ScallopClient, ScallopConstants, ScallopIndexer, ScallopQuery, ScallopSuiKit, type ScallopTxBlock, ScallopUtils, type Spool, type SpoolData, type SpoolIds, type SpoolNormalMethods, type SpoolQuickMethods, type SpoolRewardPool, type SpoolTxBlock, type Spools, type StakeAccount, type StakeAccounts, type StakeMarketCoins, type StakePool, type StakePools, type StakeRewardCoins, type StakeRewardPool, type StakeRewardPools, type SuiBridgeCoins, type SuiBridgedCoinPackageIds, type SuiTxBlockWithBorrowIncentiveNormalMethods, type SuiTxBlockWithCoreNormalMethods, type SuiTxBlockWithLoyaltyProgramNormalMethods, type SuiTxBlockWithSCoin, type SuiTxBlockWithSCoinNormalMethods, type SuiTxBlockWithSpool, type SuiTxBlockWithSpoolNormalMethods, type SuiTxBlockWithVeScaNormalMethods, type SupportOracleType, TEST_ADDRESSES, type TotalValueLocked, UNLOCK_ROUND_DURATION, USE_TEST_ADDRESS, type VeScaLoyaltyProgramInfo, type VeScaNormalMethods, type VeScaQuickMethods, type VeScaTreasuryFields, type VeScaTreasuryInfo, type VeScaTxBlock, type Vesca, type VoloCoinIds, WHITELIST, type Whitelist, type WormholeCoinIds, _SUPPORT_ORACLES, queryKeys, type sCoinBalance, type sCoinNormalMethods, type sCoinPkgIds, type sCoinQuickMethods, xOracleList, type xOracleListType, type xOracleRuleType, type xOracleRules };