@scallop-io/sui-scallop-sdk 2.0.13-merge-split-ve-sca-alpha.4 → 2.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/index.d.mts +622 -697
  2. package/dist/index.d.ts +622 -697
  3. package/dist/index.js +32 -33
  4. package/dist/index.mjs +10 -10
  5. package/package.json +8 -18
  6. package/src/builders/borrowIncentiveBuilder.ts +8 -18
  7. package/src/builders/coreBuilder.ts +2 -2
  8. package/src/builders/index.ts +2 -2
  9. package/src/builders/oracles/index.ts +2 -3
  10. package/src/builders/oracles/pyth.ts +2 -2
  11. package/src/builders/spoolBuilder.ts +2 -2
  12. package/src/builders/vescaBuilder.ts +14 -132
  13. package/src/constants/queryKeys.ts +29 -54
  14. package/src/constants/testAddress.ts +6 -12
  15. package/src/index.ts +11 -1
  16. package/src/models/index.ts +11 -9
  17. package/src/models/interface.ts +36 -0
  18. package/src/models/scallop.ts +38 -133
  19. package/src/models/scallopAddress.ts +127 -142
  20. package/src/models/scallopAxios.ts +185 -0
  21. package/src/models/scallopBuilder.ts +45 -75
  22. package/src/models/scallopClient.ts +124 -154
  23. package/src/models/scallopConstants.ts +248 -323
  24. package/src/models/scallopIndexer.ts +54 -98
  25. package/src/models/scallopQuery.ts +145 -190
  26. package/src/models/scallopQueryClient.ts +29 -0
  27. package/src/models/scallopSuiKit.ts +432 -0
  28. package/src/models/scallopUtils.ts +260 -164
  29. package/src/queries/borrowIncentiveQuery.ts +28 -16
  30. package/src/queries/borrowLimitQuery.ts +1 -1
  31. package/src/queries/coreQuery.ts +148 -107
  32. package/src/queries/flashloanFeeQuery.ts +12 -6
  33. package/src/queries/index.ts +0 -1
  34. package/src/queries/isolatedAssetQuery.ts +3 -3
  35. package/src/queries/loyaltyProgramQuery.ts +10 -8
  36. package/src/queries/ownerQuery.ts +32 -0
  37. package/src/queries/portfolioQuery.ts +4 -5
  38. package/src/queries/priceQuery.ts +14 -8
  39. package/src/queries/referralQuery.ts +9 -3
  40. package/src/queries/sCoinQuery.ts +4 -4
  41. package/src/queries/spoolQuery.ts +11 -11
  42. package/src/queries/supplyLimitQuery.ts +1 -1
  43. package/src/queries/switchboardQuery.ts +1 -1
  44. package/src/queries/vescaQuery.ts +31 -27
  45. package/src/queries/xOracleQuery.ts +13 -8
  46. package/src/types/address.ts +0 -3
  47. package/src/types/builder/core.ts +1 -1
  48. package/src/types/builder/vesca.ts +10 -20
  49. package/src/types/constant/queryKeys.ts +48 -0
  50. package/src/types/index.ts +0 -1
  51. package/src/utils/builder.ts +1 -1
  52. package/src/utils/util.ts +1 -33
  53. package/src/models/scallopCache.ts +0 -428
  54. package/src/queries/objectsQuery.ts +0 -18
  55. package/src/types/model.ts +0 -117
package/dist/index.d.mts CHANGED
@@ -1,11 +1,12 @@
1
- import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, DevInspectResults, SuiObjectResponse, DynamicFieldPage, CoinBalance, GetBalanceParams, SuiObjectRef, SuiTransactionBlockResponse } from '@mysten/sui/client';
2
- import * as _scallop_io_sui_kit from '@scallop-io/sui-kit';
3
- import { SuiObjectArg, SuiTxArg, SuiKit, NetworkType, SuiTxBlock, SuiVecTxArg, SuiAmountsArg, SuiAddressArg, TransactionResult as TransactionResult$1, SuiKitParams } from '@scallop-io/sui-kit';
4
1
  import * as _mysten_sui_dist_cjs_client from '@mysten/sui/dist/cjs/client';
2
+ import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectRef } from '@mysten/sui/dist/cjs/client';
3
+ import * as _scallop_io_sui_kit 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
- import { QueryClient, QueryClientConfig } from '@tanstack/query-core';
7
- import { Transaction, TransactionObjectArgument, Argument, TransactionResult } from '@mysten/sui/transactions';
8
- import { AxiosInstance } from 'axios';
6
+ import { QueryClient, QueryClientConfig, QueryKey } from '@tanstack/query-core';
7
+ import { AxiosInstance, AxiosResponse, AxiosRequestConfig } from 'axios';
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';
9
10
 
10
11
  /**
11
12
  * Default cache options for the QueryClient.
@@ -29,11 +30,48 @@ declare const USE_TEST_ADDRESS: boolean;
29
30
  declare const SCA_COIN_TYPE: "0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA" | "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
30
31
  declare const OLD_BORROW_INCENTIVE_PROTOCOL_ID: "0xc63072e7f5f4983a2efaf5bdba1480d5e7d74d57948e1c7cc436f8e22cbeb410";
31
32
 
33
+ declare namespace QueryKeys {
34
+ namespace API {
35
+ type GetAddresses = {
36
+ addressId?: string;
37
+ };
38
+ }
39
+ namespace RPC {
40
+ type BaseType = {
41
+ node?: string;
42
+ };
43
+ export type GetInspectTxn = BaseType & {
44
+ queryTarget?: string;
45
+ args?: SuiObjectArg[];
46
+ typeArgs?: any[];
47
+ };
48
+ export type GetObject = BaseType & {
49
+ objectId?: string;
50
+ options?: SuiObjectDataOptions;
51
+ };
52
+ export type GetObjects = BaseType & {
53
+ objectIds?: string[];
54
+ };
55
+ export type GetOwnedObjects = BaseType & Partial<GetOwnedObjectsParams>;
56
+ export type GetDynamicFields = BaseType & Partial<GetDynamicFieldsParams>;
57
+ export type GetDynamicFieldObject = BaseType & Partial<GetDynamicFieldObjectParams>;
58
+ export type getTotalVeScaTreasuryAmount = BaseType & {
59
+ refreshArgs?: any[];
60
+ vescaAmountArgs?: (string | SuiObjectData | SuiTxArg)[];
61
+ };
62
+ export type GetAllCoinBalances = BaseType & {
63
+ activeAddress?: string;
64
+ };
65
+ export type GetNormalizedMoveFunction = BaseType & {
66
+ target?: string;
67
+ };
68
+ export { };
69
+ }
70
+ }
71
+
32
72
  declare const queryKeys: {
33
73
  api: {
34
- getAddresses: (addressId?: string) => (string | {
35
- addressId: string | undefined;
36
- })[];
74
+ getAddresses: (props?: QueryKeys.API.GetAddresses) => (string | QueryKeys.API.GetAddresses | undefined)[];
37
75
  getWhiteList: () => string[];
38
76
  getPoolAddresses: () => string[];
39
77
  getMarket: () => string[];
@@ -42,42 +80,27 @@ declare const queryKeys: {
42
80
  getTotalValueLocked: () => string[];
43
81
  };
44
82
  rpc: {
45
- getInspectTxn: (queryTarget?: string, args?: SuiObjectArg[], typeArgs?: any[]) => (string | {
46
- queryTarget: string | undefined;
47
- args: string;
48
- typeArgs: string | undefined;
49
- })[];
50
- getObject: (objectId?: string, options?: SuiObjectDataOptions) => (string | {
51
- objectId: string | undefined;
52
- options: SuiObjectDataOptions | undefined;
53
- })[];
54
- getObjects: (objectIds?: string[]) => (string | {
55
- objectIds: string;
56
- })[];
57
- getOwnedObjects: (input?: Partial<GetOwnedObjectsParams>) => (string | {
58
- walletAddress: string | undefined;
59
- cursor: string | undefined;
60
- options: SuiObjectDataOptions | undefined;
83
+ getInspectTxn: (props?: QueryKeys.RPC.GetInspectTxn) => (string | QueryKeys.RPC.GetInspectTxn | undefined)[];
84
+ getObject: (props?: QueryKeys.RPC.GetObject) => (string | QueryKeys.RPC.GetObject | undefined)[];
85
+ getObjects: (props?: QueryKeys.RPC.GetObjects) => (string | QueryKeys.RPC.GetObjects | undefined)[];
86
+ getOwnedObjects: (props?: QueryKeys.RPC.GetOwnedObjects) => (string | {
61
87
  filter: string;
62
- limit: number | undefined;
88
+ node?: string;
89
+ owner?: string | undefined;
90
+ cursor?: string | null | undefined;
91
+ limit?: number | null | undefined;
92
+ signal?: AbortSignal;
93
+ options?: _mysten_sui_dist_cjs_client.SuiObjectDataOptions | null;
63
94
  })[];
64
- getDynamicFields: (input?: Partial<GetDynamicFieldsParams>) => (string | {
65
- parentId: string | undefined;
66
- cursor: string | undefined;
67
- limit: number | undefined;
95
+ getDynamicFields: (props?: QueryKeys.RPC.GetDynamicFields) => (string | QueryKeys.RPC.GetDynamicFields | undefined)[];
96
+ getDynamicFieldObject: (props?: QueryKeys.RPC.GetDynamicFieldObject) => (string | QueryKeys.RPC.GetDynamicFieldObject | undefined)[];
97
+ getTotalVeScaTreasuryAmount: (props?: QueryKeys.RPC.getTotalVeScaTreasuryAmount) => (string | {
98
+ refreshArgs: string | undefined;
99
+ vescaAmountArgs: string | undefined;
100
+ node?: string;
68
101
  })[];
69
- getDynamicFieldObject: (input?: Partial<GetDynamicFieldObjectParams>) => (string | {
70
- parentId: string | undefined;
71
- name: string;
72
- })[];
73
- getTotalVeScaTreasuryAmount: (refreshArgs?: any[], vescaAmountArgs?: (string | SuiObjectData | SuiTxArg)[]) => (string | {
74
- refreshArgs: string;
75
- vescaAmountArgs: string;
76
- })[];
77
- getAllCoinBalances: (owner?: string) => (string | {
78
- owner: string | undefined;
79
- })[];
80
- getNormalizedMoveFunction: (target?: string) => (string | undefined)[];
102
+ getAllCoinBalances: (props?: QueryKeys.RPC.GetAllCoinBalances) => (string | QueryKeys.RPC.GetAllCoinBalances | undefined)[];
103
+ getNormalizedMoveFunction: (props?: QueryKeys.RPC.GetNormalizedMoveFunction) => (string | QueryKeys.RPC.GetNormalizedMoveFunction | undefined)[];
81
104
  };
82
105
  oracle: {
83
106
  getPythLatestPriceFeeds: () => string[];
@@ -86,102 +109,62 @@ declare const queryKeys: {
86
109
 
87
110
  declare const RPC_PROVIDERS: string[];
88
111
 
89
- type QueryInspectTxnParams = {
90
- queryTarget: string;
91
- args: SuiObjectArg[];
92
- typeArgs?: any[];
93
- };
94
- declare class RateLimiter {
95
- private readonly capacity;
96
- private tokens;
97
- private lastRefillTime;
98
- private readonly refillRate;
99
- constructor(capacity?: number);
100
- private refill;
101
- private getTimeToNextToken;
102
- acquireToken(): Promise<void>;
103
- execute<T>(fn: () => Promise<T>): Promise<T>;
112
+ type ScallopQueryClientParams = {
113
+ queryClient?: QueryClient;
114
+ queryClientConfig?: QueryClientConfig;
115
+ };
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;
126
+ };
127
+ };
128
+ };
104
129
  }
105
- /**
106
- * @description
107
- * It provides caching for moveCall, RPC Request, and API Request.
108
- *
109
- *
110
- * @example
111
- * ```typescript
112
- * const scallopCache = new scallopCache(<parameters>);
113
- * scallopCache.<indexer functions>();
114
- * await scallopCache.<indexer async functions>();
115
- * ```
116
- */
117
- declare class ScallopCache {
118
- readonly params: ScallopCacheParams;
119
- queryClient: QueryClient;
120
- suiKit: SuiKit;
121
- walletAddress: string;
122
- private limiter;
123
- constructor(params?: ScallopCacheParams, instance?: ScallopCacheInstanceParams);
124
- private get client();
125
- /**
126
- * @description Provides cache for inspectTxn of the SuiKit.
127
- * @param QueryInspectTxnParams
128
- * @param txBlock
129
- * @returns Promise<DevInspectResults>
130
- */
131
- queryInspectTxn({ queryTarget, args, typeArgs, }: QueryInspectTxnParams): Promise<DevInspectResults | null>;
132
- private queryGetNormalizedMoveFunction;
133
- /**
134
- * @description Provides cache for getObject of the SuiKit.
135
- * @param objectId
136
- * @param QueryObjectParams
137
- * @returns Promise<SuiObjectResponse>
138
- */
139
- queryGetObject(objectId: string, options?: SuiObjectDataOptions): Promise<SuiObjectResponse>;
140
- /**
141
- * @description Provides cache for getObjects of the SuiKit.
142
- * @param objectIds
143
- * @returns Promise<SuiObjectData[]>
144
- */
145
- queryGetObjects(objectIds: string[]): Promise<SuiObjectData[]>;
146
- /**
147
- * @description Provides cache for getOwnedObjects of the SuiKit.
148
- * @param input
149
- * @returns Promise<PaginatedObjectsResponse>
150
- */
151
- queryGetOwnedObjects(input: GetOwnedObjectsParams): Promise<_mysten_sui_dist_cjs_client.PaginatedObjectsResponse>;
152
- queryGetDynamicFields(input: GetDynamicFieldsParams): Promise<DynamicFieldPage | null>;
153
- queryGetDynamicFieldObject(input: GetDynamicFieldObjectParams): Promise<SuiObjectResponse | null>;
154
- queryGetAllCoinBalances(owner: string): Promise<{
155
- [k: string]: CoinBalance;
156
- }>;
157
- queryGetCoinBalance(input: GetBalanceParams): Promise<CoinBalance | null>;
130
+
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>;
158
147
  }
159
148
 
160
- /**
161
- * @description
162
- * It provides methods for managing addresses.
163
- *
164
- * @example
165
- * ```typescript
166
- * const scallopAddress = new ScallopAddress(<parameters>);
167
- * scallopAddress.<address functions>();
168
- * await scallopAddress.<address async functions>();
169
- * ```
170
- */
149
+ type ScallopAddressParams = {
150
+ addressId?: string;
151
+ addressApiUrl?: string;
152
+ auth?: string;
153
+ network?: NetworkType;
154
+ forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
155
+ } & ScallopAxiosParams;
171
156
  declare class ScallopAddress {
172
- private readonly _auth?;
173
- private readonly _requestClient;
174
- private _id?;
175
- private _network;
176
- private _currentAddresses?;
177
- private _addressesMap;
178
- cache: ScallopCache;
179
- constructor(params: ScallopAddressParams, instance?: ScallopAddressInstanceParams);
180
- /**
181
- * Get addresses API id.
182
- *
183
- * @return The addresses API id.
184
- */
157
+ private currentAddresses?;
158
+ private addressId?;
159
+ private network;
160
+ private auth;
161
+ readonly scallopAxios: ScallopAxios;
162
+ private readonly addressMap;
163
+ private readonly defaultParamValues;
164
+ constructor(params?: ScallopAddressParams);
165
+ private initializeForcedAddresses;
166
+ get axiosClient(): ScallopAxios;
167
+ get queryClient(): _tanstack_query_core.QueryClient;
185
168
  getId(): string | undefined;
186
169
  /**
187
170
  * Get the address at the provided path.
@@ -305,346 +288,76 @@ declare class ScallopAddress {
305
288
  delete(id?: string, auth?: string): Promise<void>;
306
289
  }
307
290
 
291
+ type CoinName = string;
292
+ type CoinType = string;
293
+ type SCoinType = string;
294
+ type OldMarketCoinType = string;
308
295
  /**
309
- * @description
310
- * It provides methods to construct constants for Scallop SDK instances.
311
- *
312
- * @example
313
- * ```typescript
314
- * const scallopConstants = new ScallopConstants();
315
- * await scallopConstants.init();
316
- * ```
296
+ * @description `scallop_sui`, `scallop_usdt`, etc (parsed directly from coin type, ex: `0x...::scallop_sui::SCALLOP_SUI`)
317
297
  */
318
- declare class ScallopConstants {
319
- readonly params: ScallopConstantsParams;
320
- private readonly _requestClient;
321
- address: ScallopAddress;
322
- cache: ScallopCache;
323
- private _poolAddresses;
324
- private _whitelist;
325
- private _coinDecimals;
326
- private _coinNameToOldMarketCoinTypeMap;
327
- private _scoinRawNameToSCoinNameMap;
328
- private _scoinTypeToSCoinNameMap;
329
- private _wormholeCoinTypeToCoinNameMap;
330
- private _voloCoinTypeToCoinNameMap;
331
- private _suiBridgeCoinTypeToCoinNameMap;
332
- private _coinTypes;
333
- private _sCoinTypes;
334
- private _coinTypeToCoinNameMap;
335
- private _supportedBorrowIncentiveRewards;
336
- constructor(params: ScallopConstantsParams, instance?: ScallopConstantsInstanceParams);
337
- get isAddressInitialized(): boolean;
338
- get isInitialized(): boolean;
339
- get queryClient(): _tanstack_query_core.QueryClient;
340
- get poolAddresses(): Record<string, PoolAddress | undefined>;
341
- get whitelist(): Whitelist;
342
- parseToOldMarketCoin(coinType: string): string;
343
- get protocolObjectId(): string;
344
- /**
345
- * @description
346
- * Return maps of coin names to coin decimals.
347
- */
348
- get coinDecimals(): Record<string, number | undefined>;
349
- /**
350
- * @description
351
- * Return maps of coin names to coin types.
352
- */
353
- get coinTypes(): Record<string, string | undefined>;
354
- /**
355
- * @description
356
- * Return maps of coin types to its coin name
357
- */
358
- get coinTypeToCoinNameMap(): Record<string, string | undefined>;
359
- /**
360
- * @description
361
- * Return maps of wormhole coin types to its coin name.
362
- */
363
- get wormholeCoinTypeToCoinName(): Record<string, string | undefined>;
364
- /**
365
- * @description
366
- * Return maps of coin name to its old market coin type (...::reserve::MarketCoin<coinType>)
367
- */
368
- get coinNameToOldMarketCoinTypeMap(): Record<string, string | undefined>;
369
- /**
370
- * @description
371
- * Return maps of sCoin raw name from its type to its sCoin name. (e.g. 'scallop_sui' -> 'ssui')
372
- */
373
- get sCoinRawNameToScoinNameMap(): Record<string, string | undefined>;
374
- /**
375
- * @description
376
- * Return maps of scoin type to its sCoin name
377
- */
378
- get sCoinTypeToSCoinNameMap(): Record<string, string | undefined>;
379
- /**
380
- * @description
381
- * Return maps of volo coin type to its coin name
382
- */
383
- get voloCoinTypeToCoinNameMap(): Record<string, string | undefined>;
384
- /**
385
- * @description
386
- * Return maps of sui bridge coin type to its coin name
387
- */
388
- get suiBridgeCoinTypeToCoinNameMap(): Record<string, string | undefined>;
389
- /**
390
- * @description
391
- * Return maps of sCoin coin name to its coin type
392
- */
393
- get sCoinTypes(): Record<string, string | undefined>;
394
- /**
395
- * @description
396
- * Return set of supported coin types for borrow incentive rewards
397
- * (all supported pools + sCoins + custom coins from `whitelist.borrowIncentiveRewards`)
398
- */
399
- get supportedBorrowIncentiveRewards(): Set<string>;
400
- private isEmptyObject;
401
- private readApi;
402
- readWhiteList(): Promise<Whitelist>;
403
- readPoolAddresses(): Promise<Record<string, PoolAddress>>;
404
- init(params?: Partial<ScallopConstantsParams>): Promise<void>;
405
- }
406
-
298
+ type SCoinRawName = string;
407
299
  /**
408
- * @description
409
- * Integrates some helper functions frequently used in interactions with the Scallop contract.
410
- *
411
- * @example
412
- * ```typescript
413
- * const scallopUtils = new ScallopUtils(<parameters>);
414
- * await scallopUtils.init();
415
- * scallopUtils.<utils functions>();
416
- * await scallopUtils.<utils functions>();
417
- * ```
300
+ * @description `ssui`, `susdc`, etc..
418
301
  */
419
- declare class ScallopUtils {
420
- readonly params: ScallopUtilsParams;
421
- suiKit: SuiKit;
422
- address: ScallopAddress;
423
- cache: ScallopCache;
424
- constants: ScallopConstants;
425
- walletAddress: string;
426
- constructor(params: ScallopUtilsParams, instance?: ScallopUtilsInstanceParams);
427
- get whitelist(): Whitelist;
428
- isSuiBridgeAsset(coinName: any): boolean;
429
- isWormholeAsset(coinName: any): boolean;
430
- isMarketCoin(coinName: string): boolean;
431
- /**
432
- * Request the scallop API to initialize data.
433
- *
434
- * @param force - Whether to force initialization.
435
- * @param address - ScallopAddress instance.
436
- */
437
- init(force?: boolean): Promise<void>;
438
- /**
439
- * Convert coin name to symbol.
440
- *
441
- * @param coinName - Specific support coin name.
442
- * @return Symbol string.
443
- */
444
- parseSymbol(coinName: string): string;
445
- /**
446
- * Convert coin name to coin type.
447
- *
448
- * @description
449
- * The Coin type of wormhole is fixed `coin:Coin`. Here using package id
450
- * to determine and return the type.
451
- *
452
- * @param coinPackageId - Package id of coin.
453
- * @param coinName - Specific support coin name.
454
- * @return Coin type.
455
- */
456
- parseCoinType(coinName: string, useOldMarketCoin?: boolean): string;
457
- /**
458
- * Convert coin name to sCoin name.
459
- *
460
- * @param coinName - Specific support coin name.
461
- * @return sCoin name.
462
- */
463
- parseSCoinName<T extends string>(coinName: string): T | undefined;
464
- /**
465
- * Convert sCoin name to market coin name.
466
- * This function will parse new sCoin name `scallop_...` to its old market coin name which is shorter
467
- * e.g: `scallop_sui -> ssui
468
- * if no `scallop_...` is encountered, return coinName
469
- * @return sCoin name
470
- */
471
- parseSCoinTypeNameToMarketCoinName(coinName: string): string;
472
- /**
473
- * Convert sCoin name into sCoin type
474
- * @param sCoinName
475
- * @returns sCoin type
476
- */
477
- parseSCoinType(sCoinName: string): string;
478
- /**
479
- * Convert sCoinType into sCoin name
480
- * @param sCoinType
481
- * @returns sCoin name
482
- */
483
- parseSCoinNameFromType(sCoinType: string): string | undefined;
484
- /**
485
- * Convert sCoin name into its underlying coin type
486
- * @param sCoinName
487
- * @returns coin type
488
- */
489
- parseUnderlyingSCoinType(sCoinName: string): string;
490
- /**
491
- * Get sCoin treasury id from sCoin name
492
- * @param sCoinName
493
- * @returns sCoin treasury id
494
- */
495
- getSCoinTreasury(sCoinName: string): any;
496
- /**
497
- * Convert coin name to market coin type.
498
- *
499
- * @param coinPackageId - Package id of coin.
500
- * @param coinName - Specific support coin name.
501
- * @return Market coin type.
502
- */
503
- parseMarketCoinType(coinName: string): string;
504
- /**
505
- * Convert coin type to coin name.
506
- *
507
- * @description
508
- * The coin name cannot be obtained directly from the wormhole type. Here
509
- * the package id is used to determine and return a specific name.
510
- *
511
- * @param coinType - Specific support coin type.
512
- * @return Coin Name.
513
- */
514
- parseCoinNameFromType(coinType: string): string;
515
- /**
516
- * Convert market coin name to coin name.
517
- *
518
- * @param marketCoinName - Specific support market coin name.
519
- * @return Coin Name.
520
- */
521
- parseCoinName<T extends string>(marketCoinName: string): T;
522
- /**
523
- * Convert coin name to market coin name.
524
- *
525
- * @param coinName - Specific support coin name.
526
- * @return Market coin name.
527
- */
528
- parseMarketCoinName<T extends string>(coinName: string): T;
529
- /**
530
- * Get reward type of spool.
531
- *
532
- * @param stakeMarketCoinName - Support stake market coin.
533
- * @return Spool reward coin name.
534
- */
535
- getSpoolRewardCoinName: () => string;
536
- /**
537
- * Get coin decimal.
538
- *
539
- * return Coin decimal.
540
- */
541
- getCoinDecimal(coinName: string): number;
542
- /**
543
- * Get coin wrapped type.
544
- *
545
- * return Coin wrapped type.
546
- */
547
- getCoinWrappedType(assetCoinName: string): CoinWrappedType;
548
- /**
549
- * Select coin id that add up to the given amount as transaction arguments.
550
- *
551
- * @param ownerAddress - The address of the owner.
552
- * @param amount - The amount that including coin decimals.
553
- * @param coinType - The coin type, default is 0x2::SUI::SUI.
554
- * @return The selected transaction coin arguments.
555
- */
556
- selectCoins(amount: number, coinType?: string, ownerAddress?: string): Promise<{
557
- objectId: string;
558
- digest: string;
559
- version: string;
560
- balance: string;
561
- }[]>;
562
- /**
563
- * Merge coins with type `coinType` to dest
564
- * @param txBlock
565
- * @param dest
566
- * @param coinType
567
- * @param sender
568
- */
569
- mergeSimilarCoins(txBlock: SuiTxBlock, dest: SuiObjectArg, coinType: string, sender?: string): Promise<void>;
570
- /**
571
- * Get all asset coin names in the obligation record by obligation id.
572
- *
573
- * @description
574
- * This can often be used to determine which assets in an obligation require
575
- * price updates before interacting with specific instructions of the Scallop contract.
576
- *
577
- * @param obligationId - The obligation id.
578
- * @return Asset coin Names.
579
- */
580
- getObligationCoinNames(obligationId: SuiObjectArg): Promise<string[] | undefined>;
581
- /**
582
- * Get asset coin price.
583
- *
584
- * @description
585
- * The strategy for obtaining the price is to get it through API first,
586
- * and then on-chain data if API cannot be retrieved.
587
- * Currently, we only support obtaining from pyth protocol, other
588
- * oracles will be supported in the future.
589
- *
590
- * @param assetCoinNames - Specific an array of support asset coin name.
591
- * @return Asset coin price.
592
- */
593
- getCoinPrices(coinNames?: string[]): Promise<OptionalKeys<Record<string, number>>>;
594
- /**
595
- * Convert apr to apy.
596
- *
597
- * @param apr The annual percentage rate (APR).
598
- * @param compoundFrequency How often interest is compounded per year. Default is daily (365 times a year).
599
- * @return The equivalent annual percentage yield (APY) for the given APR and compounding frequency.
600
- */
601
- parseAprToApy(apr: number, compoundFrequency?: number): number;
602
- /**
603
- * Convert apy to apr.
604
- *
605
- * @param apr The equivalent annual percentage yield (APY).
606
- * @param compoundFrequency How often interest is compounded per year. Default is daily (365 times a year).
607
- * @return The equivalent annual percentage rate (APR) for the given APY and compounding frequency.
608
- */
609
- parseApyToApr(apy: number, compoundFrequency?: number): number;
610
- /**
611
- * Give extend lock period to get unlock at in seconds timestamp.
612
- *
613
- * @description
614
- * - When the user without remaining unlock period, If the extended unlock day is not specified,
615
- * the unlock period will be increased by one day by default.
616
- * - When the given extended day plus the user's remaining unlock period exceeds the maximum
617
- * unlock period, the maximum unlock period is used as unlock period.
618
- *
619
- * @param extendLockPeriodInDay The extend lock period in day.
620
- * @param unlockAtInSecondTimestamp The unlock timestamp from veSca object.
621
- * @return New unlock at in seconds timestamp.
302
+ type SCoinName = string;
303
+ type ScallopConstantsParams = {
304
+ poolAddressesApiUrl?: string;
305
+ whitelistApiUrl?: string;
306
+ forcePoolAddressInterface?: Record<string, PoolAddress>;
307
+ forceWhitelistInterface?: Whitelist;
308
+ } & ScallopAddressParams;
309
+ declare class ScallopConstants extends ScallopAddress {
310
+ readonly params: ScallopConstantsParams;
311
+ private _poolAddresses;
312
+ private _whitelist;
313
+ /**
314
+ * @description coin names to coin decimal map
622
315
  */
623
- getUnlockAt(extendLockPeriodInDay?: number, unlockAtInMillisTimestamp?: number): number;
316
+ coinDecimals: Record<CoinName, number | undefined>;
317
+ coinNameToOldMarketCoinTypeMap: Record<CoinName, OldMarketCoinType | undefined>;
318
+ scoinRawNameToSCoinNameMap: Record<SCoinRawName, SCoinName | undefined>;
319
+ scoinTypeToSCoinNameMap: Record<SCoinType, SCoinName | undefined>;
320
+ wormholeCoinTypeToCoinNameMap: Record<CoinType, CoinName | undefined>;
321
+ voloCoinTypeToCoinNameMap: Record<CoinType, CoinName | undefined>;
322
+ suiBridgeCoinTypeToCoinNameMap: Record<CoinType, CoinName | undefined>;
624
323
  /**
625
- * Get detailed contract address and price id information for supported pool in Scallop
626
- * @returns Supported pool informations
324
+ * @description coin names to coin types map
627
325
  */
628
- getSupportedPoolAddresses(): PoolAddress[];
326
+ coinTypes: Record<CoinName, CoinType | undefined>;
327
+ /**
328
+ * @description scoin names to scoin types map
329
+ */
330
+ sCoinTypes: Record<SCoinName, SCoinType | undefined>;
331
+ coinTypeToCoinNameMap: Record<CoinType, CoinName | undefined>;
332
+ /**
333
+ * @description Supported borrow incentive reward coin names
334
+ */
335
+ supportedBorrowIncentiveRewards: Set<CoinName>;
336
+ private scallopConstantAxios;
337
+ constructor(params?: ScallopConstantsParams);
338
+ get protocolObjectId(): string;
339
+ get isInitialized(): boolean;
340
+ get whitelist(): Whitelist;
341
+ get poolAddresses(): Record<string, PoolAddress | undefined>;
342
+ private isAddressInitialized;
343
+ parseToOldMarketCoin(coinType: string): string;
344
+ init({ networkType, force, addressId, constantsParams, }?: {
345
+ networkType?: NetworkType;
346
+ force?: boolean;
347
+ addressId?: string;
348
+ constantsParams?: Partial<ScallopConstantsParams>;
349
+ }): Promise<void>;
350
+ private initConstants;
351
+ private readApi;
352
+ readWhiteList(): Promise<Whitelist>;
353
+ readPoolAddresses(): Promise<Record<string, PoolAddress>>;
629
354
  }
630
355
 
631
- /**
632
- * @description
633
- * It provides methods to obtain sdk index data from mainnet.
634
- *
635
- *
636
- * @example
637
- * ```typescript
638
- * const scallopIndexer = new scallopIndexer(<parameters>);
639
- * scallopIndexer.<indexer functions>();
640
- * await scallopIndexer.<indexer async functions>();
641
- * ```
642
- */
643
- declare class ScallopIndexer {
644
- private readonly cache;
645
- readonly params: ScallopIndexerParams;
646
- private readonly _requestClient;
647
- constructor(params: ScallopIndexerParams, instance?: ScallopIndexerInstanceParams);
356
+ type ScallopIndexerParams = {
357
+ indexerApiUrl?: string;
358
+ } & ScallopAxiosParams;
359
+ declare class ScallopIndexer extends ScallopAxios {
360
+ constructor(params?: ScallopIndexerParams);
648
361
  /**
649
362
  * Get market index data.
650
363
  *
@@ -718,35 +431,85 @@ declare class ScallopIndexer {
718
431
  getCoinPrices(): Promise<Record<string, number>>;
719
432
  }
720
433
 
721
- /**
722
- * @description
723
- * It provides methods for getting on-chain data from the Scallop contract.
724
- *
725
- * @example
726
- * ```typescript
727
- * const scallopQuery = new ScallopQuery(<parameters>);
728
- * await scallopQuery.init();
729
- * scallopQuery.<query functions>();
730
- * await scallopQuery.<query functions>();
731
- * ```
732
- */
733
- declare class ScallopQuery {
734
- readonly params: ScallopQueryParams;
735
- suiKit: SuiKit;
736
- address: ScallopAddress;
737
- utils: ScallopUtils;
738
- constants: ScallopConstants;
739
- indexer: ScallopIndexer;
740
- cache: ScallopCache;
741
- walletAddress: string;
742
- constructor(params: ScallopQueryParams, instance?: ScallopQueryInstanceParams);
434
+ type QueryInspectTxnParams = {
435
+ queryTarget: string;
436
+ args: SuiObjectArg[];
437
+ typeArgs?: any[];
438
+ };
439
+ type ScallopSuiKitParams = {
440
+ suiKit?: SuiKit;
441
+ tokensPerSecond?: number;
442
+ walletAddress?: string;
443
+ } & SuiKitParams & ScallopQueryClientParams;
444
+ declare class ScallopSuiKit extends ScallopQueryClient {
445
+ readonly suiKit: SuiKit;
446
+ private _walletAddress;
447
+ private _tokensPerSecond;
448
+ private rateLimiter;
449
+ constructor(params?: ScallopSuiKitParams);
450
+ switchFullNodes(fullNodes: string[]): void;
451
+ get client(): _mysten_sui_dist_cjs_client.SuiClient;
452
+ get walletAddress(): string;
453
+ set walletAddress(value: string);
454
+ get tokensPerSecond(): number;
455
+ set tokensPerSecond(value: number);
456
+ get currentFullNode(): string;
457
+ signAndSendTxn(tx: Uint8Array | Transaction | SuiTxBlock, derivePathParams?: DerivePathParams): Promise<_mysten_sui_dist_cjs_client.SuiTransactionBlockResponse>;
458
+ private callWithRateLimiter;
459
+ private queryGetNormalizedMoveFunction;
460
+ /**
461
+ * @description Provides cache for getObject of the SuiKit.
462
+ * @param objectId
463
+ * @param QueryObjectParams
464
+ * @returns Promise<SuiObjectResponse>
465
+ */
466
+ queryGetObject(objectId: string, options?: SuiObjectDataOptions$1): Promise<SuiObjectResponse>;
467
+ /**
468
+ * @description Provides cache for getObjects of the SuiKit.
469
+ * @param objectIds
470
+ * @returns Promise<SuiObjectData[]>
471
+ */
472
+ queryGetObjects(objectIds: string[], options?: SuiObjectDataOptions$1): Promise<SuiObjectData$1[]>;
473
+ /**
474
+ * @description Provides cache for getOwnedObjects of the SuiKit.
475
+ * @param input
476
+ * @returns Promise<PaginatedObjectsResponse>
477
+ */
478
+ queryGetOwnedObjects(input: GetOwnedObjectsParams$1): Promise<_mysten_sui_dist_cjs_client.PaginatedObjectsResponse>;
479
+ queryGetDynamicFields(input: GetDynamicFieldsParams$1): Promise<DynamicFieldPage | null>;
480
+ queryGetDynamicFieldObject(input: GetDynamicFieldObjectParams$1): Promise<SuiObjectResponse | null>;
481
+ queryGetAllCoinBalances(owner: string): Promise<{
482
+ [k: string]: CoinBalance;
483
+ }>;
484
+ queryGetCoinBalance(input: GetBalanceParams): Promise<CoinBalance | null>;
485
+ /**
486
+ * @description Provides cache for inspectTxn of the SuiKit.
487
+ * @param QueryInspectTxnParams
488
+ * @param txBlock
489
+ * @returns Promise<DevInspectResults>
490
+ */
491
+ queryInspectTxn({ queryTarget, args, typeArgs, }: QueryInspectTxnParams): Promise<DevInspectResults | null>;
492
+ }
493
+
494
+ type ScallopQueryParams = {
495
+ indexer?: ScallopIndexer;
496
+ utils?: ScallopUtils;
497
+ } & ScallopUtilsParams & ScallopIndexerParams;
498
+ declare class ScallopQuery implements ScallopQueryInterface {
499
+ readonly indexer: ScallopIndexer;
500
+ readonly utils: ScallopUtils;
501
+ constructor(params: ScallopQueryParams);
502
+ initIndexerFallback(): void;
743
503
  /**
744
504
  * Request the scallop API to initialize data.
745
505
  *
746
506
  * @param force - Whether to force initialization.
747
- * @param address - ScallopAddress instance.
748
507
  */
749
508
  init(force?: boolean): Promise<void>;
509
+ get constants(): ScallopConstants;
510
+ get walletAddress(): string;
511
+ get scallopSuiKit(): ScallopSuiKit;
512
+ get address(): ScallopConstants;
750
513
  /**
751
514
  * @deprecated use getMarketPools
752
515
  * Query market data.
@@ -1246,116 +1009,364 @@ declare class ScallopQuery {
1246
1009
  totalSupplyValue: number;
1247
1010
  }>;
1248
1011
  /**
1249
- * Get both primary and secondary price update policy objects
1250
- * @returns price update policies
1012
+ * Get both primary and secondary price update policy objects
1013
+ * @returns price update policies
1014
+ */
1015
+ getPriceUpdatePolicies(): Promise<{
1016
+ primary: _mysten_sui_dist_cjs_client.SuiObjectResponse | null;
1017
+ secondary: _mysten_sui_dist_cjs_client.SuiObjectResponse | null;
1018
+ }>;
1019
+ /**
1020
+ * Return the supported primary and secondary oracles for all supported pool assets
1021
+ * @returns
1022
+ */
1023
+ getAssetOracles(): Promise<Record<string, xOracleRules>>;
1024
+ /**
1025
+ * Get switchboard on-demand aggregator object id based on coinType
1026
+ * @param coinType
1027
+ * @returns
1028
+ */
1029
+ getSwitchboardOnDemandAggregatorObjectIds(coinName: string[]): Promise<string[]>;
1030
+ }
1031
+
1032
+ type ScallopBuilderParams = {
1033
+ query?: ScallopQuery;
1034
+ usePythPullModel?: boolean;
1035
+ useOnChainXOracleList?: boolean;
1036
+ } & ScallopQueryParams;
1037
+ /**
1038
+ * @description
1039
+ * It provides methods for operating the transaction block, making it more convenient to organize transaction combinations.
1040
+ *
1041
+ * @example
1042
+ * ```typescript
1043
+ * const scallopBuilder = new ScallopBuilder(<parameters>);
1044
+ * await scallopBuilder.init();
1045
+ * const txBlock = scallopBuilder.<builder functions>();
1046
+ * ```
1047
+ */
1048
+ declare class ScallopBuilder implements ScallopBuilderInterface {
1049
+ readonly query: ScallopQuery;
1050
+ readonly usePythPullModel: boolean;
1051
+ readonly useOnChainXOracleList: boolean;
1052
+ constructor(params: ScallopBuilderParams);
1053
+ get utils(): ScallopUtils;
1054
+ get constants(): ScallopConstants;
1055
+ get walletAddress(): string;
1056
+ get scallopSuiKit(): ScallopSuiKit;
1057
+ get suiKit(): _scallop_io_sui_kit.SuiKit;
1058
+ get address(): ScallopConstants;
1059
+ /**
1060
+ * Request the scallop API to initialize data.
1061
+ *
1062
+ * @param force - Whether to force initialization.
1063
+ */
1064
+ init(force?: boolean): Promise<void>;
1065
+ /**
1066
+ * Create a scallop txBlock instance that enhances transaction block.
1067
+ *
1068
+ * @param txBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
1069
+ * @return Scallop txBlock.
1070
+ */
1071
+ createTxBlock(txBlock?: ScallopTxBlock | SuiTxBlock | Transaction$1): ScallopTxBlock;
1072
+ /**
1073
+ * Specifying the sender's amount of coins to get coins args from transaction result.
1074
+ *
1075
+ * @param txBlock - Scallop txBlock or txBlock created by SuiKit .
1076
+ * @param assetCoinName - Specific support asset coin name.
1077
+ * @param amount - Amount of coins to be selected.
1078
+ * @param sender - Sender address.
1079
+ * @return Take coin and left coin.
1080
+ */
1081
+ selectCoin<T extends string>(txBlock: ScallopTxBlock | SuiTxBlock, assetCoinName: T, amount: number, sender?: string): Promise<SelectCoinReturnType<T>>;
1082
+ /**
1083
+ * Specifying the sender's amount of market coins to get coins args from transaction result.
1084
+ *
1085
+ * @param txBlock - Scallop txBlock or txBlock created by SuiKit .
1086
+ * @param marketCoinName - Specific support market coin name.
1087
+ * @param amount - Amount of coins to be selected.
1088
+ * @param sender - Sender address.
1089
+ * @return Take coin and left coin.
1090
+ */
1091
+ selectMarketCoin(txBlock: ScallopTxBlock | SuiTxBlock, marketCoinName: string, amount: number, sender?: string): Promise<{
1092
+ takeCoin: TransactionObjectArgument;
1093
+ leftCoin: TransactionObjectArgument;
1094
+ totalAmount: number;
1095
+ }>;
1096
+ /**
1097
+ * Specifying the sender's amount of sCoins to get coins args from transaction result.
1098
+ *
1099
+ * @param txBlock - Scallop txBlock or txBlock created by SuiKit .
1100
+ * @param marketCoinName - Specific support sCoin name.
1101
+ * @param amount - Amount of coins to be selected.
1102
+ * @param sender - Sender address.
1103
+ * @return Take coin and left coin.
1104
+ */
1105
+ selectSCoin(txBlock: ScallopTxBlock | SuiTxBlock, sCoinName: string, amount: number, sender?: string): Promise<{
1106
+ takeCoin: TransactionObjectArgument;
1107
+ leftCoin: TransactionObjectArgument;
1108
+ totalAmount: number;
1109
+ }>;
1110
+ /**
1111
+ * Select sCoin or market coin automatically. Prioritize sCoin first
1112
+ */
1113
+ selectSCoinOrMarketCoin(txBlock: ScallopTxBlock | SuiTxBlock, sCoinName: string, amount: number, sender?: string): Promise<{
1114
+ sCoin: TransactionObjectArgument | undefined;
1115
+ marketCoin: TransactionObjectArgument | undefined;
1116
+ }>;
1117
+ /**
1118
+ * Execute Scallop txBlock using the `signAndSendTxn` methods in suikit.
1119
+ *
1120
+ * @param txBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
1121
+ */
1122
+ signAndSendTxBlock(txBlock: ScallopTxBlock | SuiTxBlock | Transaction$1): Promise<SuiTransactionBlockResponse>;
1123
+ moveCall(txb: ScallopTxBlock | SuiTxBlock, target: string, args?: (SuiTxArg | SuiVecTxArg | SuiObjectArg | SuiAmountsArg)[], typeArgs?: string[]): _scallop_io_sui_kit.TransactionResult;
1124
+ }
1125
+
1126
+ interface ScallopBaseInterface {
1127
+ scallopSuiKit: ScallopSuiKit;
1128
+ constants: ScallopConstants;
1129
+ walletAddress: string;
1130
+ init: () => Promise<void>;
1131
+ }
1132
+ interface ScallopUtilsInterface extends ScallopBaseInterface {
1133
+ address: ScallopAddress;
1134
+ }
1135
+ interface ScallopQueryInterface extends ScallopUtilsInterface {
1136
+ utils: ScallopUtils;
1137
+ }
1138
+ interface ScallopBuilderInterface extends ScallopQueryInterface {
1139
+ query: ScallopQuery;
1140
+ }
1141
+ interface ScallopClientInterface extends ScallopBaseInterface {
1142
+ builder: ScallopBuilder;
1143
+ }
1144
+
1145
+ type ScallopUtilsParams = {
1146
+ pythEndpoints?: string[];
1147
+ scallopSuiKit?: ScallopSuiKit;
1148
+ scallopConstants?: ScallopConstants;
1149
+ } & ScallopSuiKitParams & ScallopConstantsParams;
1150
+ declare class ScallopUtils implements ScallopUtilsInterface {
1151
+ pythEndpoints: string[];
1152
+ readonly scallopSuiKit: ScallopSuiKit;
1153
+ readonly constants: ScallopConstants;
1154
+ constructor(params?: ScallopUtilsParams);
1155
+ get walletAddress(): string;
1156
+ get suiKit(): _scallop_io_sui_kit.SuiKit;
1157
+ get queryClient(): _tanstack_query_core.QueryClient;
1158
+ get address(): ScallopConstants;
1159
+ isSuiBridgeAsset(coinName: any): boolean;
1160
+ isWormholeAsset(coinName: any): boolean;
1161
+ isMarketCoin(coinName: string): boolean;
1162
+ init({ force }?: {
1163
+ force?: boolean;
1164
+ }): Promise<void>;
1165
+ /**
1166
+ * Convert market coin name to coin name.
1167
+ *
1168
+ * @param marketCoinName - Specific support market coin name.
1169
+ * @return Coin Name.
1170
+ */
1171
+ parseCoinName<T extends string>(marketCoinName: string): T;
1172
+ /**
1173
+ * Convert coin name to symbol.
1174
+ *
1175
+ * @param coinName - Specific support coin name.
1176
+ * @return Symbol string.
1177
+ */
1178
+ parseSymbol(coinName: string): string;
1179
+ /**
1180
+ * Convert coin name to coin type.
1181
+ *
1182
+ * @description
1183
+ * The Coin type of wormhole is fixed `coin:Coin`. Here using package id
1184
+ * to determine and return the type.
1185
+ *
1186
+ * @param coinPackageId - Package id of coin.
1187
+ * @param coinName - Specific support coin name.
1188
+ * @return Coin type.
1189
+ */
1190
+ parseCoinType(coinName: string, useOldMarketCoin?: boolean): string;
1191
+ /**
1192
+ * Convert coin name to sCoin name.
1193
+ *
1194
+ * @param coinName - Specific support coin name.
1195
+ * @return sCoin name.
1196
+ */
1197
+ parseSCoinName<T extends string>(coinName: string): T | undefined;
1198
+ /**
1199
+ * Convert sCoin name to market coin name.
1200
+ * This function will parse new sCoin name `scallop_...` to its old market coin name which is shorter
1201
+ * e.g: `scallop_sui -> ssui
1202
+ * if no `scallop_...` is encountered, return coinName
1203
+ * @return sCoin name
1204
+ */
1205
+ parseSCoinTypeNameToMarketCoinName(coinName: string): string;
1206
+ /**
1207
+ * Convert sCoin name into sCoin type
1208
+ * @param sCoinName
1209
+ * @returns sCoin type
1210
+ */
1211
+ parseSCoinType(sCoinName: string): string;
1212
+ /**
1213
+ * Convert sCoinType into sCoin name
1214
+ * @param sCoinType
1215
+ * @returns sCoin name
1216
+ */
1217
+ parseSCoinNameFromType(sCoinType: string): string | undefined;
1218
+ /**
1219
+ * Convert sCoin name into its underlying coin type
1220
+ * @param sCoinName
1221
+ * @returns coin type
1222
+ */
1223
+ parseUnderlyingSCoinType(sCoinName: string): string;
1224
+ /**
1225
+ * Get sCoin treasury id from sCoin name
1226
+ * @param sCoinName
1227
+ * @returns sCoin treasury id
1251
1228
  */
1252
- getPriceUpdatePolicies(): Promise<{
1253
- primary: _mysten_sui_dist_cjs_client.SuiObjectResponse | null;
1254
- secondary: _mysten_sui_dist_cjs_client.SuiObjectResponse | null;
1255
- }>;
1229
+ getSCoinTreasury(sCoinName: string): any;
1256
1230
  /**
1257
- * Return the supported primary and secondary oracles for all supported pool assets
1258
- * @returns
1231
+ * Convert coin name to market coin type.
1232
+ *
1233
+ * @param coinPackageId - Package id of coin.
1234
+ * @param coinName - Specific support coin name.
1235
+ * @return Market coin type.
1259
1236
  */
1260
- getAssetOracles(): Promise<Record<string, xOracleRules>>;
1237
+ parseMarketCoinType(coinName: string): string;
1261
1238
  /**
1262
- * Get switchboard on-demand aggregator object id based on coinType
1263
- * @param coinType
1264
- * @returns
1239
+ * Convert coin name to market coin name.
1240
+ *
1241
+ * @param coinName - Specific support coin name.
1242
+ * @return Market coin name.
1265
1243
  */
1266
- getSwitchboardOnDemandAggregatorObjectIds(coinName: string[]): Promise<string[]>;
1267
- }
1268
-
1269
- /**
1270
- * @description
1271
- * It provides methods for operating the transaction block, making it more convenient to organize transaction combinations.
1272
- *
1273
- * @example
1274
- * ```typescript
1275
- * const scallopBuilder = new ScallopBuilder(<parameters>);
1276
- * await scallopBuilder.init();
1277
- * const txBlock = scallopBuilder.<builder functions>();
1278
- * ```
1279
- */
1280
- declare class ScallopBuilder {
1281
- readonly params: ScallopBuilderParams;
1282
- readonly isTestnet: boolean;
1283
- suiKit: SuiKit;
1284
- address: ScallopAddress;
1285
- constants: ScallopConstants;
1286
- query: ScallopQuery;
1287
- utils: ScallopUtils;
1288
- walletAddress: string;
1289
- cache: ScallopCache;
1290
- constructor(params: ScallopBuilderParams, instance?: ScallopBuilderInstanceParams);
1244
+ parseMarketCoinName<T extends string>(coinName: string): T;
1291
1245
  /**
1292
- * Request the scallop API to initialize data.
1246
+ * Get reward type of spool.
1293
1247
  *
1294
- * @param force - Whether to force initialization.
1295
- * @param address - ScallopAddress instance.
1248
+ * @param stakeMarketCoinName - Support stake market coin.
1249
+ * @return Spool reward coin name.
1296
1250
  */
1297
- init(force?: boolean): Promise<void>;
1251
+ getSpoolRewardCoinName: () => string;
1298
1252
  /**
1299
- * Create a scallop txBlock instance that enhances transaction block.
1253
+ * Get coin decimal.
1300
1254
  *
1301
- * @param txBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
1302
- * @return Scallop txBlock.
1255
+ * return Coin decimal.
1303
1256
  */
1304
- createTxBlock(txBlock?: ScallopTxBlock | SuiTxBlock | Transaction): ScallopTxBlock;
1257
+ getCoinDecimal(coinName: string): number;
1305
1258
  /**
1306
- * Specifying the sender's amount of coins to get coins args from transaction result.
1259
+ * Get coin wrapped type.
1307
1260
  *
1308
- * @param txBlock - Scallop txBlock or txBlock created by SuiKit .
1309
- * @param assetCoinName - Specific support asset coin name.
1310
- * @param amount - Amount of coins to be selected.
1311
- * @param sender - Sender address.
1312
- * @return Take coin and left coin.
1261
+ * return Coin wrapped type.
1313
1262
  */
1314
- selectCoin<T extends string>(txBlock: ScallopTxBlock | SuiTxBlock, assetCoinName: T, amount: number, sender?: string): Promise<SelectCoinReturnType<T>>;
1263
+ getCoinWrappedType(assetCoinName: string): CoinWrappedType;
1315
1264
  /**
1316
- * Specifying the sender's amount of market coins to get coins args from transaction result.
1265
+ * Convert coin type to coin name.
1317
1266
  *
1318
- * @param txBlock - Scallop txBlock or txBlock created by SuiKit .
1319
- * @param marketCoinName - Specific support market coin name.
1320
- * @param amount - Amount of coins to be selected.
1321
- * @param sender - Sender address.
1322
- * @return Take coin and left coin.
1267
+ * @description
1268
+ * The coin name cannot be obtained directly from the wormhole type. Here
1269
+ * the package id is used to determine and return a specific name.
1270
+ *
1271
+ * @param coinType - Specific support coin type.
1272
+ * @return Coin Name.
1323
1273
  */
1324
- selectMarketCoin(txBlock: ScallopTxBlock | SuiTxBlock, marketCoinName: string, amount: number, sender?: string): Promise<{
1325
- takeCoin: TransactionObjectArgument;
1326
- leftCoin: TransactionObjectArgument;
1327
- totalAmount: number;
1328
- }>;
1274
+ parseCoinNameFromType(coinType: string): string;
1329
1275
  /**
1330
- * Specifying the sender's amount of sCoins to get coins args from transaction result.
1276
+ * Select coin id that add up to the given amount as transaction arguments.
1331
1277
  *
1332
- * @param txBlock - Scallop txBlock or txBlock created by SuiKit .
1333
- * @param marketCoinName - Specific support sCoin name.
1334
- * @param amount - Amount of coins to be selected.
1335
- * @param sender - Sender address.
1336
- * @return Take coin and left coin.
1278
+ * @param ownerAddress - The address of the owner.
1279
+ * @param amount - The amount that including coin decimals.
1280
+ * @param coinType - The coin type, default is 0x2::SUI::SUI.
1281
+ * @return The selected transaction coin arguments.
1337
1282
  */
1338
- selectSCoin(txBlock: ScallopTxBlock | SuiTxBlock, sCoinName: string, amount: number, sender?: string): Promise<{
1339
- takeCoin: TransactionObjectArgument;
1340
- leftCoin: TransactionObjectArgument;
1341
- totalAmount: number;
1342
- }>;
1283
+ selectCoins(amount: number, coinType?: string, ownerAddress?: string): Promise<{
1284
+ objectId: string;
1285
+ digest: string;
1286
+ version: string;
1287
+ balance: string;
1288
+ }[]>;
1343
1289
  /**
1344
- * Select sCoin or market coin automatically. Prioritize sCoin first
1290
+ * Merge coins with type `coinType` to dest
1291
+ * @param txBlock
1292
+ * @param dest
1293
+ * @param coinType
1294
+ * @param sender
1345
1295
  */
1346
- selectSCoinOrMarketCoin(txBlock: ScallopTxBlock | SuiTxBlock, sCoinName: string, amount: number, sender?: string): Promise<{
1347
- sCoin: TransactionObjectArgument | undefined;
1348
- marketCoin: TransactionObjectArgument | undefined;
1349
- }>;
1296
+ mergeSimilarCoins(txBlock: SuiTxBlock | Transaction, dest: SuiObjectArg, coinType: string, sender?: string): Promise<void>;
1350
1297
  /**
1351
- * Execute Scallop txBlock using the `signAndSendTxn` methods in suikit.
1298
+ * Get all asset coin names in the obligation record by obligation id.
1352
1299
  *
1353
- * @param txBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
1300
+ * @description
1301
+ * This can often be used to determine which assets in an obligation require
1302
+ * price updates before interacting with specific instructions of the Scallop contract.
1303
+ *
1304
+ * @param obligationId - The obligation id.
1305
+ * @return Asset coin Names.
1354
1306
  */
1355
- signAndSendTxBlock(txBlock: ScallopTxBlock | SuiTxBlock | Transaction): Promise<SuiTransactionBlockResponse>;
1356
- moveCall(txb: ScallopTxBlock | SuiTxBlock, target: string, args?: (SuiTxArg | SuiVecTxArg | SuiObjectArg | SuiAmountsArg)[], typeArgs?: string[]): _scallop_io_sui_kit.TransactionResult;
1307
+ getObligationCoinNames(obligationId: SuiObjectArg): Promise<string[] | undefined>;
1308
+ private parseDataFromPythPriceFeed;
1309
+ getPythPrice(assetCoinName: string, priceFeedObject?: SuiObjectData | null): Promise<number>;
1310
+ getPythPrices(assetCoinNames: string[]): Promise<Record<string, number>>;
1311
+ /**
1312
+ * Get asset coin price.
1313
+ *
1314
+ * @description
1315
+ * The strategy for obtaining the price is to get it through API first,
1316
+ * and then on-chain data if API cannot be retrieved.
1317
+ * Currently, we only support obtaining from pyth protocol, other
1318
+ * oracles will be supported in the future.
1319
+ *
1320
+ * @param assetCoinNames - Specific an array of support asset coin name.
1321
+ * @return Asset coin price.
1322
+ */
1323
+ getCoinPrices(coinNames?: string[]): Promise<OptionalKeys<Record<string, number>>>;
1324
+ /**
1325
+ * Convert apr to apy.
1326
+ *
1327
+ * @param apr The annual percentage rate (APR).
1328
+ * @param compoundFrequency How often interest is compounded per year. Default is daily (365 times a year).
1329
+ * @return The equivalent annual percentage yield (APY) for the given APR and compounding frequency.
1330
+ */
1331
+ parseAprToApy(apr: number, compoundFrequency?: number): number;
1332
+ /**
1333
+ * Convert apy to apr.
1334
+ *
1335
+ * @param apr The equivalent annual percentage yield (APY).
1336
+ * @param compoundFrequency How often interest is compounded per year. Default is daily (365 times a year).
1337
+ * @return The equivalent annual percentage rate (APR) for the given APY and compounding frequency.
1338
+ */
1339
+ parseApyToApr(apy: number, compoundFrequency?: number): number;
1340
+ /**
1341
+ * Give extend lock period to get unlock at in seconds timestamp.
1342
+ *
1343
+ * @description
1344
+ * - When the user without remaining unlock period, If the extended unlock day is not specified,
1345
+ * the unlock period will be increased by one day by default.
1346
+ * - When the given extended day plus the user's remaining unlock period exceeds the maximum
1347
+ * unlock period, the maximum unlock period is used as unlock period.
1348
+ *
1349
+ * @param extendLockPeriodInDay The extend lock period in day.
1350
+ * @param unlockAtInSecondTimestamp The unlock timestamp from veSca object.
1351
+ * @return New unlock at in seconds timestamp.
1352
+ */
1353
+ getUnlockAt(extendLockPeriodInDay?: number, unlockAtInMillisTimestamp?: number): number;
1354
+ /**
1355
+ * Get detailed contract address and price id information for supported pool in Scallop
1356
+ * @returns Supported pool informations
1357
+ */
1358
+ getSupportedPoolAddresses(): PoolAddress[];
1357
1359
  }
1358
1360
 
1361
+ type ScallopClientParams = {
1362
+ networkType?: NetworkType;
1363
+ builder?: ScallopBuilder;
1364
+ } & ScallopBuilderParams;
1365
+ type ScallopClientFnReturnType<T extends boolean> = T extends true ? SuiTransactionBlockResponse : Transaction$1;
1366
+ type ScallopClientVeScaReturnType<T extends boolean> = T extends true ? SuiTransactionBlockResponse : {
1367
+ tx: Transaction$1;
1368
+ scaCoin: TransactionResult;
1369
+ };
1359
1370
  /**
1360
1371
  * @description
1361
1372
  * It provides contract interaction operations for general users.
@@ -1368,17 +1379,16 @@ declare class ScallopBuilder {
1368
1379
  * await scallopClient.<client async functions>();
1369
1380
  * ```
1370
1381
  */
1371
- declare class ScallopClient {
1372
- readonly params: ScallopClientParams;
1373
- suiKit: SuiKit;
1374
- address: ScallopAddress;
1375
- constants: ScallopConstants;
1376
- builder: ScallopBuilder;
1377
- query: ScallopQuery;
1378
- utils: ScallopUtils;
1379
- cache: ScallopCache;
1380
- walletAddress: string;
1381
- constructor(params: ScallopClientParams, instance?: ScallopClientInstanceParams);
1382
+ declare class ScallopClient implements ScallopClientInterface {
1383
+ readonly builder: ScallopBuilder;
1384
+ networkType: NetworkType;
1385
+ constructor(params: ScallopClientParams);
1386
+ get query(): ScallopQuery;
1387
+ get utils(): ScallopUtils;
1388
+ get constants(): ScallopConstants;
1389
+ get walletAddress(): string;
1390
+ get scallopSuiKit(): ScallopSuiKit;
1391
+ get address(): ScallopConstants;
1382
1392
  /**
1383
1393
  * Request the scallop API to initialize data.
1384
1394
  *
@@ -1686,45 +1696,37 @@ declare class ScallopClient {
1686
1696
  * const scallopUtils= await sdk.createScallopUtils();
1687
1697
  * ```
1688
1698
  */
1699
+ type ScallopParams = {
1700
+ client?: ScallopClient;
1701
+ } & ScallopClientParams;
1689
1702
  declare class Scallop {
1690
- params: ScallopParams;
1691
- suiKit: SuiKit;
1692
- cache: ScallopCache;
1693
- private address;
1694
- private constants;
1695
- constructor(params: ScallopParams, cacheOptions?: QueryClientConfig, queryClient?: QueryClient);
1696
- private initConstants;
1703
+ readonly client: ScallopClient;
1704
+ constructor(params: ScallopParams);
1705
+ init(force?: boolean): Promise<void>;
1697
1706
  /**
1698
- * Get a scallop address instance that already has read addresses.
1707
+ * Create a scallop client instance that already has initial data.
1699
1708
  *
1700
- * @param id - The API id of the addresses.
1701
- * @return Scallop Address.
1702
- */
1703
- getScallopAddress(id?: string): Promise<ScallopAddress>;
1704
- /**
1705
- * Get a scallop constants instance that already has initial data.
1706
- * @returns Scallop Constants
1709
+ * @return Scallop Client.
1707
1710
  */
1708
- getScallopConstants(params?: Partial<ScallopConstantsParams>): Promise<ScallopConstants>;
1711
+ createScallopClient(): Promise<ScallopClient>;
1709
1712
  /**
1710
1713
  * Create a scallop builder instance that already has initial data.
1711
1714
  *
1712
1715
  * @return Scallop Builder.
1713
1716
  */
1714
- createScallopBuilder(params?: Partial<ScallopBuilderParams>): Promise<ScallopBuilder>;
1717
+ createScallopBuilder(): Promise<ScallopBuilder>;
1715
1718
  /**
1716
- * Create a scallop client instance that already has initial data.
1719
+ * Create a scallop query instance.
1717
1720
  *
1718
- * @param walletAddress - When user cannot provide a secret key or mnemonic, the scallop client cannot directly derive the address of the transaction the user wants to sign. This argument specifies the wallet address for signing the transaction.
1719
- * @return Scallop Client.
1721
+ * @return Scallop Query.
1720
1722
  */
1721
- createScallopClient(params?: Partial<ScallopClientParams>): Promise<ScallopClient>;
1723
+ createScallopQuery(): Promise<ScallopQuery>;
1722
1724
  /**
1723
- * Create a scallop query instance.
1725
+ * Create a scallop utils instance.
1724
1726
  *
1725
- * @return Scallop Query.
1727
+ * @return Scallop Utils.
1726
1728
  */
1727
- createScallopQuery(params?: Partial<ScallopQueryParams>): Promise<ScallopQuery>;
1729
+ createScallopUtils(): Promise<ScallopUtils>;
1728
1730
  /**
1729
1731
  * Create a scallop indexer instance.
1730
1732
  *
@@ -1732,11 +1734,10 @@ declare class Scallop {
1732
1734
  */
1733
1735
  createScallopIndexer(): Promise<ScallopIndexer>;
1734
1736
  /**
1735
- * Create a scallop utils instance.
1736
- *
1737
- * @return Scallop Utils.
1737
+ * Get a scallop constants instance that already has initial data.
1738
+ * @returns Scallop Constants
1738
1739
  */
1739
- createScallopUtils(params?: Partial<ScallopUtilsParams>): Promise<ScallopUtils>;
1740
+ getScallopConstants(): Promise<ScallopConstants>;
1740
1741
  }
1741
1742
 
1742
1743
  type CoreIds = {
@@ -1847,6 +1848,12 @@ type GenerateBorrowIncentiveQuickMethod = (params: {
1847
1848
  txBlock: SuiTxBlockWithBorrowIncentiveNormalMethods;
1848
1849
  }) => BorrowIncentiveQuickMethods;
1849
1850
 
1851
+ type VescaIds = {
1852
+ pkgId: string;
1853
+ table: string;
1854
+ treasury: string;
1855
+ config: string;
1856
+ };
1850
1857
  type VeScaNormalMethods = {
1851
1858
  lockSca: (scaCoin: SuiObjectArg, unlockAtInSecondTimestamp: number) => TransactionResult;
1852
1859
  extendLockPeriod: (veScaKey: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
@@ -1854,10 +1861,8 @@ type VeScaNormalMethods = {
1854
1861
  renewExpiredVeSca: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
1855
1862
  redeemSca: (veScaKey: SuiObjectArg) => TransactionResult;
1856
1863
  mintEmptyVeSca: () => TransactionResult;
1857
- splitVeSca: (veScaKey: SuiObjectArg, splitAmount: string) => TransactionResult;
1858
- mergeVeSca: (targetVeScaKey: SuiObjectArg, sourceVeScaKey: SuiObjectArg) => void;
1859
1864
  };
1860
- type QuickMethodReturnType<T extends boolean> = T extends true ? void : TransactionResult | undefined;
1865
+ type RedeemScaQuickReturnType<T extends boolean> = T extends true ? void : TransactionResult | undefined;
1861
1866
  type VeScaQuickMethods = {
1862
1867
  /**
1863
1868
  * Quick methods to automate
@@ -1879,9 +1884,7 @@ type VeScaQuickMethods = {
1879
1884
  extendLockPeriodQuick: (lockPeriodInDays: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
1880
1885
  extendLockAmountQuick: (scaAmount: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
1881
1886
  renewExpiredVeScaQuick: (scaAmount: number, lockPeriodInDays: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
1882
- redeemScaQuick: <T extends boolean>(veScaKey?: SuiObjectArg, transferSca?: T) => Promise<QuickMethodReturnType<T>>;
1883
- splitVeScaQuick: <T extends boolean>(splitAmount: string, veScaKey: string, transferVeScaKey?: T) => Promise<QuickMethodReturnType<T>>;
1884
- mergeVeScaQuick: (targetVeScaKey: string, sourceVeScaKey: string) => Promise<void>;
1887
+ redeemScaQuick: <T extends boolean>(veSCaKey?: SuiObjectArg, transferSca?: T) => Promise<RedeemScaQuickReturnType<T>>;
1885
1888
  };
1886
1889
  type SuiTxBlockWithVeScaNormalMethods = SuiTxBlock & VeScaNormalMethods;
1887
1890
  type VeScaTxBlock = SuiTxBlockWithVeScaNormalMethods & VeScaQuickMethods;
@@ -2852,8 +2855,8 @@ type sCoinBalance = number;
2852
2855
  type Vesca = {
2853
2856
  id: string;
2854
2857
  keyId: string;
2855
- keyObject?: SuiObjectRef;
2856
- object: SuiObjectRef;
2858
+ keyObject?: SuiObjectRef$1;
2859
+ object: SuiObjectRef$1;
2857
2860
  lockedScaAmount: string;
2858
2861
  lockedScaCoin: number;
2859
2862
  currentVeScaBalance: number;
@@ -2956,9 +2959,6 @@ interface AddressesInterface {
2956
2959
  table: string;
2957
2960
  treasury: string;
2958
2961
  config: string;
2959
- subsTable: string;
2960
- subsTableId: string;
2961
- subsWhitelist: string;
2962
2962
  };
2963
2963
  referral: {
2964
2964
  id: string;
@@ -2995,81 +2995,6 @@ type AddressPathsProps<T> = T extends string ? [] : {
2995
2995
  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;
2996
2996
  type AddressStringPath = Join<AddressPathsProps<AddressesInterface>, '.'>;
2997
2997
 
2998
- type ScallopClientFnReturnType<T extends boolean> = T extends true ? SuiTransactionBlockResponse : Transaction;
2999
- type ScallopClientVeScaReturnType<T extends boolean> = T extends true ? SuiTransactionBlockResponse : {
3000
- tx: Transaction;
3001
- scaCoin: TransactionResult;
3002
- };
3003
- type ScallopBaseInstanceParams = {
3004
- suiKit?: SuiKit;
3005
- cache?: ScallopCache;
3006
- };
3007
- type ScallopCacheInstanceParams = ScallopBaseInstanceParams & {
3008
- queryClient?: QueryClient;
3009
- };
3010
- type ScallopAddressInstanceParams = ScallopBaseInstanceParams & {
3011
- cache?: ScallopCache;
3012
- };
3013
- type ScallopConstantsInstanceParams = {
3014
- address?: ScallopAddress;
3015
- cache?: ScallopCache;
3016
- };
3017
- type ScallopIndexerInstanceParams = {
3018
- cache?: ScallopCache;
3019
- };
3020
- type ScallopUtilsInstanceParams = ScallopBaseInstanceParams & {
3021
- constants?: ScallopConstants;
3022
- };
3023
- type ScallopQueryInstanceParams = ScallopBaseInstanceParams & {
3024
- utils?: ScallopUtils;
3025
- indexer?: ScallopIndexer;
3026
- };
3027
- type ScallopBuilderInstanceParams = ScallopBaseInstanceParams & {
3028
- query?: ScallopQuery;
3029
- };
3030
- type ScallopClientInstanceParams = ScallopBaseInstanceParams & {
3031
- builder?: ScallopBuilder;
3032
- };
3033
- type ScallopCacheConfig = {
3034
- tokensPerInterval?: number;
3035
- interval?: number;
3036
- };
3037
- type ScallopCacheParams = {
3038
- walletAddress?: string;
3039
- cacheOptions?: QueryClientConfig;
3040
- config?: ScallopCacheConfig;
3041
- tokensPerSecond?: number;
3042
- } & Partial<SuiKitParams>;
3043
- type ScallopIndexerParams = ScallopCacheParams & {
3044
- indexerApiUrl?: string;
3045
- axios?: AxiosInstance;
3046
- };
3047
- type ScallopAddressParams = ScallopCacheParams & {
3048
- addressApiUrl?: string;
3049
- addressId: string;
3050
- auth?: string;
3051
- network?: NetworkType;
3052
- forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
3053
- };
3054
- type ScallopConstantsParams = ScallopAddressParams & {
3055
- poolAddressesApiUrl?: string;
3056
- whitelistApiUrl?: string;
3057
- forcePoolAddressInterface?: Record<string, PoolAddress>;
3058
- forceWhitelistInterface?: Whitelist;
3059
- };
3060
- type ScallopUtilsParams = ScallopAddressParams & ScallopConstantsParams & {
3061
- pythEndpoints?: string[];
3062
- };
3063
- type ScallopQueryParams = ScallopUtilsParams & ScallopIndexerParams;
3064
- type ScallopBuilderParams = ScallopQueryParams & {
3065
- usePythPullModel?: boolean;
3066
- useOnChainXOracleList?: boolean;
3067
- };
3068
- type ScallopClientParams = ScallopBuilderParams;
3069
- type ScallopParams = Partial<SuiKitParams> & ScallopAddressParams & ScallopConstantsParams & {
3070
- walletAddress?: string;
3071
- };
3072
-
3073
2998
  type OptionalKeys<T> = {
3074
2999
  [K in keyof T]?: T[K];
3075
3000
  };
@@ -3085,4 +3010,4 @@ declare const MIN_TOP_UP_AMOUNT: 1000000000;
3085
3010
 
3086
3011
  declare const xOracleList: xOracleListType;
3087
3012
 
3088
- 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 LoyaltyProgramIds, 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, type ParsedBorrowIncentiveAccountData, type ParsedBorrowIncentiveAccountPoolData, type ParsedBorrowIncentivePoolData, type ParsedBorrowIncentivePoolPointData, type ParsedMarketCollateralData, type ParsedMarketPoolData, type ParsedSpoolData, type ParsedSpoolRewardPoolData, type PoolAddress, type QuickMethodReturnType, RPC_PROVIDERS, RateLimiter, type RiskModel, SCA_COIN_TYPE, type SCoinAmounts, type SCoinConverterTreasury, type SCoinIds, type SCoinTreasuryCaps, type SCoinTxBlock, type SCoins, SDK_API_BASE_URL, Scallop, ScallopAddress, type ScallopAddressInstanceParams, type ScallopAddressParams, type ScallopBaseInstanceParams, ScallopBuilder, type ScallopBuilderInstanceParams, type ScallopBuilderParams, ScallopCache, type ScallopCacheConfig, type ScallopCacheInstanceParams, type ScallopCacheParams, ScallopClient, type ScallopClientFnReturnType, type ScallopClientInstanceParams, type ScallopClientParams, type ScallopClientVeScaReturnType, ScallopConstants, type ScallopConstantsInstanceParams, type ScallopConstantsParams, ScallopIndexer, type ScallopIndexerInstanceParams, type ScallopIndexerParams, type ScallopParams, ScallopQuery, type ScallopQueryInstanceParams, type ScallopQueryParams, type ScallopTxBlock, ScallopUtils, type ScallopUtilsInstanceParams, type ScallopUtilsParams, type SelectCoinReturnType, 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 VeScaNormalMethods, type VeScaQuickMethods, type VeScaTreasuryFields, type VeScaTreasuryInfo, type VeScaTxBlock, type Vesca, type VoloCoinIds, type Whitelist, type WormholeCoinIds, _SUPPORT_ORACLES, queryKeys, type sCoinBalance, type sCoinNormalMethods, type sCoinPkgIds, type sCoinQuickMethods, xOracleList, type xOracleListType, type xOracleRuleType, type xOracleRules };
3013
+ 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 LoyaltyProgramIds, 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, type ParsedBorrowIncentiveAccountData, type ParsedBorrowIncentiveAccountPoolData, type ParsedBorrowIncentivePoolData, type ParsedBorrowIncentivePoolPointData, type ParsedMarketCollateralData, type ParsedMarketPoolData, type ParsedSpoolData, type ParsedSpoolRewardPoolData, type PoolAddress, RPC_PROVIDERS, type RedeemScaQuickReturnType, 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 SelectCoinReturnType, 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 VeScaNormalMethods, type VeScaQuickMethods, type VeScaTreasuryFields, type VeScaTreasuryInfo, type VeScaTxBlock, type Vesca, type VescaIds, type VoloCoinIds, type Whitelist, type WormholeCoinIds, _SUPPORT_ORACLES, queryKeys, type sCoinBalance, type sCoinNormalMethods, type sCoinPkgIds, type sCoinQuickMethods, xOracleList, type xOracleListType, type xOracleRuleType, type xOracleRules };