@scallop-io/sui-scallop-sdk 1.5.0-alpha.1 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/index.d.mts +3161 -0
  2. package/dist/index.d.ts +3161 -3
  3. package/dist/index.js +78 -9966
  4. package/dist/index.mjs +15 -9892
  5. package/package.json +5 -6
  6. package/src/builders/coreBuilder.ts +10 -14
  7. package/src/builders/oracle.ts +10 -2
  8. package/src/constants/coinGecko.ts +14 -4
  9. package/src/constants/common.ts +8 -1
  10. package/src/constants/enum.ts +28 -57
  11. package/src/constants/poolAddress.ts +294 -344
  12. package/src/constants/pyth.ts +4 -1
  13. package/src/constants/testAddress.ts +487 -61
  14. package/src/constants/xoracle.ts +18 -16
  15. package/src/models/scallopAddress.ts +54 -0
  16. package/src/models/scallopQuery.ts +8 -12
  17. package/src/queries/coreQuery.ts +4 -4
  18. package/src/queries/poolAddressesQuery.ts +2 -2
  19. package/src/queries/portfolioQuery.ts +7 -8
  20. package/src/queries/xOracleQuery.ts +15 -7
  21. package/src/types/address.ts +5 -0
  22. package/src/types/model.ts +1 -0
  23. package/src/utils/util.ts +8 -3
  24. package/dist/builders/borrowIncentiveBuilder.d.ts +0 -12
  25. package/dist/builders/coreBuilder.d.ts +0 -12
  26. package/dist/builders/index.d.ts +0 -12
  27. package/dist/builders/loyaltyProgramBuilder.d.ts +0 -12
  28. package/dist/builders/oracle.d.ts +0 -14
  29. package/dist/builders/referralBuilder.d.ts +0 -12
  30. package/dist/builders/sCoinBuilder.d.ts +0 -4
  31. package/dist/builders/spoolBuilder.d.ts +0 -12
  32. package/dist/builders/vescaBuilder.d.ts +0 -25
  33. package/dist/constants/cache.d.ts +0 -14
  34. package/dist/constants/coinGecko.d.ts +0 -2
  35. package/dist/constants/common.d.ts +0 -20
  36. package/dist/constants/enum.d.ts +0 -14
  37. package/dist/constants/flashloan.d.ts +0 -2
  38. package/dist/constants/index.d.ts +0 -13
  39. package/dist/constants/poolAddress.d.ts +0 -27
  40. package/dist/constants/pyth.d.ts +0 -5
  41. package/dist/constants/queryKeys.d.ts +0 -54
  42. package/dist/constants/rpc.d.ts +0 -1
  43. package/dist/constants/testAddress.d.ts +0 -2
  44. package/dist/constants/vesca.d.ts +0 -5
  45. package/dist/constants/xoracle.d.ts +0 -2
  46. package/dist/index.js.map +0 -1
  47. package/dist/index.mjs.map +0 -1
  48. package/dist/models/index.d.ts +0 -8
  49. package/dist/models/scallop.d.ts +0 -73
  50. package/dist/models/scallopAddress.d.ts +0 -150
  51. package/dist/models/scallopBuilder.d.ts +0 -90
  52. package/dist/models/scallopCache.d.ts +0 -81
  53. package/dist/models/scallopClient.d.ts +0 -321
  54. package/dist/models/scallopIndexer.d.ts +0 -90
  55. package/dist/models/scallopPrice.d.ts +0 -0
  56. package/dist/models/scallopQuery.d.ts +0 -704
  57. package/dist/models/scallopUtils.d.ts +0 -229
  58. package/dist/models/suiKit.d.ts +0 -2
  59. package/dist/queries/borrowIncentiveQuery.d.ts +0 -82
  60. package/dist/queries/borrowLimitQuery.d.ts +0 -9
  61. package/dist/queries/coreQuery.d.ts +0 -171
  62. package/dist/queries/index.d.ts +0 -15
  63. package/dist/queries/isolatedAssetQuery.d.ts +0 -14
  64. package/dist/queries/loyaltyProgramQuery.d.ts +0 -10
  65. package/dist/queries/objectsQuery.d.ts +0 -2
  66. package/dist/queries/poolAddressesQuery.d.ts +0 -29
  67. package/dist/queries/portfolioQuery.d.ts +0 -143
  68. package/dist/queries/priceQuery.d.ts +0 -58
  69. package/dist/queries/referralQuery.d.ts +0 -7
  70. package/dist/queries/sCoinQuery.d.ts +0 -41
  71. package/dist/queries/spoolQuery.d.ts +0 -74
  72. package/dist/queries/supplyLimitQuery.d.ts +0 -9
  73. package/dist/queries/vescaQuery.d.ts +0 -36
  74. package/dist/queries/xOracleQuery.d.ts +0 -13
  75. package/dist/types/address.d.ts +0 -108
  76. package/dist/types/builder/borrowIncentive.d.ts +0 -35
  77. package/dist/types/builder/core.d.ts +0 -56
  78. package/dist/types/builder/index.d.ts +0 -24
  79. package/dist/types/builder/loyaltyProgram.d.ts +0 -23
  80. package/dist/types/builder/referral.d.ts +0 -30
  81. package/dist/types/builder/sCoin.d.ts +0 -37
  82. package/dist/types/builder/spool.d.ts +0 -29
  83. package/dist/types/builder/vesca.d.ts +0 -51
  84. package/dist/types/constant/common.d.ts +0 -24
  85. package/dist/types/constant/enum.d.ts +0 -48
  86. package/dist/types/constant/index.d.ts +0 -3
  87. package/dist/types/constant/xOracle.d.ts +0 -9
  88. package/dist/types/index.d.ts +0 -6
  89. package/dist/types/model.d.ts +0 -60
  90. package/dist/types/query/borrowIncentive.d.ts +0 -124
  91. package/dist/types/query/core.d.ts +0 -380
  92. package/dist/types/query/index.d.ts +0 -7
  93. package/dist/types/query/loyaltyProgram.d.ts +0 -5
  94. package/dist/types/query/portfolio.d.ts +0 -119
  95. package/dist/types/query/sCoin.d.ts +0 -1
  96. package/dist/types/query/spool.d.ts +0 -142
  97. package/dist/types/query/vesca.d.ts +0 -26
  98. package/dist/types/utils.d.ts +0 -22
  99. package/dist/utils/builder.d.ts +0 -15
  100. package/dist/utils/core.d.ts +0 -2
  101. package/dist/utils/index.d.ts +0 -5
  102. package/dist/utils/indexer.d.ts +0 -17
  103. package/dist/utils/query.d.ts +0 -62
  104. package/dist/utils/util.d.ts +0 -27
@@ -0,0 +1,3161 @@
1
+ import { DevInspectResults, SuiObjectDataOptions, SuiObjectResponse, SuiObjectData, GetOwnedObjectsParams, GetDynamicFieldsParams, DynamicFieldPage, GetDynamicFieldObjectParams, CoinBalance, GetBalanceParams, SuiObjectRef, SuiTransactionBlockResponse } from '@mysten/sui/client';
2
+ import * as _scallop_io_sui_kit from '@scallop-io/sui-kit';
3
+ import { SuiKit, SuiObjectArg, NetworkType, SuiTxBlock, SuiTxArg, SuiVecTxArg, SuiAmountsArg, SuiAddressArg, TransactionResult as TransactionResult$1, SuiKitParams } from '@scallop-io/sui-kit';
4
+ import * as _mysten_sui_dist_cjs_client from '@mysten/sui/dist/cjs/client';
5
+ import { QueryClient, QueryClientConfig } from '@tanstack/query-core';
6
+ import { Transaction, TransactionObjectArgument, Argument, TransactionResult } from '@mysten/sui/transactions';
7
+
8
+ /**
9
+ * Default cache options for the QueryClient.
10
+ * @type {QueryClientConfig}
11
+ * @description Default cache options for the QueryClient
12
+ * We set the default to 5s to prevent duplicate requests from being requested (e.g. query MarketObject, etc.)
13
+ */
14
+ declare const DEFAULT_CACHE_OPTIONS: {
15
+ defaultOptions: {
16
+ queries: {
17
+ staleTime: number;
18
+ gcTime: number;
19
+ };
20
+ };
21
+ };
22
+
23
+ type ParseMarketCoins<T extends string> = `s${T}`;
24
+ type ParseCoins<T extends string> = T extends `s${infer R}` ? R : never;
25
+ type SupportCoins = SupportAssetCoins | SupportMarketCoins | SupportStakeMarketCoins | SupportSCoin;
26
+ type SupportAssetCoins = SupportPoolCoins | SupportCollateralCoins | SupportStakeRewardCoins;
27
+ type SupportPoolCoins = (typeof SUPPORT_POOLS)[number];
28
+ type SupportCollateralCoins = (typeof SUPPORT_COLLATERALS)[number];
29
+ type SupportMarketCoins = ParseMarketCoins<SupportPoolCoins> | SupportStakeMarketCoins;
30
+ type SupportStakeMarketCoins = (typeof SUPPORT_SPOOLS)[number];
31
+ type SupportSuiBridgeCoins = (typeof SUPPORT_SUI_BRIDGE)[number];
32
+ type SupportWormholeCoins = (typeof SUPPORT_WORMHOLE)[number];
33
+ type SupportStakeCoins = Extract<SupportPoolCoins, ParseCoins<SupportStakeMarketCoins>>;
34
+ type SupportStakeRewardCoins = (typeof SUPPORT_SPOOLS_REWARDS)[number];
35
+ type SupportBorrowIncentiveCoins = (typeof SUPPORT_BORROW_INCENTIVE_POOLS)[number];
36
+ type SupportBorrowIncentiveRewardCoins = (typeof SUPPORT_BORROW_INCENTIVE_REWARDS)[number];
37
+ type SupportSCoin = (typeof SUPPORT_SCOIN)[number];
38
+ type SupportOracleType = (typeof SUPPORT_ORACLES)[number];
39
+ type SupportPackageType = (typeof SUPPORT_PACKAGES)[number];
40
+ type SupportCoinDecimals = Record<SupportCoins, number>;
41
+ type CoinWrappedType = {
42
+ from: string;
43
+ type: string;
44
+ } | undefined;
45
+
46
+ declare const COIN_GECKGO_IDS: Record<SupportPoolCoins, string>;
47
+
48
+ declare const API_BASE_URL: "https://sui.apis.scallop.io";
49
+ declare const SDK_API_BASE_URL: "https://sdk.api.scallop.io";
50
+ declare const IS_VE_SCA_TEST: boolean;
51
+ declare const USE_TEST_ADDRESS: boolean;
52
+ declare const ADDRESSES_ID: "65fb07c39c845425d71d7b18" | "67c44a103fe1b8c454eb9699";
53
+ declare const PROTOCOL_OBJECT_ID: "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" | "0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf";
54
+ declare const BORROW_FEE_PROTOCOL_ID: "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" | "0xc38f849e81cfe46d4e4320f508ea7dda42934a329d5a6571bb4c3cb6ea63f5da";
55
+ declare const SCA_COIN_TYPE: "0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA" | "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
56
+ declare const OLD_BORROW_INCENTIVE_PROTOCOL_ID: "0xc63072e7f5f4983a2efaf5bdba1480d5e7d74d57948e1c7cc436f8e22cbeb410";
57
+ declare const SUPPORT_POOLS: readonly ["usdc", "sbeth", "sbusdt", "sbwbtc", "weth", "wbtc", "wusdc", "wusdt", "sui", "wapt", "wsol", "cetus", "afsui", "hasui", "vsui", "sca", "fud", "deep", "fdusd", "blub", "musd", "ns", "usdy"];
58
+ declare const SUPPORT_COLLATERALS: readonly ["usdc", "sbeth", "sbusdt", "sbwbtc", "weth", "wbtc", "wusdc", "wusdt", "sui", "wapt", "wsol", "cetus", "afsui", "hasui", "vsui", "sca", "fdusd", "usdy"];
59
+ declare const SUPPORT_SPOOLS: readonly ["susdc", "sweth", "ssui", "swusdc", "swusdt", "scetus", "safsui", "shasui", "svsui"];
60
+ declare const SUPPORT_SCOIN: readonly ["susdc", "ssbeth", "ssbusdt", "ssbwbtc", "ssui", "swusdc", "swusdt", "safsui", "shasui", "svsui", "sweth", "ssca", "scetus", "swsol", "swbtc", "sdeep", "sfud", "sfdusd", "sblub", "smusd", "sns", "susdy"];
61
+ declare const SUPPORT_SUI_BRIDGE: readonly ["sbeth", "sbusdt", "sbwbtc"];
62
+ declare const SUPPORT_WORMHOLE: readonly ["wusdc", "wusdt", "weth", "wbtc", "wapt", "wsol"];
63
+ declare const SUPPORT_SPOOLS_REWARDS: readonly ["sui"];
64
+ declare const SUPPORT_BORROW_INCENTIVE_POOLS: readonly ["usdc", "sbeth", "sbusdt", "sbwbtc", "weth", "wbtc", "wusdc", "wusdt", "sui", "wapt", "wsol", "cetus", "afsui", "hasui", "vsui", "sca", "fud", "deep", "fdusd", "blub", "musd", "ns", "usdy"];
65
+ declare const SUPPORT_BORROW_INCENTIVE_REWARDS: readonly ["usdc", "sbeth", "sbusdt", "sbwbtc", "weth", "wbtc", "wusdc", "wusdt", "sui", "wapt", "wsol", "cetus", "afsui", "hasui", "vsui", "sca", "fud", "deep", "fdusd", "blub", "musd", "ns", "usdy", "susdc", "ssbeth", "ssbusdt", "ssbwbtc", "ssui", "swusdc", "swusdt", "safsui", "shasui", "svsui", "sweth", "ssca", "scetus", "swsol", "swbtc", "sdeep", "sfud", "sfdusd", "sblub", "smusd", "sns", "susdy"];
66
+ declare const SUPPORT_ORACLES: readonly ["supra", "switchboard", "pyth"];
67
+ declare const SUPPORT_PACKAGES: readonly ["coinDecimalsRegistry", "math", "whitelist", "x", "protocol", "protocolWhitelist", "query", "supra", "pyth", "switchboard", "xOracle", "testCoin"];
68
+
69
+ type QueryInspectTxnParams = {
70
+ queryTarget: string;
71
+ args: SuiObjectArg[];
72
+ typeArgs?: any[];
73
+ };
74
+ /**
75
+ * @description
76
+ * It provides caching for moveCall, RPC Request, and API Request.
77
+ *
78
+ *
79
+ * @example
80
+ * ```typescript
81
+ * const scallopCache = new scallopCache(<parameters>);
82
+ * scallopCache.<indexer functions>();
83
+ * await scallopCache.<indexer async functions>();
84
+ * ```
85
+ */
86
+ declare class ScallopCache {
87
+ readonly params: ScallopCacheParams;
88
+ queryClient: QueryClient;
89
+ suiKit: SuiKit;
90
+ walletAddress: string;
91
+ private tokensPerInterval;
92
+ private interval;
93
+ private tokens;
94
+ private lastRefill;
95
+ constructor(params?: ScallopCacheParams, instance?: ScallopCacheInstanceParams);
96
+ private get client();
97
+ private refill;
98
+ private removeTokens;
99
+ private callWithRateLimit;
100
+ /**
101
+ * @description Invalidate cache based on the refetchType parameter
102
+ * @param refetchType Determines the type of queries to be refetched. Defaults to `active`.
103
+ *
104
+ * - `active`: Only queries that match the refetch predicate and are actively being rendered via useQuery and related functions will be refetched in the background.
105
+ * - `inactive`: Only queries that match the refetch predicate and are NOT actively being rendered via useQuery and related functions will be refetched in the background.
106
+ * - `all`: All queries that match the refetch predicate will be refetched in the background.
107
+ * - `none`: No queries will be refetched. Queries that match the refetch predicate will only be marked as invalid.
108
+ */
109
+ private retryFn;
110
+ /**
111
+ * @description Provides cache for inspectTxn of the SuiKit.
112
+ * @param QueryInspectTxnParams
113
+ * @param txBlock
114
+ * @returns Promise<DevInspectResults>
115
+ */
116
+ queryInspectTxn({ queryTarget, args, typeArgs, }: QueryInspectTxnParams): Promise<DevInspectResults | null>;
117
+ queryGetNormalizedMoveFunction(target: string): Promise<_mysten_sui_dist_cjs_client.SuiMoveNormalizedFunction | null>;
118
+ /**
119
+ * @description Provides cache for getObject of the SuiKit.
120
+ * @param objectId
121
+ * @param QueryObjectParams
122
+ * @returns Promise<SuiObjectResponse>
123
+ */
124
+ queryGetObject(objectId: string, options?: SuiObjectDataOptions): Promise<SuiObjectResponse | null>;
125
+ /**
126
+ * @description Provides cache for getObjects of the SuiKit.
127
+ * @param objectIds
128
+ * @returns Promise<SuiObjectData[]>
129
+ */
130
+ queryGetObjects(objectIds: string[]): Promise<SuiObjectData[]>;
131
+ /**
132
+ * @description Provides cache for getOwnedObjects of the SuiKit.
133
+ * @param input
134
+ * @returns Promise<PaginatedObjectsResponse>
135
+ */
136
+ queryGetOwnedObjects(input: GetOwnedObjectsParams): Promise<_mysten_sui_dist_cjs_client.PaginatedObjectsResponse | null>;
137
+ queryGetDynamicFields(input: GetDynamicFieldsParams): Promise<DynamicFieldPage | null>;
138
+ queryGetDynamicFieldObject(input: GetDynamicFieldObjectParams): Promise<SuiObjectResponse | null>;
139
+ queryGetAllCoinBalances(owner: string): Promise<{
140
+ [k: string]: CoinBalance;
141
+ }>;
142
+ queryGetCoinBalance(input: GetBalanceParams): Promise<CoinBalance | null>;
143
+ }
144
+
145
+ /**
146
+ * @description
147
+ * It provides methods for managing addresses.
148
+ *
149
+ * @example
150
+ * ```typescript
151
+ * const scallopAddress = new ScallopAddress(<parameters>);
152
+ * scallopAddress.<address functions>();
153
+ * await scallopAddress.<address async functions>();
154
+ * ```
155
+ */
156
+ declare class ScallopAddress {
157
+ private readonly _auth?;
158
+ private readonly _requestClient;
159
+ private _id?;
160
+ private _network;
161
+ private _currentAddresses?;
162
+ private _addressesMap;
163
+ cache: ScallopCache;
164
+ constructor(params: ScallopAddressParams, instance?: ScallopAddressInstanceParams);
165
+ /**
166
+ * Get addresses API id.
167
+ *
168
+ * @return The addresses API id.
169
+ */
170
+ getId(): string | undefined;
171
+ /**
172
+ * Get the address at the provided path.
173
+ *
174
+ * @param path - The path of the address to get.
175
+ * @return The address at the provided path.
176
+ */
177
+ get(path: AddressStringPath): any;
178
+ /**
179
+ * Sets the address for the specified path, it does not interact with the API.
180
+ *
181
+ * @param path - The path of the address to set.
182
+ * @param address - The address be setted to the tartget path.
183
+ * @return The addresses.
184
+ */
185
+ set(path: AddressStringPath, address: string): AddressesInterface | undefined;
186
+ /**
187
+ * Synchronize the specified network addresses from the addresses map to the
188
+ * current addresses and change the default network to specified network.
189
+ *
190
+ * @param network - Specifies which network's addresses you want to get.
191
+ * @return Current addresses.
192
+ */
193
+ switchCurrentAddresses(network: NetworkType): AddressesInterface | undefined;
194
+ /**
195
+ * Get the addresses, If `network` is not provided, returns the current
196
+ * addresses or the default network addresses in the addresses map.
197
+ *
198
+ * @param network - Specifies which network's addresses you want to get.
199
+ */
200
+ getAddresses(network?: NetworkType): AddressesInterface | undefined;
201
+ /**
202
+ * Set the addresses into addresses map. If the specified network is the same
203
+ * as the current network, the current addresses will be updated at the same time.
204
+ *
205
+ * @param addresses - The addresses be setted to the tartget network.
206
+ * @param network - Specifies which network's addresses you want to set.
207
+ * @return The addresses.
208
+ */
209
+ setAddresses(addresses: AddressesInterface, network?: NetworkType): void;
210
+ /**
211
+ * Get all addresses.
212
+ *
213
+ * @return All addresses.
214
+ */
215
+ getAllAddresses(): {
216
+ [k: string]: AddressesInterface;
217
+ };
218
+ /**
219
+ * Create a new addresses through the API and synchronize it back to the
220
+ * instance.
221
+ *
222
+ * @description
223
+ * If the `network` is not specified, the mainnet is used by default.
224
+ * If no `addresses` from instance or parameter is provided, an addresses with
225
+ * all empty strings is created by default.
226
+ *
227
+ * This function only allows for one addresses to be input into a specific network
228
+ * at a time, and does not provide an addresses map for setting addresses
229
+ * across all networks at once.
230
+ *
231
+ * @param params.addresses - The addresses be setted to the tartget network.
232
+ * @param params.network - Specifies which network's addresses you want to set.
233
+ * @param params.auth - The authentication API key.
234
+ * @param params.memo - Add memo to the addresses created in the API.
235
+ * @return All addresses.
236
+ */
237
+ create(params?: {
238
+ addresses?: AddressesInterface | undefined;
239
+ network?: NetworkType | undefined;
240
+ auth?: string | undefined;
241
+ memo?: string | undefined;
242
+ }): Promise<{
243
+ [k: string]: AddressesInterface;
244
+ }>;
245
+ /**
246
+ * Read and synchronizes all addresses from the API into instance.
247
+ *
248
+ * @param id - The id of the addresses to get.
249
+ * @return All addresses.
250
+ */
251
+ read(id?: string): Promise<{
252
+ [k: string]: AddressesInterface;
253
+ }>;
254
+ /**
255
+ * Update the addresses through the API and synchronize it back to the
256
+ * instance.
257
+ *
258
+ * @description
259
+ * If the `network` is not specified, the mainnet is used by default.
260
+ * If no `addresses` from instance or parameter is provided, an addresses with
261
+ * all empty strings is created by default.
262
+ *
263
+ * This function only allows for one addresses to be input into a specific network
264
+ * at a time, and does not provide an addresses map for setting addresses
265
+ * across all networks at once.
266
+ *
267
+ * @param params.id - The id of the addresses to update.
268
+ * @param params.addresses - The addresses be setted to the tartget network.
269
+ * @param params.network - Specifies which network's addresses you want to set.
270
+ * @param params.auth - The authentication api key.
271
+ * @param params.memo - Add memo to the addresses created in the API.
272
+ * @return All addresses.
273
+ */
274
+ update(params?: {
275
+ id?: string;
276
+ addresses?: AddressesInterface | undefined;
277
+ network?: NetworkType | undefined;
278
+ auth?: string | undefined;
279
+ memo?: string | undefined;
280
+ }): Promise<{
281
+ [k: string]: AddressesInterface;
282
+ }>;
283
+ /**
284
+ * Deletes all addresses of a specified id through the API and clear all
285
+ * addresses in the instance.
286
+ *
287
+ * @param id - The id of the addresses to delete.
288
+ * @param auth - The authentication API key.
289
+ */
290
+ delete(id?: string, auth?: string): Promise<void>;
291
+ }
292
+
293
+ /**
294
+ * @description
295
+ * Integrates some helper functions frequently used in interactions with the Scallop contract.
296
+ *
297
+ * @example
298
+ * ```typescript
299
+ * const scallopUtils = new ScallopUtils(<parameters>);
300
+ * await scallopUtils.init();
301
+ * scallopUtils.<utils functions>();
302
+ * await scallopUtils.<utils functions>();
303
+ * ```
304
+ */
305
+ declare class ScallopUtils {
306
+ readonly params: ScallopUtilsParams;
307
+ readonly isTestnet: boolean;
308
+ suiKit: SuiKit;
309
+ address: ScallopAddress;
310
+ cache: ScallopCache;
311
+ walletAddress: string;
312
+ constructor(params: ScallopUtilsParams, instance?: ScallopUtilsInstanceParams);
313
+ isSuiBridgeAsset(coinName: any): coinName is SupportSuiBridgeCoins;
314
+ isWormholeAsset(coinName: any): coinName is SupportWormholeCoins;
315
+ /**
316
+ * Request the scallop API to initialize data.
317
+ *
318
+ * @param force - Whether to force initialization.
319
+ * @param address - ScallopAddress instance.
320
+ */
321
+ init(force?: boolean, address?: ScallopAddress): Promise<void>;
322
+ /**
323
+ * Convert coin name to symbol.
324
+ *
325
+ * @param coinName - Specific support coin name.
326
+ * @return Symbol string.
327
+ */
328
+ parseSymbol(coinName: SupportCoins): string;
329
+ /**
330
+ * Convert coin name to coin type.
331
+ *
332
+ * @description
333
+ * The Coin type of wormhole is fixed `coin:Coin`. Here using package id
334
+ * to determine and return the type.
335
+ *
336
+ * @param coinPackageId - Package id of coin.
337
+ * @param coinName - Specific support coin name.
338
+ * @return Coin type.
339
+ */
340
+ parseCoinType(coinName: SupportCoins, useOldMarketCoin?: boolean): string;
341
+ /**
342
+ * Convert coin name to sCoin name.
343
+ *
344
+ * @param coinName - Specific support coin name.
345
+ * @return sCoin name.
346
+ */
347
+ parseSCoinName<T extends SupportSCoin>(coinName: SupportCoins | SupportMarketCoins): T | undefined;
348
+ /**
349
+ * Convert sCoin name to market coin name.
350
+ * This function will parse new sCoin name `scallop_...` to its old market coin name which is shorter
351
+ * e.g: `scallop_sui -> ssui
352
+ * if no `scallop_...` is encountered, return coinName
353
+ * @return sCoin name
354
+ */
355
+ parseSCoinTypeNameToMarketCoinName(coinName: string): "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub" | "smusd" | "sns" | "susdy";
356
+ /**
357
+ * Convert sCoin name into sCoin type
358
+ * @param sCoinName
359
+ * @returns sCoin type
360
+ */
361
+ parseSCoinType(sCoinName: SupportSCoin): string;
362
+ /**
363
+ * Convert sCoinType into sCoin name
364
+ * @param sCoinType
365
+ * @returns sCoin name
366
+ */
367
+ parseSCoinNameFromType(sCoinType: string): "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub" | "smusd" | "sns" | "susdy";
368
+ /**
369
+ * Convert sCoin name into its underlying coin type
370
+ * @param sCoinName
371
+ * @returns coin type
372
+ */
373
+ parseUnderlyingSCoinType(sCoinName: SupportSCoin): string;
374
+ /**
375
+ * Get sCoin treasury id from sCoin name
376
+ * @param sCoinName
377
+ * @returns sCoin treasury id
378
+ */
379
+ getSCoinTreasury(sCoinName: SupportSCoin): any;
380
+ /**
381
+ * Convert coin name to market coin type.
382
+ *
383
+ * @param coinPackageId - Package id of coin.
384
+ * @param coinName - Specific support coin name.
385
+ * @return Market coin type.
386
+ */
387
+ parseMarketCoinType(coinName: SupportCoins): string;
388
+ /**
389
+ * Convert coin type to coin name.
390
+ *
391
+ * @description
392
+ * The coin name cannot be obtained directly from the wormhole type. Here
393
+ * the package id is used to determine and return a specific name.
394
+ *
395
+ * @param coinType - Specific support coin type.
396
+ * @return Coin Name.
397
+ */
398
+ parseCoinNameFromType<T extends SupportAssetCoins>(coinType: string): T extends SupportAssetCoins ? T : SupportAssetCoins;
399
+ parseCoinNameFromType<T extends SupportMarketCoins>(coinType: string): T extends SupportMarketCoins ? T : SupportMarketCoins;
400
+ parseCoinNameFromType<T extends SupportCoins>(coinType: string): T extends SupportCoins ? T : SupportCoins;
401
+ parseCoinNameFromType<T extends SupportSCoin>(coinType: string): T extends SupportSCoin ? T : SupportSCoin;
402
+ /**
403
+ * Convert market coin name to coin name.
404
+ *
405
+ * @param marketCoinName - Specific support market coin name.
406
+ * @return Coin Name.
407
+ */
408
+ parseCoinName<T extends SupportAssetCoins>(marketCoinName: string): T;
409
+ /**
410
+ * Convert coin name to market coin name.
411
+ *
412
+ * @param coinName - Specific support coin name.
413
+ * @return Market coin name.
414
+ */
415
+ parseMarketCoinName<T extends SupportMarketCoins>(coinName: SupportCoins): T;
416
+ /**
417
+ * Get reward type of spool.
418
+ *
419
+ * @param stakeMarketCoinName - Support stake market coin.
420
+ * @return Spool reward coin name.
421
+ */
422
+ getSpoolRewardCoinName: (stakeMarketCoinName: SupportStakeMarketCoins) => "sui";
423
+ /**
424
+ * Get coin decimal.
425
+ *
426
+ * return Coin decimal.
427
+ */
428
+ getCoinDecimal(coinName: SupportCoins): number;
429
+ /**
430
+ * Get coin wrapped type.
431
+ *
432
+ * return Coin wrapped type.
433
+ */
434
+ getCoinWrappedType(assetCoinName: SupportAssetCoins): CoinWrappedType;
435
+ /**
436
+ * Select coin id that add up to the given amount as transaction arguments.
437
+ *
438
+ * @param ownerAddress - The address of the owner.
439
+ * @param amount - The amount that including coin decimals.
440
+ * @param coinType - The coin type, default is 0x2::SUI::SUI.
441
+ * @return The selected transaction coin arguments.
442
+ */
443
+ selectCoins(amount: number, coinType?: string, ownerAddress?: string): Promise<{
444
+ objectId: string;
445
+ digest: string;
446
+ version: string;
447
+ balance: string;
448
+ }[]>;
449
+ /**
450
+ * Merge coins with type `coinType` to dest
451
+ * @param txBlock
452
+ * @param dest
453
+ * @param coinType
454
+ * @param sender
455
+ */
456
+ mergeSimilarCoins(txBlock: SuiTxBlock, dest: SuiObjectArg, coinType: string, sender?: string): Promise<void>;
457
+ /**
458
+ * Get all asset coin names in the obligation record by obligation id.
459
+ *
460
+ * @description
461
+ * This can often be used to determine which assets in an obligation require
462
+ * price updates before interacting with specific instructions of the Scallop contract.
463
+ *
464
+ * @param obligationId - The obligation id.
465
+ * @return Asset coin Names.
466
+ */
467
+ getObligationCoinNames(obligationId: SuiObjectArg): Promise<SupportAssetCoins[] | undefined>;
468
+ /**
469
+ * Get asset coin price.
470
+ *
471
+ * @description
472
+ * The strategy for obtaining the price is to get it through API first,
473
+ * and then on-chain data if API cannot be retrieved.
474
+ * Currently, we only support obtaining from pyth protocol, other
475
+ * oracles will be supported in the future.
476
+ *
477
+ * @param assetCoinNames - Specific an array of support asset coin name.
478
+ * @return Asset coin price.
479
+ */
480
+ getCoinPrices(_?: SupportAssetCoins[]): Promise<OptionalKeys<Record<SupportCoins, number>>>;
481
+ /**
482
+ * Convert apr to apy.
483
+ *
484
+ * @param apr The annual percentage rate (APR).
485
+ * @param compoundFrequency How often interest is compounded per year. Default is daily (365 times a year).
486
+ * @return The equivalent annual percentage yield (APY) for the given APR and compounding frequency.
487
+ */
488
+ parseAprToApy(apr: number, compoundFrequency?: number): number;
489
+ /**
490
+ * Convert apy to apr.
491
+ *
492
+ * @param apr The equivalent annual percentage yield (APY).
493
+ * @param compoundFrequency How often interest is compounded per year. Default is daily (365 times a year).
494
+ * @return The equivalent annual percentage rate (APR) for the given APY and compounding frequency.
495
+ */
496
+ parseApyToApr(apy: number, compoundFrequency?: number): number;
497
+ /**
498
+ * Give extend lock period to get unlock at in seconds timestamp.
499
+ *
500
+ * @description
501
+ * - When the user without remaining unlock period, If the extended unlock day is not specified,
502
+ * the unlock period will be increased by one day by default.
503
+ * - When the given extended day plus the user's remaining unlock period exceeds the maximum
504
+ * unlock period, the maximum unlock period is used as unlock period.
505
+ *
506
+ * @param extendLockPeriodInDay The extend lock period in day.
507
+ * @param unlockAtInSecondTimestamp The unlock timestamp from veSca object.
508
+ * @return New unlock at in seconds timestamp.
509
+ */
510
+ getUnlockAt(extendLockPeriodInDay?: number, unlockAtInMillisTimestamp?: number): number;
511
+ /**
512
+ * Get detailed contract address and price id information for supported pool in Scallop
513
+ * @returns Supported pool informations
514
+ */
515
+ getSupportedPoolAddresses(): PoolAddressInfo[];
516
+ }
517
+
518
+ /**
519
+ * @description
520
+ * It provides methods to obtain sdk index data from mainnet.
521
+ *
522
+ *
523
+ * @example
524
+ * ```typescript
525
+ * const scallopIndexer = new scallopIndexer(<parameters>);
526
+ * scallopIndexer.<indexer functions>();
527
+ * await scallopIndexer.<indexer async functions>();
528
+ * ```
529
+ */
530
+ declare class ScallopIndexer {
531
+ private readonly cache;
532
+ readonly params: ScallopQueryParams;
533
+ private readonly _requestClient;
534
+ constructor(params?: ScallopParams, instance?: ScallopIndexerInstanceParams);
535
+ /**
536
+ * Get market index data.
537
+ *
538
+ * @return Market data.
539
+ */
540
+ getMarket(): Promise<Pick<Market, 'pools' | 'collaterals'>>;
541
+ /**
542
+ * Get market pools index data.
543
+ *
544
+ * @return Market pools data.
545
+ */
546
+ getMarketPools(): Promise<Required<MarketPools>>;
547
+ /**
548
+ * Get market pool index data.
549
+ *
550
+ * @return Market pool data.
551
+ */
552
+ getMarketPool(poolCoinName: SupportPoolCoins): Promise<MarketPool>;
553
+ /**
554
+ * Get market collaterals index data.
555
+ *
556
+ * @return Market collaterals data.
557
+ */
558
+ getMarketCollaterals(): Promise<Required<MarketCollaterals>>;
559
+ /**
560
+ * Get market collateral index data.
561
+ *
562
+ * @return Market collateral data.
563
+ */
564
+ getMarketCollateral(collateralCoinName: SupportCollateralCoins): Promise<MarketCollateral>;
565
+ /**
566
+ * Get spools index data.
567
+ *
568
+ * @return Spools data.
569
+ */
570
+ getSpools(): Promise<Required<Spools>>;
571
+ /**
572
+ * Get spool index data.
573
+ *
574
+ * @return Spool data.
575
+ */
576
+ getSpool(marketCoinName: SupportStakeMarketCoins): Promise<Spool>;
577
+ /**
578
+ * Get borrow incentive pools index data.
579
+ *
580
+ * @return Borrow incentive pools data.
581
+ */
582
+ getBorrowIncentivePools(): Promise<Required<BorrowIncentivePools>>;
583
+ /**
584
+ * Get borrow incentive pool index data.
585
+ *
586
+ * @return Borrow incentive pool data.
587
+ */
588
+ getBorrowIncentivePool(borrowIncentiveCoinName: SupportBorrowIncentiveCoins): Promise<BorrowIncentivePool>;
589
+ /**
590
+ * Get total value locked index data.
591
+ *
592
+ * @return Total value locked.
593
+ */
594
+ getTotalValueLocked(): Promise<TotalValueLocked & {
595
+ totalValueChangeRatio: number;
596
+ borrowValueChangeRatio: number;
597
+ supplyValueChangeRatio: number;
598
+ }>;
599
+ /**
600
+ * Get coin price index data.
601
+ *
602
+ * @return price data.
603
+ */
604
+ getCoinPrice(poolCoinName: SupportPoolCoins): Promise<number>;
605
+ getCoinPrices(): Promise<Record<string, number>>;
606
+ }
607
+
608
+ /**
609
+ * @description
610
+ * It provides methods for getting on-chain data from the Scallop contract.
611
+ *
612
+ * @example
613
+ * ```typescript
614
+ * const scallopQuery = new ScallopQuery(<parameters>);
615
+ * await scallopQuery.init();
616
+ * scallopQuery.<query functions>();
617
+ * await scallopQuery.<query functions>();
618
+ * ```
619
+ */
620
+ declare class ScallopQuery {
621
+ readonly params: ScallopQueryParams;
622
+ suiKit: SuiKit;
623
+ address: ScallopAddress;
624
+ utils: ScallopUtils;
625
+ indexer: ScallopIndexer;
626
+ cache: ScallopCache;
627
+ walletAddress: string;
628
+ constructor(params?: ScallopQueryParams, instance?: ScallopQueryInstanceParams);
629
+ /**
630
+ * Request the scallop API to initialize data.
631
+ *
632
+ * @param force - Whether to force initialization.
633
+ * @param address - ScallopAddress instance.
634
+ */
635
+ init(force?: boolean, address?: ScallopAddress): Promise<void>;
636
+ /**
637
+ * @deprecated use getMarketPools
638
+ * Query market data.
639
+ * @param indexer - Whether to use indexer.
640
+ * @return Market data.
641
+ */
642
+ queryMarket(args?: {
643
+ coinPrices?: CoinPrices;
644
+ indexer?: boolean;
645
+ }): Promise<Market>;
646
+ /**
647
+ * Get market pools.
648
+ *
649
+ * @description
650
+ * To obtain all market pools at once, it is recommended to use
651
+ * the `queryMarket` method to reduce time consumption.
652
+ *
653
+ * @param poolCoinNames - Specific an array of support pool coin name.
654
+ * @param indexer - Whether to use indexer.
655
+ * @return Market pools data.
656
+ */
657
+ getMarketPools(poolCoinNames?: SupportPoolCoins[], args?: {
658
+ coinPrices?: CoinPrices;
659
+ indexer?: boolean;
660
+ }): Promise<{
661
+ pools: MarketPools;
662
+ collaterals: MarketCollaterals;
663
+ }>;
664
+ /**
665
+ * Get market pool
666
+ *
667
+ * @param poolCoinName - Specific support pool coin name.
668
+ * @param indexer - Whether to use indexer.
669
+ * @return Market pool data.
670
+ */
671
+ getMarketPool(poolCoinName: SupportPoolCoins, args?: {
672
+ coinPrice?: number;
673
+ indexer?: boolean;
674
+ }): Promise<MarketPool | undefined>;
675
+ /**
676
+ * Get market collaterals.
677
+ *
678
+ * @description
679
+ * To obtain all market collaterals at once, it is recommended to use
680
+ * the `queryMarket` method to reduce time consumption.
681
+ *
682
+ * @param collateralCoinNames - Specific an array of support collateral coin name.
683
+ * @param indexer - Whether to use indexer.
684
+ * @return Market collaterals data.
685
+ */
686
+ getMarketCollaterals(collateralCoinNames?: SupportCollateralCoins[], args?: {
687
+ indexer?: boolean;
688
+ }): Promise<{
689
+ usdc?: MarketCollateral | undefined;
690
+ sbeth?: MarketCollateral | undefined;
691
+ sbusdt?: MarketCollateral | undefined;
692
+ sbwbtc?: MarketCollateral | undefined;
693
+ weth?: MarketCollateral | undefined;
694
+ wbtc?: MarketCollateral | undefined;
695
+ wusdc?: MarketCollateral | undefined;
696
+ wusdt?: MarketCollateral | undefined;
697
+ sui?: MarketCollateral | undefined;
698
+ wapt?: MarketCollateral | undefined;
699
+ wsol?: MarketCollateral | undefined;
700
+ cetus?: MarketCollateral | undefined;
701
+ afsui?: MarketCollateral | undefined;
702
+ hasui?: MarketCollateral | undefined;
703
+ vsui?: MarketCollateral | undefined;
704
+ sca?: MarketCollateral | undefined;
705
+ fdusd?: MarketCollateral | undefined;
706
+ usdy?: MarketCollateral | undefined;
707
+ }>;
708
+ /**
709
+ * Get market collateral
710
+ *
711
+ * @param collateralCoinName - Specific support collateral coin name.
712
+ * @param indexer - Whether to use indexer.
713
+ * @return Market collateral data.
714
+ */
715
+ getMarketCollateral(collateralCoinName: SupportCollateralCoins, args?: {
716
+ indexer?: boolean;
717
+ }): Promise<MarketCollateral | undefined>;
718
+ /**
719
+ * Get obligations data.
720
+ *
721
+ * @param ownerAddress - The owner address.
722
+ * @return Obligations data.
723
+ */
724
+ getObligations(ownerAddress?: string): Promise<Obligation[]>;
725
+ /**
726
+ * Query obligation data.
727
+ *
728
+ * @param obligationId - The obligation id.
729
+ * @return Obligation data.
730
+ */
731
+ queryObligation(obligationId: SuiObjectArg): Promise<ObligationQueryInterface | undefined>;
732
+ /**
733
+ * Get all asset coin amounts.
734
+ *
735
+ * @param assetCoinNames - Specific an array of support asset coin name.
736
+ * @param ownerAddress - The owner address.
737
+ * @return All coin amounts.
738
+ */
739
+ getCoinAmounts(assetCoinNames?: SupportAssetCoins[], ownerAddress?: string): Promise<OptionalKeys<Record<SupportAssetCoins, number>>>;
740
+ /**
741
+ * Get asset coin amount.
742
+ *
743
+ * @param assetCoinName - Specific support asset coin name.
744
+ * @param ownerAddress - The owner address.
745
+ * @return Coin amount.
746
+ */
747
+ getCoinAmount(assetCoinName: SupportAssetCoins, ownerAddress?: string): Promise<number>;
748
+ /**
749
+ * Get all market coin amounts.
750
+ *
751
+ * @param coinNames - Specific an array of support market coin name.
752
+ * @param ownerAddress - The owner address.
753
+ * @return All market market coin amounts.
754
+ */
755
+ getMarketCoinAmounts(marketCoinNames?: SupportMarketCoins[], ownerAddress?: string): Promise<OptionalKeys<Record<SupportMarketCoins, number>>>;
756
+ /**
757
+ * Get market coin amount.
758
+ *
759
+ * @param coinNames - Specific support market coin name.
760
+ * @param ownerAddress - The owner address.
761
+ * @return Market market coin amount.
762
+ */
763
+ getMarketCoinAmount(marketCoinName: SupportMarketCoins, ownerAddress?: string): Promise<number>;
764
+ /**
765
+ * Get price from pyth fee object.
766
+ *
767
+ * @param assetCoinName - Specific support asset coin name.
768
+ * @return Asset coin price.
769
+ */
770
+ getPriceFromPyth(assetCoinName: SupportAssetCoins): Promise<number>;
771
+ /**
772
+ * Get prices from pyth fee object.
773
+ *
774
+ * @param assetCoinNames - Array of supported asset coin names.
775
+ * @return Array of asset coin prices.
776
+ */
777
+ getPricesFromPyth(assetCoinNames: SupportAssetCoins[]): Promise<Record<SupportAssetCoins, number>>;
778
+ /**
779
+ * Get spools data.
780
+ *
781
+ * @param stakeMarketCoinNames - Specific an array of support stake market coin name.
782
+ * @param indexer - Whether to use indexer.
783
+ * @return Spools data.
784
+ */
785
+ getSpools(stakeMarketCoinNames?: SupportStakeMarketCoins[], args?: {
786
+ marketPools?: MarketPools;
787
+ coinPrices?: CoinPrices;
788
+ indexer?: boolean;
789
+ }): Promise<{
790
+ susdc?: Spool | undefined;
791
+ sweth?: Spool | undefined;
792
+ swusdc?: Spool | undefined;
793
+ swusdt?: Spool | undefined;
794
+ ssui?: Spool | undefined;
795
+ scetus?: Spool | undefined;
796
+ safsui?: Spool | undefined;
797
+ shasui?: Spool | undefined;
798
+ svsui?: Spool | undefined;
799
+ }>;
800
+ /**
801
+ * Get spool data.
802
+ *
803
+ * @param stakeMarketCoinName - Specific support stake market coin name.
804
+ * @param indexer - Whether to use indexer.
805
+ * @return Spool data.
806
+ */
807
+ getSpool(stakeMarketCoinName: SupportStakeMarketCoins, args?: {
808
+ marketPool?: MarketPool;
809
+ coinPrices?: CoinPrices;
810
+ indexer?: boolean;
811
+ }): Promise<Spool | undefined>;
812
+ /**
813
+ * Get stake accounts data for all stake pools (spools).
814
+ *
815
+ * @param ownerAddress - The owner address.
816
+ * @return All Stake accounts data.
817
+ */
818
+ getAllStakeAccounts(ownerAddress?: string): Promise<StakeAccounts>;
819
+ /**
820
+ * Get stake accounts data for specific stake pool (spool).
821
+ *
822
+ * @param stakeMarketCoinName - Specific support stake market coin name.
823
+ * @param ownerAddress - The owner address.
824
+ * @return Stake accounts data.
825
+ */
826
+ getStakeAccounts(stakeMarketCoinName: SupportStakeMarketCoins, ownerAddress?: string): Promise<StakeAccount[]>;
827
+ /**
828
+ * Get stake pools (spools) data.
829
+ *
830
+ * @description
831
+ * For backward compatible, it is recommended to use `getSpools` method
832
+ * to get all spools data.
833
+ *
834
+ * @param stakeMarketCoinNames - Specific an array of support stake market coin name.
835
+ * @return Stake pools data.
836
+ */
837
+ getStakePools(stakeMarketCoinNames?: SupportStakeMarketCoins[]): Promise<{
838
+ susdc?: StakePool | undefined;
839
+ sweth?: StakePool | undefined;
840
+ swusdc?: StakePool | undefined;
841
+ swusdt?: StakePool | undefined;
842
+ ssui?: StakePool | undefined;
843
+ scetus?: StakePool | undefined;
844
+ safsui?: StakePool | undefined;
845
+ shasui?: StakePool | undefined;
846
+ svsui?: StakePool | undefined;
847
+ }>;
848
+ /**
849
+ * Get stake pool (spool) data.
850
+ *
851
+ * @description
852
+ * For backward compatible, it is recommended to use `getSpool` method
853
+ * to get all spool data.
854
+ *
855
+ * @param stakeMarketCoinName - Specific support stake market coin name.
856
+ * @return Stake pool data.
857
+ */
858
+ getStakePool(stakeMarketCoinName: SupportStakeMarketCoins): Promise<StakePool | undefined>;
859
+ /**
860
+ * Get stake reward pools data.
861
+ *
862
+ * @description
863
+ * For backward compatible, it is recommended to use `getSpools` method
864
+ * to get all spools data.
865
+ *
866
+ * @param stakeMarketCoinNames - Specific an array of stake market coin name.
867
+ * @return Stake reward pools data.
868
+ */
869
+ getStakeRewardPools(stakeMarketCoinNames?: SupportStakeMarketCoins[]): Promise<{
870
+ susdc?: StakeRewardPool | undefined;
871
+ sweth?: StakeRewardPool | undefined;
872
+ swusdc?: StakeRewardPool | undefined;
873
+ swusdt?: StakeRewardPool | undefined;
874
+ ssui?: StakeRewardPool | undefined;
875
+ scetus?: StakeRewardPool | undefined;
876
+ safsui?: StakeRewardPool | undefined;
877
+ shasui?: StakeRewardPool | undefined;
878
+ svsui?: StakeRewardPool | undefined;
879
+ }>;
880
+ /**
881
+ * Get stake reward pool data.
882
+ *
883
+ * @description
884
+ * For backward compatible, it is recommended to use `getSpool` method
885
+ * to get spool data.
886
+ *
887
+ * @param marketCoinName - Specific support stake market coin name.
888
+ * @return Stake reward pool data.
889
+ */
890
+ getStakeRewardPool(stakeMarketCoinName: SupportStakeMarketCoins): Promise<StakeRewardPool | undefined>;
891
+ /**
892
+ * Get borrow incentive pools data.
893
+ *
894
+ * @param coinNames - Specific an array of support borrow incentive coin name.
895
+ * @param indexer - Whether to use indexer.
896
+ * @return Borrow incentive pools data.
897
+ */
898
+ getBorrowIncentivePools(coinNames?: SupportBorrowIncentiveCoins[], args?: {
899
+ coinPrices?: CoinPrices;
900
+ indexer?: boolean;
901
+ marketPools?: MarketPools;
902
+ }): Promise<{
903
+ usdc?: BorrowIncentivePool | undefined;
904
+ sbeth?: BorrowIncentivePool | undefined;
905
+ sbusdt?: BorrowIncentivePool | undefined;
906
+ sbwbtc?: BorrowIncentivePool | undefined;
907
+ weth?: BorrowIncentivePool | undefined;
908
+ wbtc?: BorrowIncentivePool | undefined;
909
+ wusdc?: BorrowIncentivePool | undefined;
910
+ wusdt?: BorrowIncentivePool | undefined;
911
+ sui?: BorrowIncentivePool | undefined;
912
+ wapt?: BorrowIncentivePool | undefined;
913
+ wsol?: BorrowIncentivePool | undefined;
914
+ cetus?: BorrowIncentivePool | undefined;
915
+ afsui?: BorrowIncentivePool | undefined;
916
+ hasui?: BorrowIncentivePool | undefined;
917
+ vsui?: BorrowIncentivePool | undefined;
918
+ sca?: BorrowIncentivePool | undefined;
919
+ fud?: BorrowIncentivePool | undefined;
920
+ deep?: BorrowIncentivePool | undefined;
921
+ fdusd?: BorrowIncentivePool | undefined;
922
+ blub?: BorrowIncentivePool | undefined;
923
+ musd?: BorrowIncentivePool | undefined;
924
+ ns?: BorrowIncentivePool | undefined;
925
+ usdy?: BorrowIncentivePool | undefined;
926
+ }>;
927
+ /**
928
+ * Get borrow incentive accounts data.
929
+ *
930
+ * @param coinNames - Specific support borrow incentive coin name.
931
+ * @param ownerAddress - The owner address.
932
+ * @return Borrow incentive accounts data.
933
+ */
934
+ getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef, coinNames?: SupportBorrowIncentiveCoins[]): Promise<{
935
+ usdc?: ParsedBorrowIncentiveAccountData | undefined;
936
+ sbeth?: ParsedBorrowIncentiveAccountData | undefined;
937
+ sbusdt?: ParsedBorrowIncentiveAccountData | undefined;
938
+ sbwbtc?: ParsedBorrowIncentiveAccountData | undefined;
939
+ weth?: ParsedBorrowIncentiveAccountData | undefined;
940
+ wbtc?: ParsedBorrowIncentiveAccountData | undefined;
941
+ wusdc?: ParsedBorrowIncentiveAccountData | undefined;
942
+ wusdt?: ParsedBorrowIncentiveAccountData | undefined;
943
+ sui?: ParsedBorrowIncentiveAccountData | undefined;
944
+ wapt?: ParsedBorrowIncentiveAccountData | undefined;
945
+ wsol?: ParsedBorrowIncentiveAccountData | undefined;
946
+ cetus?: ParsedBorrowIncentiveAccountData | undefined;
947
+ afsui?: ParsedBorrowIncentiveAccountData | undefined;
948
+ hasui?: ParsedBorrowIncentiveAccountData | undefined;
949
+ vsui?: ParsedBorrowIncentiveAccountData | undefined;
950
+ sca?: ParsedBorrowIncentiveAccountData | undefined;
951
+ fud?: ParsedBorrowIncentiveAccountData | undefined;
952
+ deep?: ParsedBorrowIncentiveAccountData | undefined;
953
+ fdusd?: ParsedBorrowIncentiveAccountData | undefined;
954
+ blub?: ParsedBorrowIncentiveAccountData | undefined;
955
+ musd?: ParsedBorrowIncentiveAccountData | undefined;
956
+ ns?: ParsedBorrowIncentiveAccountData | undefined;
957
+ usdy?: ParsedBorrowIncentiveAccountData | undefined;
958
+ }>;
959
+ /**
960
+ * Get user lending and spool infomation for specific pools.
961
+ *
962
+ * @param poolCoinNames - Specific an array of support pool coin name.
963
+ * @param ownerAddress - The owner address.
964
+ * @param indexer - Whether to use indexer.
965
+ * @return All lending and spool infomation.
966
+ */
967
+ getLendings(poolCoinNames?: SupportPoolCoins[], ownerAddress?: string, args?: {
968
+ indexer?: boolean;
969
+ marketPools?: MarketPools;
970
+ coinPrices?: CoinPrices;
971
+ }): Promise<{
972
+ usdc?: Lending | undefined;
973
+ sbeth?: Lending | undefined;
974
+ sbusdt?: Lending | undefined;
975
+ sbwbtc?: Lending | undefined;
976
+ weth?: Lending | undefined;
977
+ wbtc?: Lending | undefined;
978
+ wusdc?: Lending | undefined;
979
+ wusdt?: Lending | undefined;
980
+ sui?: Lending | undefined;
981
+ wapt?: Lending | undefined;
982
+ wsol?: Lending | undefined;
983
+ cetus?: Lending | undefined;
984
+ afsui?: Lending | undefined;
985
+ hasui?: Lending | undefined;
986
+ vsui?: Lending | undefined;
987
+ sca?: Lending | undefined;
988
+ fud?: Lending | undefined;
989
+ deep?: Lending | undefined;
990
+ fdusd?: Lending | undefined;
991
+ blub?: Lending | undefined;
992
+ musd?: Lending | undefined;
993
+ ns?: Lending | undefined;
994
+ usdy?: Lending | undefined;
995
+ }>;
996
+ /**
997
+ * Get user lending and spool information for specific pool.
998
+ *
999
+ * @param poolCoinName - Specific support pool coin name.
1000
+ * @param ownerAddress - The owner address.
1001
+ * @param indexer - Whether to use indexer.
1002
+ * @return Lending pool data.
1003
+ */
1004
+ getLending(poolCoinName: SupportPoolCoins, ownerAddress?: string, args?: {
1005
+ indexer?: boolean;
1006
+ }): Promise<Lending>;
1007
+ /**
1008
+ * Get user all obligation accounts information.
1009
+ *
1010
+ * @description
1011
+ * All collateral and borrowing information in all obligation accounts owned by the user.
1012
+ *
1013
+ * @param ownerAddress - The owner address.
1014
+ * @param indexer - Whether to use indexer.
1015
+ * @return All obligation accounts information.
1016
+ */
1017
+ getObligationAccounts(ownerAddress?: string, args?: {
1018
+ indexer?: boolean;
1019
+ market?: {
1020
+ collaterals: MarketCollaterals;
1021
+ pools: MarketPools;
1022
+ };
1023
+ coinPrices?: CoinPrices;
1024
+ }): Promise<{
1025
+ [x: string]: ObligationAccount | undefined;
1026
+ }>;
1027
+ /**
1028
+ * Get obligation account information for specific id.
1029
+ *
1030
+ * @description
1031
+ * borrowing and obligation information for specific pool.
1032
+ *
1033
+ * @param obligationId - The obligation id.
1034
+ * @param ownerAddress - The owner address.
1035
+ * @param indexer - Whether to use indexer.
1036
+ * @return Borrowing and collateral information.
1037
+ */
1038
+ getObligationAccount(obligationId: string, ownerAddress?: string, args?: {
1039
+ indexer?: boolean;
1040
+ }): Promise<ObligationAccount | undefined>;
1041
+ /**
1042
+ * Get total value locked.
1043
+ *
1044
+ * @param indexer - Whether to use indexer.
1045
+ * @description
1046
+ * Include total supplied value and total borrowed value.
1047
+ *
1048
+ * @return Total value locked.
1049
+ */
1050
+ getTvl(args?: {
1051
+ indexer?: boolean;
1052
+ }): Promise<TotalValueLocked>;
1053
+ /**
1054
+ * Get veSca data.
1055
+ * @param veScaKey
1056
+ * @returns veSca
1057
+ */
1058
+ getVeSca(veScaKey: string | SuiObjectData): Promise<Vesca | undefined>;
1059
+ /**
1060
+ * Get all veSca from walletAdddress
1061
+ * @param walletAddress
1062
+ * @returns array of veSca
1063
+ */
1064
+ getVeScas({ walletAddress, excludeEmpty, }?: {
1065
+ walletAddress?: string;
1066
+ excludeEmpty?: boolean;
1067
+ }): Promise<Vesca[]>;
1068
+ /**
1069
+ * Get total vesca treasury with movecall
1070
+ * @returns Promise<string | undefined>
1071
+ */
1072
+ getVeScaTreasuryInfo(): Promise<VeScaTreasuryInfo | null>;
1073
+ /**
1074
+ * Return binded referrer veScaKeyId of referee walletAddress if exist
1075
+ * @param walletAddress
1076
+ * @returns veScaKeyId
1077
+ */
1078
+ getVeScaKeyIdFromReferralBindings(walletAddress?: string): Promise<string | null>;
1079
+ /**
1080
+ * Get binded obligationId from a veScaKey if it exists.
1081
+ * @param veScaKey
1082
+ * @returns obligationId
1083
+ */
1084
+ getBindedObligationId(veScaKey: string): Promise<string | null>;
1085
+ /**
1086
+ * Get binded veSCA key from a obligationId if it exists.
1087
+ * @param obligationId
1088
+ * @returns veScaKey
1089
+ */
1090
+ getBindedVeScaKey(obligationId: string): Promise<string | null>;
1091
+ /**
1092
+ * Get user's veSCA loyalty program informations
1093
+ * @param walletAddress
1094
+ * @returns Loyalty program information
1095
+ */
1096
+ getLoyaltyProgramInfos(veScaKey?: string | SuiObjectData): Promise<LoyaltyProgramInfo | null>;
1097
+ /**
1098
+ * Get total supply of sCoin
1099
+ * @param sCoinName - Supported sCoin name
1100
+ * @returns Total Supply
1101
+ */
1102
+ getSCoinTotalSupply(sCoinName: SupportSCoin): Promise<number>;
1103
+ /**
1104
+ * Get all sCoin amounts.
1105
+ *
1106
+ * @param sCoinNames - Specific an array of support sCoin name.
1107
+ * @param ownerAddress - The owner address.
1108
+ * @return All market sCoin amounts.
1109
+ */
1110
+ getSCoinAmounts(sCoinNames?: SupportSCoin[], ownerAddress?: string): Promise<OptionalKeys<Record<"susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub" | "smusd" | "sns" | "susdy", number>>>;
1111
+ /**
1112
+ * Get sCoin amount.
1113
+ *
1114
+ * @param coinNames - Specific support sCoin name.
1115
+ * @param ownerAddress - The owner address.
1116
+ * @return sCoin amount.
1117
+ */
1118
+ getSCoinAmount(sCoinName: SupportSCoin | SupportMarketCoins, ownerAddress?: string): Promise<number>;
1119
+ /**
1120
+ * Get swap rate from sCoin A to sCoin B
1121
+ * @param assetCoinNames
1122
+ * @returns
1123
+ */
1124
+ getSCoinSwapRate(fromSCoin: SupportSCoin, toSCoin: SupportSCoin): Promise<number>;
1125
+ getFlashLoanFees(assetCoinNames?: SupportAssetCoins[]): Promise<Record<"usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub" | "musd" | "ns" | "usdy", number>>;
1126
+ /**
1127
+ * Get supply limit of lending pool
1128
+ */
1129
+ getPoolSupplyLimit(poolName: SupportPoolCoins): Promise<string | null>;
1130
+ /**
1131
+ * Get borrow limit of borrow pool
1132
+ */
1133
+ getPoolBorrowLimit(poolName: SupportPoolCoins): Promise<string | null>;
1134
+ /**
1135
+ * Get list of isolated assets
1136
+ */
1137
+ getIsolatedAssets(): Promise<string[]>;
1138
+ /**
1139
+ * Check if asset is an isolated asset
1140
+ */
1141
+ isIsolatedAsset(assetCoinName: SupportAssetCoins): Promise<boolean>;
1142
+ /**
1143
+ * Get pool coin price from indexer
1144
+ * @param coinName
1145
+ * @returns price data
1146
+ */
1147
+ getCoinPriceByIndexer(poolName: SupportPoolCoins): Promise<number>;
1148
+ /**
1149
+ * Get all supported pool price from indexer
1150
+ * @returns prices data
1151
+ */
1152
+ getCoinPricesByIndexer(): Promise<Record<string, number>>;
1153
+ /**
1154
+ * Get all coin prices, including sCoin
1155
+ * @returns prices data
1156
+ */
1157
+ getAllCoinPrices(args?: {
1158
+ marketPools?: MarketPools;
1159
+ coinPrices?: CoinPrices;
1160
+ indexer?: boolean;
1161
+ }): Promise<{
1162
+ susdc?: number | undefined;
1163
+ ssbeth?: number | undefined;
1164
+ ssbusdt?: number | undefined;
1165
+ ssbwbtc?: number | undefined;
1166
+ sweth?: number | undefined;
1167
+ swbtc?: number | undefined;
1168
+ swusdc?: number | undefined;
1169
+ swusdt?: number | undefined;
1170
+ ssui?: number | undefined;
1171
+ swsol?: number | undefined;
1172
+ scetus?: number | undefined;
1173
+ safsui?: number | undefined;
1174
+ shasui?: number | undefined;
1175
+ svsui?: number | undefined;
1176
+ ssca?: number | undefined;
1177
+ sfud?: number | undefined;
1178
+ sdeep?: number | undefined;
1179
+ sfdusd?: number | undefined;
1180
+ sblub?: number | undefined;
1181
+ smusd?: number | undefined;
1182
+ sns?: number | undefined;
1183
+ susdy?: number | undefined;
1184
+ usdc?: number | undefined;
1185
+ sbeth?: number | undefined;
1186
+ sbusdt?: number | undefined;
1187
+ sbwbtc?: number | undefined;
1188
+ weth?: number | undefined;
1189
+ wbtc?: number | undefined;
1190
+ wusdc?: number | undefined;
1191
+ wusdt?: number | undefined;
1192
+ sui?: number | undefined;
1193
+ wapt?: number | undefined;
1194
+ wsol?: number | undefined;
1195
+ cetus?: number | undefined;
1196
+ afsui?: number | undefined;
1197
+ hasui?: number | undefined;
1198
+ vsui?: number | undefined;
1199
+ sca?: number | undefined;
1200
+ fud?: number | undefined;
1201
+ deep?: number | undefined;
1202
+ fdusd?: number | undefined;
1203
+ blub?: number | undefined;
1204
+ musd?: number | undefined;
1205
+ ns?: number | undefined;
1206
+ usdy?: number | undefined;
1207
+ swapt?: number | undefined;
1208
+ }>;
1209
+ /**
1210
+ * Query all address (lending pool, collateral pool, borrow dynamics, interest models, etc.) of all pool
1211
+ * @returns
1212
+ */
1213
+ getPoolAddresses(pools?: SupportPoolCoins[]): Promise<OptionalKeys<Record<"usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub" | "musd" | "ns" | "usdy", {
1214
+ coinName: string;
1215
+ symbol: string;
1216
+ lendingPoolAddress?: string;
1217
+ collateralPoolAddress?: string;
1218
+ borrowDynamic?: string;
1219
+ spoolReward?: string;
1220
+ spool?: string;
1221
+ sCoinType?: string;
1222
+ sCoinName?: string;
1223
+ sCoinSymbol?: string;
1224
+ sCoinTreasury?: string;
1225
+ interestModel?: string;
1226
+ riskModel?: string;
1227
+ borrowFeeKey?: string;
1228
+ supplyLimitKey?: string;
1229
+ borrowLimitKey?: string;
1230
+ isolatedAssetKey?: string;
1231
+ coinMetadataId?: string;
1232
+ borrowIncentivePoolId?: string;
1233
+ coinType?: string;
1234
+ sCoinMetadataId?: string;
1235
+ spoolName?: string;
1236
+ decimals: number;
1237
+ pythFeed?: string;
1238
+ pythFeedObjectId?: string;
1239
+ }>>>;
1240
+ /**
1241
+ * Get user portfolio
1242
+ */
1243
+ getUserPortfolio(args?: {
1244
+ walletAddress?: string;
1245
+ indexer?: boolean;
1246
+ }): Promise<{
1247
+ totalLockedScaValue: number;
1248
+ lendings: {
1249
+ suppliedCoin: number;
1250
+ suppliedValue: number;
1251
+ stakedCoin: number;
1252
+ coinName: "usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub" | "musd" | "ns" | "usdy";
1253
+ symbol: string;
1254
+ coinType: string;
1255
+ coinPrice: number;
1256
+ coinDecimals: number;
1257
+ supplyApr: number;
1258
+ supplyApy: number;
1259
+ incentiveApr: number;
1260
+ }[];
1261
+ borrowings: {
1262
+ obligationId: string;
1263
+ totalDebtsInUsd: number;
1264
+ totalCollateralInUsd: number;
1265
+ riskLevel: number;
1266
+ availableCollateralInUsd: number;
1267
+ totalUnhealthyCollateralInUsd: number;
1268
+ borrowedPools: {
1269
+ coinName: "usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub" | "musd" | "ns" | "usdy";
1270
+ symbol: string;
1271
+ coinDecimals: number;
1272
+ coinType: string;
1273
+ coinPrice: number;
1274
+ borrowedCoin: number;
1275
+ borrowedValueInUsd: number;
1276
+ borrowApr: number | undefined;
1277
+ borrowApy: number | undefined;
1278
+ incentiveInfos: {
1279
+ coinName: "usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub" | "musd" | "ns" | "usdy" | "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub" | "smusd" | "sns" | "susdy";
1280
+ symbol: string;
1281
+ coinType: string;
1282
+ incentiveApr: number;
1283
+ }[];
1284
+ }[];
1285
+ }[];
1286
+ pendingRewards: {
1287
+ lendings: any;
1288
+ borrowIncentives: any;
1289
+ };
1290
+ veScas: {
1291
+ veScaKey: string;
1292
+ coinPrice: number;
1293
+ lockedScaInCoin: number;
1294
+ lockedScaInUsd: number;
1295
+ currentVeScaBalance: number;
1296
+ remainingLockPeriodInDays: number;
1297
+ unlockAt: number;
1298
+ }[];
1299
+ totalDebtValue: number;
1300
+ totalCollateralValue: number;
1301
+ totalSupplyValue: number;
1302
+ }>;
1303
+ /**
1304
+ * Get both primary and secondary price update policy objects
1305
+ * @returns price update policies
1306
+ */
1307
+ getPriceUpdatePolicies(): Promise<{
1308
+ primary: _mysten_sui_dist_cjs_client.SuiObjectResponse | null;
1309
+ secondary: _mysten_sui_dist_cjs_client.SuiObjectResponse | null;
1310
+ }>;
1311
+ /**
1312
+ * Return the supported primary and secondary oracles for all supported pool assets
1313
+ * @returns
1314
+ */
1315
+ getAssetOracles(): Promise<Record<SupportAssetCoins, xOracleRules>>;
1316
+ }
1317
+
1318
+ /**
1319
+ * @description
1320
+ * It provides methods for operating the transaction block, making it more convenient to organize transaction combinations.
1321
+ *
1322
+ * @example
1323
+ * ```typescript
1324
+ * const scallopBuilder = new ScallopBuilder(<parameters>);
1325
+ * await scallopBuilder.init();
1326
+ * const txBlock = scallopBuilder.<builder functions>();
1327
+ * ```
1328
+ */
1329
+ declare class ScallopBuilder {
1330
+ readonly params: ScallopBuilderParams;
1331
+ readonly isTestnet: boolean;
1332
+ suiKit: SuiKit;
1333
+ address: ScallopAddress;
1334
+ query: ScallopQuery;
1335
+ utils: ScallopUtils;
1336
+ walletAddress: string;
1337
+ cache: ScallopCache;
1338
+ constructor(params?: ScallopBuilderParams, instance?: ScallopBuilderInstanceParams);
1339
+ /**
1340
+ * Request the scallop API to initialize data.
1341
+ *
1342
+ * @param force - Whether to force initialization.
1343
+ * @param address - ScallopAddress instance.
1344
+ */
1345
+ init(force?: boolean, address?: ScallopAddress): Promise<void>;
1346
+ /**
1347
+ * Create a scallop txBlock instance that enhances transaction block.
1348
+ *
1349
+ * @param txBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
1350
+ * @return Scallop txBlock.
1351
+ */
1352
+ createTxBlock(txBlock?: ScallopTxBlock | SuiTxBlock | Transaction): ScallopTxBlock;
1353
+ /**
1354
+ * Specifying the sender's amount of coins to get coins args from transaction result.
1355
+ *
1356
+ * @param txBlock - Scallop txBlock or txBlock created by SuiKit .
1357
+ * @param assetCoinName - Specific support asset coin name.
1358
+ * @param amount - Amount of coins to be selected.
1359
+ * @param sender - Sender address.
1360
+ * @return Take coin and left coin.
1361
+ */
1362
+ selectCoin<T extends SupportAssetCoins>(txBlock: ScallopTxBlock | SuiTxBlock, assetCoinName: T, amount: number, sender?: string): Promise<SelectCoinReturnType<T>>;
1363
+ /**
1364
+ * Specifying the sender's amount of market coins to get coins args from transaction result.
1365
+ *
1366
+ * @param txBlock - Scallop txBlock or txBlock created by SuiKit .
1367
+ * @param marketCoinName - Specific support market coin name.
1368
+ * @param amount - Amount of coins to be selected.
1369
+ * @param sender - Sender address.
1370
+ * @return Take coin and left coin.
1371
+ */
1372
+ selectMarketCoin(txBlock: ScallopTxBlock | SuiTxBlock, marketCoinName: SupportMarketCoins, amount: number, sender?: string): Promise<{
1373
+ takeCoin: _scallop_io_sui_kit.TransactionObjectArgument;
1374
+ leftCoin: _scallop_io_sui_kit.TransactionObjectArgument;
1375
+ totalAmount: number;
1376
+ }>;
1377
+ /**
1378
+ * Specifying the sender's amount of sCoins to get coins args from transaction result.
1379
+ *
1380
+ * @param txBlock - Scallop txBlock or txBlock created by SuiKit .
1381
+ * @param marketCoinName - Specific support sCoin name.
1382
+ * @param amount - Amount of coins to be selected.
1383
+ * @param sender - Sender address.
1384
+ * @return Take coin and left coin.
1385
+ */
1386
+ selectSCoin(txBlock: ScallopTxBlock | SuiTxBlock, sCoinName: SupportSCoin, amount: number, sender?: string): Promise<{
1387
+ takeCoin: _scallop_io_sui_kit.TransactionObjectArgument;
1388
+ leftCoin: _scallop_io_sui_kit.TransactionObjectArgument;
1389
+ totalAmount: number;
1390
+ }>;
1391
+ /**
1392
+ * Execute Scallop txBlock using the `signAndSendTxn` methods in suikit.
1393
+ *
1394
+ * @param txBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
1395
+ */
1396
+ signAndSendTxBlock(txBlock: ScallopTxBlock | SuiTxBlock | Transaction): Promise<SuiTransactionBlockResponse>;
1397
+ moveCall(txb: ScallopTxBlock | SuiTxBlock, target: string, args?: (SuiTxArg | SuiVecTxArg | SuiObjectArg | SuiAmountsArg)[], typeArgs?: string[]): _scallop_io_sui_kit.TransactionResult;
1398
+ }
1399
+
1400
+ /**
1401
+ * @description
1402
+ * It provides contract interaction operations for general users.
1403
+ *
1404
+ * @example
1405
+ * ```typescript
1406
+ * const scallopClient = new ScallopClient(<parameters>);
1407
+ * await scallopClient.init();
1408
+ * scallopClient.<client functions>();
1409
+ * await scallopClient.<client async functions>();
1410
+ * ```
1411
+ */
1412
+ declare class ScallopClient {
1413
+ readonly params: ScallopClientParams;
1414
+ suiKit: SuiKit;
1415
+ address: ScallopAddress;
1416
+ builder: ScallopBuilder;
1417
+ query: ScallopQuery;
1418
+ utils: ScallopUtils;
1419
+ cache: ScallopCache;
1420
+ walletAddress: string;
1421
+ constructor(params?: ScallopClientParams, instance?: ScallopClientInstanceParams);
1422
+ /**
1423
+ * Request the scallop API to initialize data.
1424
+ *
1425
+ * @param force - Whether to force initialization.
1426
+ */
1427
+ init(force?: boolean): Promise<void>;
1428
+ /**
1429
+ * Query market data.
1430
+ *
1431
+ * @description
1432
+ * This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1433
+ *
1434
+ * @return Market data.
1435
+ */
1436
+ queryMarket(): Promise<Market>;
1437
+ /**
1438
+ * Get obligations data.
1439
+ *
1440
+ * @description
1441
+ * This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1442
+ *
1443
+ * @param ownerAddress - The owner address.
1444
+ * @return Obligations data.
1445
+ */
1446
+ getObligations(ownerAddress?: string): Promise<Obligation[]>;
1447
+ /**
1448
+ * Query obligation data.
1449
+ *
1450
+ * @description
1451
+ * This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1452
+ *
1453
+ * @param obligationId - The obligation id.
1454
+ * @return Obligation data.
1455
+ */
1456
+ queryObligation(obligationId: string): Promise<ObligationQueryInterface | undefined>;
1457
+ /**
1458
+ * Query all stake accounts data.
1459
+ *
1460
+ * @description
1461
+ * This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1462
+ *
1463
+ * @param ownerAddress - The owner address.
1464
+ * @return All stake accounts data.
1465
+ */
1466
+ getAllStakeAccounts(ownerAddress?: string): Promise<StakeAccounts>;
1467
+ /**
1468
+ * Query stake account data.
1469
+ *
1470
+ * @description
1471
+ * This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1472
+ *
1473
+ * @param stakeMarketCoinName - Support stake market coin.
1474
+ * @param ownerAddress - The owner address.
1475
+ * @return Stake accounts data.
1476
+ */
1477
+ getStakeAccounts(stakeMarketCoinName: SupportStakeMarketCoins, ownerAddress?: string): Promise<StakeAccount[]>;
1478
+ /**
1479
+ * Query stake pool data.
1480
+ *
1481
+ * @description
1482
+ * This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1483
+ *
1484
+ * @param stakeMarketCoinName - Support stake market coin.
1485
+ * @return Stake pool data.
1486
+ */
1487
+ getStakePool(stakeMarketCoinName: SupportStakeMarketCoins): Promise<StakePool | undefined>;
1488
+ /**
1489
+ * Query reward pool data.
1490
+ *
1491
+ * @description
1492
+ * This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1493
+ *
1494
+ * @param stakeMarketCoinName - Support stake market coin.
1495
+ * @return Reward pool data.
1496
+ */
1497
+ getStakeRewardPool(stakeMarketCoinName: SupportStakeMarketCoins): Promise<StakeRewardPool | undefined>;
1498
+ /**
1499
+ * Open obligation.
1500
+ *
1501
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1502
+ * @return Transaction block response or transaction block.
1503
+ */
1504
+ openObligation(): Promise<SuiTransactionBlockResponse>;
1505
+ openObligation<S extends boolean>(sign?: S): Promise<ScallopClientFnReturnType<S>>;
1506
+ /**
1507
+ * Deposit collateral into the specific pool.
1508
+ *
1509
+ * @param collateralCoinName - Types of collateral coin.
1510
+ * @param amount - The amount of coins would deposit.
1511
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1512
+ * @param obligationId - The obligation object.
1513
+ * @param walletAddress - The wallet address of the owner.
1514
+ * @return Transaction block response or transaction block.
1515
+ */
1516
+ depositCollateral(collateralCoinName: SupportCollateralCoins, amount: number): Promise<SuiTransactionBlockResponse>;
1517
+ depositCollateral<S extends boolean>(collateralCoinName: SupportCollateralCoins, amount: number, sign?: S, obligationId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1518
+ /**
1519
+ * Withdraw collateral from the specific pool.
1520
+ *
1521
+ * @param collateralCoinName - Types of collateral coin.
1522
+ * @param amount - The amount of coins would deposit.
1523
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1524
+ * @param obligationId - The obligation object.
1525
+ * @param obligationKey - The obligation key object to verifying obligation authority.
1526
+ * @param walletAddress - The wallet address of the owner.
1527
+ * @return Transaction block response or transaction block.
1528
+ */
1529
+ withdrawCollateral<S extends boolean>(collateralCoinName: SupportCollateralCoins, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1530
+ /**
1531
+ * Deposit asset into the specific pool.
1532
+ *
1533
+ * @param poolCoinName - Types of pool coin.
1534
+ * @param amount - The amount of coins would deposit.
1535
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1536
+ * @param walletAddress - The wallet address of the owner.
1537
+ * @return Transaction block response or transaction block.
1538
+ */
1539
+ deposit(poolCoinName: SupportPoolCoins, amount: number): Promise<SuiTransactionBlockResponse>;
1540
+ deposit<S extends boolean>(poolCoinName: SupportPoolCoins, amount: number, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1541
+ /**
1542
+ * Deposit asset into the specific pool and Stake market coin into the corresponding spool.
1543
+ *
1544
+ * @param stakeCoinName - Types of stake coin.
1545
+ * @param amount - The amount of coins would deposit.
1546
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1547
+ * @param stakeAccountId - The stake account object.
1548
+ * @param walletAddress - The wallet address of the owner.
1549
+ * @return Transaction block response or transaction block.
1550
+ */
1551
+ depositAndStake(stakeCoinName: SupportStakeCoins, amount: number): Promise<SuiTransactionBlockResponse>;
1552
+ depositAndStake<S extends boolean>(stakeCoinName: SupportStakeCoins, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1553
+ /**
1554
+ * Withdraw asset from the specific pool, must return market coin.
1555
+ *
1556
+ * @param poolCoinName - Specific support pool coin name.
1557
+ * @param amount - The amount of coins would withdraw.
1558
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1559
+ * @param walletAddress - The wallet address of the owner.
1560
+ * @return Transaction block response or transaction block.
1561
+ */
1562
+ withdraw(poolCoinName: SupportPoolCoins, amount: number): Promise<SuiTransactionBlockResponse>;
1563
+ withdraw<S extends boolean>(poolCoinName: SupportPoolCoins, amount: number, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1564
+ /**
1565
+ * Borrow asset from the specific pool.
1566
+ *
1567
+ * @param poolCoinName - Specific support pool coin name.
1568
+ * @param amount - The amount of coins would borrow.
1569
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1570
+ * @param obligationId - The obligation object.
1571
+ * @param obligationKey - The obligation key object to verifying obligation authority.
1572
+ * @param walletAddress - The wallet address of the owner.
1573
+ * @return Transaction block response or transaction block.
1574
+ */
1575
+ borrow<S extends boolean>(poolCoinName: SupportPoolCoins, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1576
+ /**
1577
+ * Repay asset into the specific pool.
1578
+ *
1579
+ * @param poolCoinName - Specific support pool coin name.
1580
+ * @param amount - The amount of coins would repay.
1581
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1582
+ * @param obligationId - The obligation object.
1583
+ * @param walletAddress - The wallet address of the owner.
1584
+ * @return Transaction block response or transaction block.
1585
+ */
1586
+ repay<S extends boolean>(poolCoinName: SupportPoolCoins, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1587
+ /**
1588
+ * FlashLoan asset from the specific pool.
1589
+ *
1590
+ * @param poolCoinName - Specific support pool coin name..
1591
+ * @param amount - The amount of coins would repay.
1592
+ * @param callback - The callback function to build transaction block and return coin argument.
1593
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1594
+ * @return Transaction block response or transaction block.
1595
+ */
1596
+ flashLoan(poolCoinName: SupportPoolCoins, amount: number, callback: (txBlock: ScallopTxBlock, coin: TransactionObjectArgument | string) => SuiObjectArg): Promise<SuiTransactionBlockResponse>;
1597
+ flashLoan<S extends boolean>(poolCoinName: SupportPoolCoins, amount: number, callback: (txBlock: ScallopTxBlock, coin: TransactionObjectArgument | string) => SuiObjectArg, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1598
+ /**
1599
+ * Create stake account.
1600
+ *
1601
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1602
+ * @param walletAddress - The wallet address of the owner.
1603
+ * @return Transaction block response or transaction block.
1604
+ */
1605
+ createStakeAccount(marketCoinName: SupportStakeMarketCoins): Promise<SuiTransactionBlockResponse>;
1606
+ createStakeAccount<S extends boolean>(marketCoinName: SupportStakeMarketCoins, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1607
+ /**
1608
+ * Stake market coin into the specific spool.
1609
+ *
1610
+ * @param marketCoinName - Types of market coin.
1611
+ * @param amount - The amount of coins would deposit.
1612
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1613
+ * @param stakeAccountId - The stake account object.
1614
+ * @param walletAddress - The wallet address of the owner.
1615
+ * @return Transaction block response or transaction block.
1616
+ */
1617
+ stake(stakeMarketCoinName: SupportStakeMarketCoins, amount: number): Promise<SuiTransactionBlockResponse>;
1618
+ stake<S extends boolean>(stakeMarketCoinName: SupportStakeMarketCoins, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1619
+ /**
1620
+ * Unstake market coin from the specific spool.
1621
+ *
1622
+ * @param stakeMarketCoinName - Types of mak coin.
1623
+ * @param amount - The amount of coins would deposit.
1624
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1625
+ * @param accountId - The stake account object.
1626
+ * @param walletAddress - The wallet address of the owner.
1627
+ * @return Transaction block response or transaction block.
1628
+ */
1629
+ unstake(stakeMarketCoinName: SupportStakeMarketCoins, amount: number): Promise<SuiTransactionBlockResponse>;
1630
+ unstake<S extends boolean>(stakeMarketCoinName: SupportStakeMarketCoins, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1631
+ /**
1632
+ * Unstake market coin from the specific spool and withdraw asset from the corresponding pool.
1633
+ *
1634
+ * @param marketCoinName - Types of mak coin.
1635
+ * @param amount - The amount of coins would deposit.
1636
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1637
+ * @param accountId - The stake account object.
1638
+ * @param walletAddress - The wallet address of the owner.
1639
+ * @return Transaction block response or transaction block.
1640
+ */
1641
+ unstakeAndWithdraw(stakeMarketCoinName: SupportStakeMarketCoins, amount: number): Promise<SuiTransactionBlockResponse>;
1642
+ unstakeAndWithdraw<S extends boolean>(stakeMarketCoinName: SupportStakeMarketCoins, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1643
+ /**
1644
+ * Claim reward coin from the specific spool.
1645
+ *
1646
+ * @param stakeMarketCoinName - Types of mak coin.
1647
+ * @param amount - The amount of coins would deposit.
1648
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1649
+ * @param accountId - The stake account object.
1650
+ * @param walletAddress - The wallet address of the owner.
1651
+ * @return Transaction block response or transaction block.
1652
+ */
1653
+ claim(stakeMarketCoinName: SupportStakeMarketCoins): Promise<SuiTransactionBlockResponse>;
1654
+ claim<S extends boolean>(stakeMarketCoinName: SupportStakeMarketCoins, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1655
+ /**
1656
+ * stake obligaion.
1657
+ *
1658
+ * @param obligationId - The obligation account object.
1659
+ * @param obligationKeyId - The obligation key account object.
1660
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1661
+ * @param walletAddress - The wallet address of the owner.
1662
+ * @return Transaction block response or transaction block
1663
+ */
1664
+ stakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1665
+ /**
1666
+ * unstake obligaion.
1667
+ *
1668
+ * @param obligationId - The obligation account object.
1669
+ * @param obligationKeyId - The obligation key account object.
1670
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1671
+ * @param walletAddress - The wallet address of the owner.
1672
+ * @return Transaction block response or transaction block
1673
+ */
1674
+ unstakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1675
+ /**
1676
+ * Claim borrow incentive reward.
1677
+ *
1678
+ * @param poolName
1679
+ * @param amount - The amount of coins would deposit.
1680
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1681
+ * @param accountId - The stake account object.
1682
+ * @param walletAddress - The wallet address of the owner.
1683
+ * @return Transaction block response or transaction block
1684
+ */
1685
+ claimBorrowIncentive<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1686
+ /**
1687
+ * Function to migrate all market coin in user wallet into sCoin
1688
+ * @returns Transaction response
1689
+ */
1690
+ migrateAllMarketCoin<S extends boolean>(includeStakePool?: boolean, sign?: S): Promise<ScallopClientFnReturnType<S>>;
1691
+ /**
1692
+ * Claim unlocked SCA from all veSCA accounts.
1693
+ */
1694
+ claimAllUnlockedSca(): Promise<SuiTransactionBlockResponse>;
1695
+ claimAllUnlockedSca<S extends boolean>(sign?: S): Promise<ScallopClientVeScaReturnType<S>>;
1696
+ /**
1697
+ * Mint and get test coin.
1698
+ *
1699
+ * @remarks
1700
+ * Only be used on the test network.
1701
+ *
1702
+ * @param assetCoinName - Specific asset coin name.
1703
+ * @param amount - The amount of coins minted and received.
1704
+ * @param receiveAddress - The wallet address that receives the coins.
1705
+ * @param sign - Decide to directly sign the transaction or return the transaction block.
1706
+ * @return Transaction block response or transaction block.
1707
+ */
1708
+ mintTestCoin(assetCoinName: Exclude<SupportAssetCoins, 'sui'>, amount: number): Promise<SuiTransactionBlockResponse>;
1709
+ mintTestCoin<S extends boolean>(assetCoinName: Exclude<SupportAssetCoins, 'sui'>, amount: number, sign?: S, receiveAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1710
+ }
1711
+
1712
+ /**
1713
+ * @argument params - The parameters for the Scallop instance.
1714
+ * @argument cacheOptions - The cache options for the QueryClient.
1715
+ *
1716
+ * @description
1717
+ * The main instance that controls interaction with the Scallop contract.
1718
+ *
1719
+ * @example
1720
+ * ```typescript
1721
+ * const sdk = new Scallop(<parameters>);
1722
+ * const scallopAddress = await sdk.getScallopAddress();
1723
+ * const scallopBuilder = await sdk.createScallopBuilder();
1724
+ * const scallopClient = await sdk.createScallopClient();
1725
+ * const scallopIndexer= await sdk.createScallopIndexer();
1726
+ * const scallopUtils= await sdk.createScallopUtils();
1727
+ * ```
1728
+ */
1729
+ declare class Scallop {
1730
+ params: ScallopParams;
1731
+ suiKit: SuiKit;
1732
+ cache: ScallopCache;
1733
+ private address;
1734
+ constructor(params: ScallopParams, cacheOptions?: QueryClientConfig, queryClient?: QueryClient);
1735
+ /**
1736
+ * Get a scallop address instance that already has read addresses.
1737
+ *
1738
+ * @param id - The API id of the addresses.
1739
+ * @return Scallop Address.
1740
+ */
1741
+ getScallopAddress(id?: string): Promise<ScallopAddress>;
1742
+ /**
1743
+ * Create a scallop builder instance that already has initial data.
1744
+ *
1745
+ * @return Scallop Builder.
1746
+ */
1747
+ createScallopBuilder(params?: ScallopBuilderParams): Promise<ScallopBuilder>;
1748
+ /**
1749
+ * Create a scallop client instance that already has initial data.
1750
+ *
1751
+ * @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.
1752
+ * @return Scallop Client.
1753
+ */
1754
+ createScallopClient(params?: ScallopClientParams): Promise<ScallopClient>;
1755
+ /**
1756
+ * Create a scallop query instance.
1757
+ *
1758
+ * @return Scallop Query.
1759
+ */
1760
+ createScallopQuery(params?: ScallopQueryParams): Promise<ScallopQuery>;
1761
+ /**
1762
+ * Create a scallop indexer instance.
1763
+ *
1764
+ * @return Scallop Indexer.
1765
+ */
1766
+ createScallopIndexer(): Promise<ScallopIndexer>;
1767
+ /**
1768
+ * Create a scallop utils instance.
1769
+ *
1770
+ * @return Scallop Utils.
1771
+ */
1772
+ createScallopUtils(params?: ScallopUtilsParams): Promise<ScallopUtils>;
1773
+ }
1774
+
1775
+ type Coins = {
1776
+ [K in SupportCoins]: K;
1777
+ };
1778
+ type AssetCoins = {
1779
+ [K in SupportAssetCoins]: K;
1780
+ };
1781
+ type MarketCoins = {
1782
+ [K in SupportMarketCoins]: K;
1783
+ };
1784
+ type SCoins = {
1785
+ [K in SupportSCoin]: K;
1786
+ };
1787
+ type StakeMarketCoins = {
1788
+ [K in SupportStakeMarketCoins]: K;
1789
+ };
1790
+ type StakeRewardCoins = {
1791
+ [key in SupportStakeMarketCoins]: SupportStakeRewardCoins;
1792
+ };
1793
+ type SuiBridgeCoins = {
1794
+ [K in SupportSuiBridgeCoins]: K;
1795
+ };
1796
+ type BorrowIncentiveRewardCoins = {
1797
+ [key in SupportBorrowIncentiveCoins]: SupportBorrowIncentiveRewardCoins[];
1798
+ };
1799
+ type AssetCoinIds = {
1800
+ [key in SupportAssetCoins]: string;
1801
+ };
1802
+ type SCoinIds = {
1803
+ [key in SupportSCoin]: string;
1804
+ };
1805
+ type SCoinTreasuryCaps = {
1806
+ [key in SupportSCoin]: string;
1807
+ };
1808
+ type SCoinConverterTreasury = {
1809
+ [key in SupportSCoin]: string;
1810
+ };
1811
+ type PickFromUnion<T, K extends string> = K extends T ? K : never;
1812
+ type WormholeCoinIds = {
1813
+ [key in PickFromUnion<SupportAssetCoins, 'weth' | 'wbtc' | 'wusdc' | 'wusdt' | 'wapt' | 'wsol'>]: string;
1814
+ };
1815
+ type VoloCoinIds = {
1816
+ [key in PickFromUnion<SupportAssetCoins, 'vsui'>]: string;
1817
+ };
1818
+ type SuiBridgedCoinPackageIds = {
1819
+ [key in SupportSuiBridgeCoins]: string;
1820
+ };
1821
+
1822
+ type xOracleRules = {
1823
+ primary: SupportOracleType[];
1824
+ secondary: SupportOracleType[];
1825
+ };
1826
+ type xOracleRuleType = keyof xOracleRules;
1827
+ type xOracleListType = {
1828
+ [key in SupportAssetCoins]: xOracleRules;
1829
+ };
1830
+
1831
+ type CoreIds = {
1832
+ protocolPkg: string;
1833
+ market: string;
1834
+ version: string;
1835
+ coinDecimalsRegistry: string;
1836
+ xOracle: string;
1837
+ };
1838
+ type NestedResult = Extract<Argument, {
1839
+ $kind: 'NestedResult';
1840
+ }>;
1841
+ type Obligation$1 = NestedResult;
1842
+ type ObligationKey = NestedResult;
1843
+ type ObligationHotPotato = NestedResult;
1844
+ type CoreNormalMethods = {
1845
+ openObligation: () => [Obligation$1, ObligationKey, ObligationHotPotato];
1846
+ returnObligation: (obligation: SuiObjectArg, obligationHotPotato: SuiObjectArg) => void;
1847
+ openObligationEntry: () => void;
1848
+ addCollateral: (obligation: SuiObjectArg, coin: SuiObjectArg, collateralCoinName: SupportCollateralCoins) => void;
1849
+ takeCollateral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, collateralCoinName: SupportCollateralCoins) => TransactionResult;
1850
+ deposit: (coin: SuiObjectArg, poolCoinName: SupportPoolCoins) => TransactionResult;
1851
+ depositEntry: (coin: SuiObjectArg, poolCoinName: SupportPoolCoins) => TransactionResult;
1852
+ withdraw: (marketCoin: SuiObjectArg, poolCoinName: SupportPoolCoins) => TransactionResult;
1853
+ withdrawEntry: (marketCoin: SuiObjectArg, poolCoinName: SupportPoolCoins) => TransactionResult;
1854
+ borrow: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: SupportPoolCoins) => TransactionResult;
1855
+ borrowWithReferral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, borrowReferral: SuiObjectArg, amount: number | SuiTxArg, poolCoinName: SupportPoolCoins) => TransactionResult;
1856
+ borrowEntry: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: SupportPoolCoins) => TransactionResult;
1857
+ repay: (obligation: SuiObjectArg, coin: SuiObjectArg, poolCoinName: SupportPoolCoins) => void;
1858
+ borrowFlashLoan: (amount: number | SuiTxArg, poolCoinName: SupportPoolCoins) => TransactionResult;
1859
+ repayFlashLoan: (coin: SuiObjectArg, loan: SuiObjectArg, poolCoinName: SupportPoolCoins) => void;
1860
+ };
1861
+ type CoreQuickMethods = {
1862
+ addCollateralQuick: (amount: number, collateralCoinName: SupportCollateralCoins, obligationId?: SuiObjectArg) => Promise<void>;
1863
+ takeCollateralQuick: (amount: number, collateralCoinName: SupportCollateralCoins, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg) => Promise<TransactionResult>;
1864
+ borrowQuick: (amount: number, poolCoinName: SupportPoolCoins, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg) => Promise<TransactionResult>;
1865
+ borrowWithReferralQuick: (amount: number, poolCoinName: SupportPoolCoins, borrowReferral: SuiObjectArg, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg) => Promise<TransactionResult>;
1866
+ depositQuick: (amount: number, poolCoinName: SupportPoolCoins, returnSCoin?: boolean) => Promise<TransactionResult>;
1867
+ withdrawQuick: (amount: number, poolCoinName: SupportPoolCoins) => Promise<TransactionResult>;
1868
+ repayQuick: (amount: number, poolCoinName: SupportPoolCoins, obligationId?: SuiObjectArg) => Promise<void>;
1869
+ updateAssetPricesQuick: (assetCoinNames?: SupportAssetCoins[]) => Promise<void>;
1870
+ };
1871
+ type SuiTxBlockWithCoreNormalMethods = SuiTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
1872
+ type CoreTxBlock = SuiTxBlockWithCoreNormalMethods & CoreQuickMethods;
1873
+ type GenerateCoreNormalMethod = (params: {
1874
+ builder: ScallopBuilder;
1875
+ txBlock: SuiTxBlock;
1876
+ }) => CoreNormalMethods;
1877
+ type GenerateCoreQuickMethod = (params: {
1878
+ builder: ScallopBuilder;
1879
+ txBlock: SuiTxBlockWithCoreNormalMethods;
1880
+ }) => CoreQuickMethods;
1881
+
1882
+ type SpoolIds = {
1883
+ spoolPkg: string;
1884
+ };
1885
+ type SpoolNormalMethods = {
1886
+ createStakeAccount: (stakeMarketCoinName: SupportStakeMarketCoins) => TransactionResult;
1887
+ stake: (stakeAccount: SuiAddressArg, coin: SuiObjectArg, stakeMarketCoinName: SupportStakeMarketCoins) => void;
1888
+ unstake: (stakeAccount: SuiAddressArg, amount: number, stakeMarketCoinName: SupportStakeMarketCoins) => TransactionResult;
1889
+ claim: (stakeAccount: SuiAddressArg, stakeMarketCoinName: SupportStakeMarketCoins) => TransactionResult;
1890
+ };
1891
+ type SpoolQuickMethods = {
1892
+ stakeQuick(amountOrMarketCoin: SuiObjectArg | number, stakeMarketCoinName: SupportStakeMarketCoins, stakeAccountId?: SuiAddressArg): Promise<void>;
1893
+ unstakeQuick(amount: number, stakeMarketCoinName: SupportStakeMarketCoins, stakeAccountId?: SuiAddressArg, returnSCoin?: boolean): Promise<TransactionResult | undefined>;
1894
+ claimQuick(stakeMarketCoinName: SupportStakeMarketCoins, stakeAccountId?: SuiAddressArg): Promise<TransactionResult[]>;
1895
+ };
1896
+ type SuiTxBlockWithSpoolNormalMethods = SuiTxBlock & SuiTxBlockWithSCoin & SpoolNormalMethods;
1897
+ type SpoolTxBlock = SuiTxBlockWithSpoolNormalMethods & SpoolQuickMethods;
1898
+ type GenerateSpoolNormalMethod = (params: {
1899
+ builder: ScallopBuilder;
1900
+ txBlock: SuiTxBlock;
1901
+ }) => SpoolNormalMethods;
1902
+ type GenerateSpoolQuickMethod = (params: {
1903
+ builder: ScallopBuilder;
1904
+ txBlock: SuiTxBlockWithSpoolNormalMethods;
1905
+ }) => SpoolQuickMethods;
1906
+
1907
+ type BorrowIncentiveIds = {
1908
+ borrowIncentivePkg: string;
1909
+ query: string;
1910
+ config: string;
1911
+ incentivePools: string;
1912
+ incentiveAccounts: string;
1913
+ obligationAccessStore: string;
1914
+ };
1915
+ type BorrowIncentiveNormalMethods = {
1916
+ stakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
1917
+ stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey: SuiObjectArg) => void;
1918
+ unstakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
1919
+ claimBorrowIncentive: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, rewardType: SupportBorrowIncentiveRewardCoins) => TransactionResult;
1920
+ deactivateBoost: (obligation: SuiObjectArg, veScaKey: SuiObjectArg) => void;
1921
+ };
1922
+ type BorrowIncentiveQuickMethods = {
1923
+ stakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
1924
+ stakeObligationWithVeScaQuick(obligation?: string, obligationKey?: string, veScaKey?: string): Promise<void>;
1925
+ unstakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
1926
+ claimBorrowIncentiveQuick(rewardType: SupportBorrowIncentiveRewardCoins, obligation?: string, obligationKey?: string): Promise<TransactionResult>;
1927
+ };
1928
+ type SuiTxBlockWithBorrowIncentiveNormalMethods = SuiTxBlock & BorrowIncentiveNormalMethods;
1929
+ type BorrowIncentiveTxBlock = SuiTxBlockWithBorrowIncentiveNormalMethods & BorrowIncentiveQuickMethods;
1930
+ type GenerateBorrowIncentiveNormalMethod = (params: {
1931
+ builder: ScallopBuilder;
1932
+ txBlock: SuiTxBlock;
1933
+ }) => BorrowIncentiveNormalMethods;
1934
+ type GenerateBorrowIncentiveQuickMethod = (params: {
1935
+ builder: ScallopBuilder;
1936
+ txBlock: SuiTxBlockWithBorrowIncentiveNormalMethods;
1937
+ }) => BorrowIncentiveQuickMethods;
1938
+
1939
+ type VescaIds = {
1940
+ pkgId: string;
1941
+ table: string;
1942
+ treasury: string;
1943
+ config: string;
1944
+ };
1945
+ type VeScaNormalMethods = {
1946
+ lockSca: (scaCoin: SuiObjectArg, unlockAtInSecondTimestamp: number) => TransactionResult;
1947
+ extendLockPeriod: (veScaKey: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
1948
+ extendLockAmount: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg) => void;
1949
+ renewExpiredVeSca: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
1950
+ redeemSca: (veScaKey: SuiObjectArg) => TransactionResult;
1951
+ mintEmptyVeSca: () => TransactionResult;
1952
+ };
1953
+ type RedeemScaQuickReturnType<T extends boolean> = T extends true ? void : TransactionResult | undefined;
1954
+ type VeScaQuickMethods = {
1955
+ /**
1956
+ * Quick methods to automate
1957
+ * lock initial SCA, extend lock period, lock more SCA, renew expired VeSCA, and redeem SCA
1958
+ *
1959
+ * **Flow:**
1960
+ * - If only `amountOrCoin` is provided, it will lock the amount of existing not expired veSCA
1961
+ * - If only `lockPeriodInDays` is provided, it will extend the lock period of existing not expired veSCA
1962
+ *
1963
+ * **Note:**
1964
+ * - If one or both flow above is used on a expired veSCA, it will claim the unlocked SCA
1965
+ * and renew the veSCA first, and then flow continues
1966
+ * - If users has no veSCA yet, they need to provide both `amountOrCoin` and `lockPeriodInDays` for initial lock
1967
+ * @param amountOrCoin
1968
+ * @param lockPeriodInDays
1969
+ * @param autoCheck
1970
+ */
1971
+ lockScaQuick(amountOrCoin?: SuiObjectArg | number, lockPeriodInDays?: number, autoCheck?: boolean): Promise<void>;
1972
+ extendLockPeriodQuick: (lockPeriodInDays: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
1973
+ extendLockAmountQuick: (scaAmount: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
1974
+ renewExpiredVeScaQuick: (scaAmount: number, lockPeriodInDays: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
1975
+ redeemScaQuick: <T extends boolean>(veSCaKey?: SuiObjectArg, transferSca?: T) => Promise<RedeemScaQuickReturnType<T>>;
1976
+ };
1977
+ type SuiTxBlockWithVeScaNormalMethods = SuiTxBlock & VeScaNormalMethods;
1978
+ type VeScaTxBlock = SuiTxBlockWithVeScaNormalMethods & VeScaQuickMethods;
1979
+ type GenerateVeScaNormalMethod = (params: {
1980
+ builder: ScallopBuilder;
1981
+ txBlock: SuiTxBlock;
1982
+ }) => VeScaNormalMethods;
1983
+ type GenerateVeScaQuickMethod = (params: {
1984
+ builder: ScallopBuilder;
1985
+ txBlock: SuiTxBlockWithVeScaNormalMethods;
1986
+ }) => VeScaQuickMethods;
1987
+
1988
+ type ReferralNormalMethods = {
1989
+ bindToReferral: (veScaKeyId: string) => void;
1990
+ claimReferralTicket: (poolCoinName: SupportPoolCoins) => TransactionResult$1;
1991
+ burnReferralTicket: (ticket: SuiObjectArg, poolCoinName: SupportPoolCoins) => void;
1992
+ claimReferralRevenue: (veScaKey: SuiObjectArg, poolCoinName: SupportPoolCoins) => TransactionResult$1;
1993
+ };
1994
+ type ReferralQuickMethods = {
1995
+ claimReferralRevenueQuick: (veScaKey: SuiObjectArg, coinNames: SupportPoolCoins[]) => Promise<void>;
1996
+ };
1997
+ type SuiTxBlockWithReferralNormalMethods = SuiTxBlock & ReferralNormalMethods;
1998
+ type ReferralTxBlock = SuiTxBlockWithReferralNormalMethods & ReferralQuickMethods;
1999
+
2000
+ type LoyaltyProgramIds = {
2001
+ loyaltyProgramPkgId: string;
2002
+ rewardPool: string;
2003
+ userRewardTableId: string;
2004
+ };
2005
+ type LoyaltyProgramNormalMethods = {
2006
+ claimLoyaltyRevenue: (veScaKey: SuiObjectArg) => TransactionResult$1;
2007
+ };
2008
+ type LoyaltyProgramQuickMethods = {
2009
+ claimLoyaltyRevenueQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
2010
+ };
2011
+ type SuiTxBlockWithLoyaltyProgramNormalMethods = SuiTxBlock & LoyaltyProgramNormalMethods;
2012
+ type LoyaltyProgramTxBlock = SuiTxBlockWithLoyaltyProgramNormalMethods & LoyaltyProgramQuickMethods;
2013
+ type GenerateLoyaltyProgramNormalMethod = (params: {
2014
+ builder: ScallopBuilder;
2015
+ txBlock: SuiTxBlock;
2016
+ }) => LoyaltyProgramNormalMethods;
2017
+ type GenerateLoyaltyProgramQuickMethod = (params: {
2018
+ builder: ScallopBuilder;
2019
+ txBlock: SuiTxBlockWithLoyaltyProgramNormalMethods;
2020
+ }) => LoyaltyProgramQuickMethods;
2021
+
2022
+ type sCoinPkgIds = {
2023
+ pkgId: string;
2024
+ };
2025
+ type sCoinNormalMethods = {
2026
+ /**
2027
+ * Lock marketCoin and return sCoin
2028
+ * @param marketCoinName
2029
+ * @param marketCoin
2030
+ * @returns
2031
+ */
2032
+ mintSCoin: (marketCoinName: SupportSCoin, marketCoin: SuiObjectArg) => TransactionResult$1;
2033
+ /**
2034
+ * Burn sCoin and return marketCoin
2035
+ * @param sCoinName
2036
+ * @param sCoin
2037
+ * @returns
2038
+ */
2039
+ burnSCoin: (sCoinName: SupportSCoin, sCoin: SuiObjectArg) => TransactionResult$1;
2040
+ };
2041
+ type sCoinQuickMethods = {
2042
+ mintSCoinQuick: (marketCoinName: SupportSCoin, amount: number) => Promise<TransactionResult$1>;
2043
+ burnSCoinQuick: (sCoinName: SupportSCoin, amount: number) => Promise<TransactionResult$1>;
2044
+ };
2045
+ type SuiTxBlockWithSCoinNormalMethods = SuiTxBlock & BaseScallopTxBlock & sCoinNormalMethods;
2046
+ type SCoinTxBlock = SuiTxBlockWithSCoinNormalMethods & sCoinQuickMethods;
2047
+ type GenerateSCoinNormalMethod = (params: {
2048
+ builder: ScallopBuilder;
2049
+ txBlock: SuiTxBlock;
2050
+ }) => sCoinNormalMethods;
2051
+ type GenerateSCoinQuickMethod = (params: {
2052
+ builder: ScallopBuilder;
2053
+ txBlock: SuiTxBlockWithSCoinNormalMethods;
2054
+ }) => sCoinQuickMethods;
2055
+
2056
+ type BaseScallopTxBlock = ReferralTxBlock & LoyaltyProgramTxBlock & BorrowIncentiveTxBlock & VeScaTxBlock;
2057
+ type SuiTxBlockWithSCoin = BaseScallopTxBlock & SCoinTxBlock;
2058
+ type SuiTxBlockWithSpool = SuiTxBlockWithSCoin & SpoolTxBlock;
2059
+ type ScallopTxBlock = SuiTxBlockWithSpool & CoreTxBlock;
2060
+ type SelectCoinReturnType<T extends SupportAssetCoins> = T extends 'sui' ? {
2061
+ takeCoin: NestedResult;
2062
+ } : {
2063
+ takeCoin: NestedResult;
2064
+ leftCoin: NestedResult;
2065
+ };
2066
+
2067
+ interface BorrowIncentiveAccountKey {
2068
+ id: string;
2069
+ onwerId: string;
2070
+ }
2071
+ type OptionalKeys$4<T> = {
2072
+ [K in keyof T]?: T[K];
2073
+ };
2074
+ type BorrowIncentivePools = OptionalKeys$4<Record<SupportBorrowIncentiveCoins, BorrowIncentivePool>>;
2075
+ type BorrowIncentivePoolPoints = {
2076
+ symbol: string;
2077
+ coinName: SupportBorrowIncentiveRewardCoins;
2078
+ coinType: string;
2079
+ coinDecimal: number;
2080
+ coinPrice: number;
2081
+ } & Required<Pick<ParsedBorrowIncentivePoolPointData, 'points' | 'distributedPoint' | 'weightedAmount'>> & CalculatedBorrowIncentivePoolPointData;
2082
+ type BorrowIncentivePool = {
2083
+ coinName: SupportBorrowIncentiveCoins;
2084
+ symbol: string;
2085
+ coinType: string;
2086
+ coinDecimal: number;
2087
+ coinPrice: number;
2088
+ stakedAmount: number;
2089
+ stakedCoin: number;
2090
+ stakedValue: number;
2091
+ points: OptionalKeys$4<Record<SupportBorrowIncentiveRewardCoins, BorrowIncentivePoolPoints>>;
2092
+ };
2093
+ type OriginBorrowIncentivePoolPointData = {
2094
+ point_type: {
2095
+ name: string;
2096
+ };
2097
+ distributed_point_per_period: string;
2098
+ point_distribution_time: string;
2099
+ distributed_point: string;
2100
+ points: string;
2101
+ index: string;
2102
+ base_weight: string;
2103
+ weighted_amount: string;
2104
+ last_update: string;
2105
+ created_at: string;
2106
+ };
2107
+ type OriginBorrowIncentivePoolData = {
2108
+ pool_type: {
2109
+ name: string;
2110
+ };
2111
+ points: OriginBorrowIncentivePoolPointData[];
2112
+ min_stakes: string;
2113
+ max_stakes: string;
2114
+ stakes: string;
2115
+ created_at: string;
2116
+ };
2117
+ type ParsedBorrowIncentivePoolPointData = {
2118
+ pointType: string;
2119
+ distributedPointPerPeriod: number;
2120
+ period: number;
2121
+ distributedPoint: number;
2122
+ points: number;
2123
+ index: number;
2124
+ baseWeight: number;
2125
+ weightedAmount: number;
2126
+ lastUpdate: number;
2127
+ createdAt: number;
2128
+ };
2129
+ type ParsedBorrowIncentivePoolData = {
2130
+ poolType: string;
2131
+ poolPoints: OptionalKeys$4<Record<SupportBorrowIncentiveRewardCoins, ParsedBorrowIncentivePoolPointData>>;
2132
+ minStakes: number;
2133
+ maxStakes: number;
2134
+ staked: number;
2135
+ };
2136
+ type CalculatedBorrowIncentivePoolPointData = {
2137
+ baseWeight: number;
2138
+ weightedStakedAmount: number;
2139
+ weightedStakedCoin: number;
2140
+ weightedStakedValue: number;
2141
+ distributedPointPerSec: number;
2142
+ accumulatedPoints: number;
2143
+ currentPointIndex: number;
2144
+ currentTotalDistributedPoint: number;
2145
+ rewardApr: number;
2146
+ rewardPerSec: number;
2147
+ };
2148
+ type BorrowIncentiveAccounts = OptionalKeys$4<Record<SupportBorrowIncentiveCoins, ParsedBorrowIncentiveAccountData>>;
2149
+ type OriginBorrowIncentiveAccountPoolData = {
2150
+ point_type: {
2151
+ name: string;
2152
+ };
2153
+ weighted_amount: string;
2154
+ points: string;
2155
+ total_points: string;
2156
+ index: string;
2157
+ };
2158
+ type OriginBorrowIncentiveAccountData = {
2159
+ points_list: OriginBorrowIncentiveAccountPoolData[];
2160
+ pool_type: {
2161
+ name: string;
2162
+ };
2163
+ debt_amount: string;
2164
+ };
2165
+ type ParsedBorrowIncentiveAccountPoolData = {
2166
+ pointType: string;
2167
+ weightedAmount: number;
2168
+ points: number;
2169
+ totalPoints: number;
2170
+ index: number;
2171
+ };
2172
+ type ParsedBorrowIncentiveAccountData = {
2173
+ pointList: OptionalKeys$4<Record<SupportBorrowIncentiveRewardCoins, ParsedBorrowIncentiveAccountPoolData>>;
2174
+ poolType: string;
2175
+ debtAmount: number;
2176
+ };
2177
+ /**
2178
+ * The query interface for `incentive_pools_query::incentive_pools_data` inspectTxn.
2179
+ */
2180
+ interface BorrowIncentivePoolsQueryInterface {
2181
+ incentive_pools: OriginBorrowIncentivePoolData[];
2182
+ }
2183
+ /**
2184
+ * The query interface for `incentive_account_query::incentive_account_data` inspectTxn.
2185
+ */
2186
+ interface BorrowIncentiveAccountsQueryInterface {
2187
+ pool_records: OriginBorrowIncentiveAccountData[];
2188
+ }
2189
+
2190
+ type OptionalKeys$3<T> = {
2191
+ [K in keyof T]?: T[K];
2192
+ };
2193
+ type MarketPools = OptionalKeys$3<Record<SupportPoolCoins, MarketPool>>;
2194
+ type MarketCollaterals = OptionalKeys$3<Record<SupportCollateralCoins, MarketCollateral>>;
2195
+ type CoinAmounts = OptionalKeys$3<Record<SupportPoolCoins, number>>;
2196
+ type MarketCoinAmounts = OptionalKeys$3<Record<SupportMarketCoins, number>>;
2197
+ type SCoinAmounts = OptionalKeys$3<Record<SupportSCoin, number>>;
2198
+ type BalanceSheet = {
2199
+ cash: string;
2200
+ debt: string;
2201
+ market_coin_supply: string;
2202
+ revenue: string;
2203
+ };
2204
+ type BorrowDynamic = {
2205
+ borrow_index: string;
2206
+ interest_rate: {
2207
+ fields: {
2208
+ value: string;
2209
+ };
2210
+ };
2211
+ interest_rate_scale: string;
2212
+ last_updated: string;
2213
+ };
2214
+ type BorrowFee = {
2215
+ value: string;
2216
+ };
2217
+ type InterestModel = {
2218
+ base_borrow_rate_per_sec: {
2219
+ fields: {
2220
+ value: string;
2221
+ };
2222
+ };
2223
+ borrow_rate_on_high_kink: {
2224
+ fields: {
2225
+ value: string;
2226
+ };
2227
+ };
2228
+ borrow_rate_on_mid_kink: {
2229
+ fields: {
2230
+ value: string;
2231
+ };
2232
+ };
2233
+ borrow_weight: {
2234
+ fields: {
2235
+ value: string;
2236
+ };
2237
+ };
2238
+ borrow_fee_rate: {
2239
+ fields: {
2240
+ value: string;
2241
+ };
2242
+ };
2243
+ high_kink: {
2244
+ fields: {
2245
+ value: string;
2246
+ };
2247
+ };
2248
+ interest_rate_scale: string;
2249
+ max_borrow_rate: {
2250
+ fields: {
2251
+ value: string;
2252
+ };
2253
+ };
2254
+ mid_kink: {
2255
+ fields: {
2256
+ value: string;
2257
+ };
2258
+ };
2259
+ min_borrow_amount: string;
2260
+ revenue_factor: {
2261
+ fields: {
2262
+ value: string;
2263
+ };
2264
+ };
2265
+ type: {
2266
+ fields: {
2267
+ name: string;
2268
+ };
2269
+ };
2270
+ };
2271
+ type RiskModel = {
2272
+ collateral_factor: {
2273
+ fields: {
2274
+ value: string;
2275
+ };
2276
+ };
2277
+ liquidation_discount: {
2278
+ fields: {
2279
+ value: string;
2280
+ };
2281
+ };
2282
+ liquidation_factor: {
2283
+ fields: {
2284
+ value: string;
2285
+ };
2286
+ };
2287
+ liquidation_penalty: {
2288
+ fields: {
2289
+ value: string;
2290
+ };
2291
+ };
2292
+ liquidation_revenue_factor: {
2293
+ fields: {
2294
+ value: string;
2295
+ };
2296
+ };
2297
+ max_collateral_amount: string;
2298
+ type: {
2299
+ fields: {
2300
+ name: string;
2301
+ };
2302
+ };
2303
+ };
2304
+ type CollateralStat = {
2305
+ amount: string;
2306
+ };
2307
+ type MarketPool = {
2308
+ coinName: SupportPoolCoins;
2309
+ symbol: string;
2310
+ coinType: string;
2311
+ marketCoinType: string;
2312
+ sCoinType: string;
2313
+ coinWrappedType: CoinWrappedType;
2314
+ coinDecimal: number;
2315
+ coinPrice: number;
2316
+ maxSupplyCoin: number;
2317
+ maxBorrowCoin: number;
2318
+ isIsolated: boolean;
2319
+ } & Required<Pick<ParsedMarketPoolData, 'highKink' | 'midKink' | 'reserveFactor' | 'borrowWeight' | 'borrowFee' | 'marketCoinSupplyAmount' | 'minBorrowAmount'>> & CalculatedMarketPoolData;
2320
+ type MarketCollateral = {
2321
+ coinName: SupportCollateralCoins;
2322
+ symbol: string;
2323
+ coinType: string;
2324
+ marketCoinType: string;
2325
+ coinWrappedType: CoinWrappedType;
2326
+ coinDecimal: number;
2327
+ coinPrice: number;
2328
+ isIsolated: boolean;
2329
+ } & Required<Pick<ParsedMarketCollateralData, 'collateralFactor' | 'liquidationFactor' | 'liquidationDiscount' | 'liquidationPenalty' | 'liquidationReserveFactor'>> & CalculatedMarketCollateralData;
2330
+ type OriginMarketPoolData = {
2331
+ type: {
2332
+ name: string;
2333
+ };
2334
+ maxBorrowRate: {
2335
+ value: string;
2336
+ };
2337
+ interestRate: {
2338
+ value: string;
2339
+ };
2340
+ interestRateScale: string;
2341
+ borrowIndex: string;
2342
+ lastUpdated: string;
2343
+ cash: string;
2344
+ debt: string;
2345
+ marketCoinSupply: string;
2346
+ reserve: string;
2347
+ reserveFactor: {
2348
+ value: string;
2349
+ };
2350
+ borrowWeight: {
2351
+ value: string;
2352
+ };
2353
+ borrowFeeRate: {
2354
+ value: string;
2355
+ };
2356
+ baseBorrowRatePerSec: {
2357
+ value: string;
2358
+ };
2359
+ borrowRateOnHighKink: {
2360
+ value: string;
2361
+ };
2362
+ borrowRateOnMidKink: {
2363
+ value: string;
2364
+ };
2365
+ highKink: {
2366
+ value: string;
2367
+ };
2368
+ midKink: {
2369
+ value: string;
2370
+ };
2371
+ minBorrowAmount: string;
2372
+ isIsolated: boolean;
2373
+ supplyLimit: string;
2374
+ borrowLimit: string;
2375
+ };
2376
+ type ParsedMarketPoolData = {
2377
+ coinType: string;
2378
+ maxBorrowRate: number;
2379
+ borrowRate: number;
2380
+ borrowRateScale: number;
2381
+ borrowIndex: number;
2382
+ lastUpdated: number;
2383
+ cashAmount: number;
2384
+ debtAmount: number;
2385
+ marketCoinSupplyAmount: number;
2386
+ reserveAmount: number;
2387
+ reserveFactor: number;
2388
+ borrowWeight: number;
2389
+ borrowFee: number;
2390
+ baseBorrowRate: number;
2391
+ borrowRateOnHighKink: number;
2392
+ borrowRateOnMidKink: number;
2393
+ highKink: number;
2394
+ midKink: number;
2395
+ minBorrowAmount: number;
2396
+ isIsolated: boolean;
2397
+ supplyLimit: number;
2398
+ borrowLimit: number;
2399
+ };
2400
+ type CalculatedMarketPoolData = {
2401
+ baseBorrowApr: number;
2402
+ baseBorrowApy: number;
2403
+ borrowAprOnHighKink: number;
2404
+ borrowApyOnHighKink: number;
2405
+ borrowAprOnMidKink: number;
2406
+ borrowApyOnMidKink: number;
2407
+ coinDecimal: number;
2408
+ conversionRate: number;
2409
+ maxBorrowApr: number;
2410
+ maxBorrowApy: number;
2411
+ borrowApr: number;
2412
+ borrowApy: number;
2413
+ borrowIndex: number;
2414
+ growthInterest: number;
2415
+ supplyAmount: number;
2416
+ supplyCoin: number;
2417
+ borrowAmount: number;
2418
+ borrowCoin: number;
2419
+ reserveAmount: number;
2420
+ reserveCoin: number;
2421
+ utilizationRate: number;
2422
+ supplyApr: number;
2423
+ supplyApy: number;
2424
+ isIsolated: boolean;
2425
+ maxSupplyCoin: number;
2426
+ maxBorrowCoin: number;
2427
+ };
2428
+ type OriginMarketCollateralData = {
2429
+ type: {
2430
+ name: string;
2431
+ };
2432
+ isIsolated: boolean;
2433
+ collateralFactor: {
2434
+ value: string;
2435
+ };
2436
+ liquidationFactor: {
2437
+ value: string;
2438
+ };
2439
+ liquidationDiscount: {
2440
+ value: string;
2441
+ };
2442
+ liquidationPenalty: {
2443
+ value: string;
2444
+ };
2445
+ liquidationReserveFactor: {
2446
+ value: string;
2447
+ };
2448
+ maxCollateralAmount: string;
2449
+ totalCollateralAmount: string;
2450
+ };
2451
+ type ParsedMarketCollateralData = {
2452
+ coinType: string;
2453
+ collateralFactor: number;
2454
+ liquidationFactor: number;
2455
+ liquidationDiscount: number;
2456
+ liquidationPenalty: number;
2457
+ liquidationReserveFactor: number;
2458
+ maxCollateralAmount: number;
2459
+ totalCollateralAmount: number;
2460
+ isIsolated: boolean;
2461
+ };
2462
+ type CalculatedMarketCollateralData = {
2463
+ coinDecimal: number;
2464
+ isIsolated: boolean;
2465
+ maxDepositAmount: number;
2466
+ maxDepositCoin: number;
2467
+ depositAmount: number;
2468
+ depositCoin: number;
2469
+ };
2470
+ type Market = {
2471
+ pools: MarketPools;
2472
+ collaterals: MarketCollaterals;
2473
+ data?: MarketQueryInterface;
2474
+ };
2475
+ type Obligation = {
2476
+ id: string;
2477
+ keyId: string;
2478
+ locked: boolean;
2479
+ };
2480
+ /**
2481
+ * The query interface for `market_query::market_data` inspectTxn.
2482
+ */
2483
+ interface MarketQueryInterface {
2484
+ collaterals: {
2485
+ collateralFactor: {
2486
+ value: string;
2487
+ };
2488
+ liquidationDiscount: {
2489
+ value: string;
2490
+ };
2491
+ liquidationFactor: {
2492
+ value: string;
2493
+ };
2494
+ liquidationPanelty: {
2495
+ value: string;
2496
+ };
2497
+ liquidationReserveFactor: {
2498
+ value: string;
2499
+ };
2500
+ maxCollateralAmount: string;
2501
+ totalCollateralAmount: string;
2502
+ type: {
2503
+ name: string;
2504
+ };
2505
+ }[];
2506
+ pools: {
2507
+ baseBorrowRatePerSec: {
2508
+ value: string;
2509
+ };
2510
+ borrowRateOnHighKink: {
2511
+ value: string;
2512
+ };
2513
+ borrowRateOnMidKink: {
2514
+ value: string;
2515
+ };
2516
+ maxBorrowRate: {
2517
+ value: string;
2518
+ };
2519
+ highKink: {
2520
+ value: string;
2521
+ };
2522
+ midKink: {
2523
+ value: string;
2524
+ };
2525
+ interestRate: {
2526
+ value: string;
2527
+ };
2528
+ interestRateScale: string;
2529
+ borrowIndex: string;
2530
+ lastUpdated: string;
2531
+ cash: string;
2532
+ debt: string;
2533
+ marketCoinSupply: string;
2534
+ minBorrowAmount: string;
2535
+ reserve: string;
2536
+ reserveFactor: {
2537
+ value: string;
2538
+ };
2539
+ borrowWeight: {
2540
+ value: string;
2541
+ };
2542
+ borrowFeeRate: {
2543
+ value: string;
2544
+ };
2545
+ type: {
2546
+ name: string;
2547
+ };
2548
+ }[];
2549
+ }
2550
+ /**
2551
+ * The query interface for `obligation_query::obligation_data` inspectTxn.
2552
+ */
2553
+ interface ObligationQueryInterface {
2554
+ collaterals: {
2555
+ type: {
2556
+ name: string;
2557
+ };
2558
+ amount: string;
2559
+ }[];
2560
+ debts: {
2561
+ type: {
2562
+ name: string;
2563
+ };
2564
+ amount: string;
2565
+ borrowIndex: string;
2566
+ }[];
2567
+ }
2568
+
2569
+ type LoyaltyProgramInfo = {
2570
+ pendingReward: number;
2571
+ totalPoolReward: number;
2572
+ isClaimEnabled: boolean;
2573
+ };
2574
+
2575
+ type OptionalKeys$2<T> = {
2576
+ [K in keyof T]?: T[K];
2577
+ };
2578
+ type Spools = OptionalKeys$2<Record<SupportStakeMarketCoins, Spool>>;
2579
+ type Spool = {
2580
+ marketCoinName: SupportStakeMarketCoins;
2581
+ symbol: string;
2582
+ coinType: string;
2583
+ marketCoinType: string;
2584
+ rewardCoinType: string;
2585
+ sCoinType: string;
2586
+ coinDecimal: number;
2587
+ rewardCoinDecimal: number;
2588
+ coinPrice: number;
2589
+ marketCoinPrice: number;
2590
+ rewardCoinPrice: number;
2591
+ } & Required<Pick<ParsedSpoolData, 'maxPoint' | 'distributedPoint' | 'maxStake'>> & CalculatedSpoolData & SpoolRewardPool;
2592
+ type OriginSpoolData = {
2593
+ stakeType: {
2594
+ fields: {
2595
+ name: string;
2596
+ };
2597
+ };
2598
+ maxDistributedPoint: string;
2599
+ distributedPoint: string;
2600
+ distributedPointPerPeriod: string;
2601
+ pointDistributionTime: string;
2602
+ maxStake: string;
2603
+ stakes: string;
2604
+ index: string;
2605
+ createdAt: string;
2606
+ lastUpdate: string;
2607
+ };
2608
+ type SpoolData = {
2609
+ created_at: string;
2610
+ distributed_point: string;
2611
+ distributed_point_per_period: string;
2612
+ id: {
2613
+ id: string;
2614
+ };
2615
+ index: string;
2616
+ last_update: string;
2617
+ max_distributed_point: string;
2618
+ max_stakes: string;
2619
+ point_distribution_time: string;
2620
+ stake_type: {
2621
+ type: string;
2622
+ fields: {
2623
+ name: string;
2624
+ };
2625
+ };
2626
+ stakes: string;
2627
+ };
2628
+ type ParsedSpoolData = {
2629
+ stakeType: string;
2630
+ maxPoint: number;
2631
+ distributedPoint: number;
2632
+ pointPerPeriod: number;
2633
+ period: number;
2634
+ maxStake: number;
2635
+ staked: number;
2636
+ index: number;
2637
+ createdAt: number;
2638
+ lastUpdate: number;
2639
+ };
2640
+ type CalculatedSpoolData = {
2641
+ stakedAmount: number;
2642
+ stakedCoin: number;
2643
+ stakedValue: number;
2644
+ distributedPointPerSec: number;
2645
+ accumulatedPoints: number;
2646
+ currentPointIndex: number;
2647
+ currentTotalDistributedPoint: number;
2648
+ startDate: Date;
2649
+ endDate: Date;
2650
+ };
2651
+ type SpoolRewardPool = Required<Pick<ParsedSpoolRewardPoolData, 'exchangeRateNumerator' | 'exchangeRateDenominator'>> & CalculatedSpoolRewardPoolData;
2652
+ type OriginSpoolRewardPoolData = {
2653
+ claimed_rewards: string;
2654
+ exchange_rate_denominator: string;
2655
+ exchange_rate_numerator: string;
2656
+ rewards: string;
2657
+ spool_id: string;
2658
+ };
2659
+ type ParsedSpoolRewardPoolData = {
2660
+ claimedRewards: number;
2661
+ exchangeRateDenominator: number;
2662
+ exchangeRateNumerator: number;
2663
+ rewards: number;
2664
+ spoolId: string;
2665
+ };
2666
+ type CalculatedSpoolRewardPoolData = {
2667
+ rewardApr: number;
2668
+ totalRewardAmount: number;
2669
+ totalRewardCoin: number;
2670
+ totalRewardValue: number;
2671
+ remaindRewardAmount: number;
2672
+ remaindRewardCoin: number;
2673
+ remaindRewardValue: number;
2674
+ claimedRewardAmount: number;
2675
+ claimedRewardCoin: number;
2676
+ claimedRewardValue: number;
2677
+ rewardPerSec: number;
2678
+ };
2679
+ type StakePools = OptionalKeys$2<Record<SupportStakeMarketCoins, StakePool>>;
2680
+ type StakeRewardPools = OptionalKeys$2<Record<SupportStakeMarketCoins, StakeRewardPool>>;
2681
+ type StakeAccounts = Record<SupportStakeMarketCoins, StakeAccount[]>;
2682
+ interface StakeAccount {
2683
+ id: string;
2684
+ type: string;
2685
+ stakePoolId: string;
2686
+ stakeType: string;
2687
+ staked: number;
2688
+ index: number;
2689
+ points: number;
2690
+ totalPoints: number;
2691
+ }
2692
+ interface StakePool {
2693
+ id: string;
2694
+ type: string;
2695
+ maxPoint: number;
2696
+ distributedPoint: number;
2697
+ pointPerPeriod: number;
2698
+ period: number;
2699
+ maxStake: number;
2700
+ stakeType: string;
2701
+ totalStaked: number;
2702
+ index: number;
2703
+ createdAt: number;
2704
+ lastUpdate: number;
2705
+ }
2706
+ interface StakeRewardPool {
2707
+ id: string;
2708
+ type: string;
2709
+ stakePoolId: string;
2710
+ ratioDenominator: number;
2711
+ ratioNumerator: number;
2712
+ rewards: number;
2713
+ claimedRewards: number;
2714
+ }
2715
+
2716
+ type OptionalKeys$1<T> = {
2717
+ [K in keyof T]?: T[K];
2718
+ };
2719
+ type Lendings = OptionalKeys$1<Record<SupportPoolCoins, Lending>>;
2720
+ type ObligationAccounts = OptionalKeys$1<Record<string, ObligationAccount>>;
2721
+ type Lending = Required<Pick<MarketPool, 'coinName' | 'symbol' | 'coinType' | 'marketCoinType' | 'sCoinType' | 'coinDecimal' | 'coinPrice' | 'conversionRate' | 'isIsolated'> & Pick<Spool, 'marketCoinPrice'>> & {
2722
+ supplyApr: number;
2723
+ supplyApy: number;
2724
+ rewardApr: number;
2725
+ suppliedAmount: number;
2726
+ suppliedCoin: number;
2727
+ suppliedValue: number;
2728
+ stakedMarketAmount: number;
2729
+ stakedMarketCoin: number;
2730
+ stakedAmount: number;
2731
+ stakedCoin: number;
2732
+ stakedValue: number;
2733
+ unstakedMarketAmount: number;
2734
+ unstakedMarketCoin: number;
2735
+ unstakedAmount: number;
2736
+ unstakedCoin: number;
2737
+ unstakedValue: number;
2738
+ availableSupplyAmount: number;
2739
+ availableSupplyCoin: number;
2740
+ availableWithdrawAmount: number;
2741
+ availableWithdrawCoin: number;
2742
+ availableStakeAmount: number;
2743
+ availableStakeCoin: number;
2744
+ availableUnstakeAmount: number;
2745
+ availableUnstakeCoin: number;
2746
+ availableClaimAmount: number;
2747
+ availableClaimCoin: number;
2748
+ };
2749
+ type ObligationAccount = {
2750
+ obligationId: string;
2751
+ totalDepositedValue: number;
2752
+ totalBorrowedValue: number;
2753
+ totalBalanceValue: number;
2754
+ totalBorrowCapacityValue: number;
2755
+ totalAvailableCollateralValue: number;
2756
+ totalBorrowedValueWithWeight: number;
2757
+ totalRequiredCollateralValue: number;
2758
+ totalUnhealthyCollateralValue: number;
2759
+ totalRiskLevel: number;
2760
+ totalDepositedPools: number;
2761
+ totalBorrowedPools: number;
2762
+ totalRewardedPools: number;
2763
+ collaterals: OptionalKeys$1<Record<SupportCollateralCoins, ObligationCollateral>>;
2764
+ debts: OptionalKeys$1<Record<SupportPoolCoins, ObligationDebt>>;
2765
+ borrowIncentives: OptionalKeys$1<Record<SupportPoolCoins, ObligationBorrowIncentive>>;
2766
+ };
2767
+ type ObligationCollateral = {
2768
+ coinName: SupportCollateralCoins;
2769
+ coinType: string;
2770
+ symbol: string;
2771
+ coinDecimal: number;
2772
+ coinPrice: number;
2773
+ depositedAmount: number;
2774
+ depositedCoin: number;
2775
+ depositedValue: number;
2776
+ borrowCapacityValue: number;
2777
+ requiredCollateralValue: number;
2778
+ availableDepositAmount: number;
2779
+ availableDepositCoin: number;
2780
+ availableWithdrawAmount: number;
2781
+ availableWithdrawCoin: number;
2782
+ };
2783
+ type ObligationDebt = {
2784
+ coinName: SupportPoolCoins;
2785
+ coinType: string;
2786
+ symbol: string;
2787
+ coinDecimal: number;
2788
+ coinPrice: number;
2789
+ borrowedAmount: number;
2790
+ borrowedCoin: number;
2791
+ borrowedValue: number;
2792
+ borrowedValueWithWeight: number;
2793
+ borrowIndex: number;
2794
+ requiredRepayAmount: number;
2795
+ requiredRepayCoin: number;
2796
+ availableBorrowAmount: number;
2797
+ availableBorrowCoin: number;
2798
+ availableRepayAmount: number;
2799
+ availableRepayCoin: number;
2800
+ };
2801
+ type ObligationBorrowIcentiveReward = {
2802
+ coinName: SupportBorrowIncentiveRewardCoins;
2803
+ coinType: string;
2804
+ symbol: string;
2805
+ coinDecimal: number;
2806
+ coinPrice: number;
2807
+ availableClaimCoin: number;
2808
+ availableClaimAmount: number;
2809
+ boostValue: number;
2810
+ };
2811
+ type ObligationBorrowIncentive = {
2812
+ coinName: SupportPoolCoins;
2813
+ coinType: string;
2814
+ symbol: string;
2815
+ coinDecimal: number;
2816
+ coinPrice: number;
2817
+ rewards: ObligationBorrowIcentiveReward[];
2818
+ };
2819
+ type TotalValueLocked = {
2820
+ supplyLendingValue: number;
2821
+ supplyCollateralValue: number;
2822
+ supplyValue: number;
2823
+ borrowValue: number;
2824
+ totalValue: number;
2825
+ supplyValueChangeRatio?: number;
2826
+ supplyLendingValueChangeRatio?: number;
2827
+ supplyCollateralValueChangeRatio?: number;
2828
+ borrowValueChangeRatio?: number;
2829
+ totalValueChangeRatio?: number;
2830
+ };
2831
+
2832
+ type sCoinBalance = number;
2833
+
2834
+ type Vesca = {
2835
+ id: string;
2836
+ keyId: string;
2837
+ keyObject?: SuiObjectRef;
2838
+ object: SuiObjectRef;
2839
+ lockedScaAmount: string;
2840
+ lockedScaCoin: number;
2841
+ currentVeScaBalance: number;
2842
+ unlockAt: number;
2843
+ };
2844
+ type VeScaTreasuryFields = {
2845
+ total_ve_sca_amount: string;
2846
+ sca_balance: string;
2847
+ unlock_schedule: {
2848
+ fields: {
2849
+ locked_sca_amount: string;
2850
+ };
2851
+ };
2852
+ };
2853
+ type VeScaTreasuryInfo = {
2854
+ totalLockedSca: number;
2855
+ totalVeSca: number;
2856
+ averageLockingPeriod: number;
2857
+ averageLockingPeriodUnit: string;
2858
+ };
2859
+
2860
+ interface AddressesInterface {
2861
+ core: {
2862
+ version: string;
2863
+ versionCap: string;
2864
+ object: string;
2865
+ market: string;
2866
+ adminCap: string;
2867
+ coinDecimalsRegistry: string;
2868
+ obligationAccessStore: string;
2869
+ coins: Partial<Record<SupportAssetCoins, {
2870
+ id: string;
2871
+ treasury: string;
2872
+ metaData: string;
2873
+ coinType: string;
2874
+ symbol: string;
2875
+ decimals: number;
2876
+ oracle: {
2877
+ [K in SupportOracleType]: K extends (typeof SUPPORT_ORACLES)[0] ? string : K extends (typeof SUPPORT_ORACLES)[1] ? string : K extends (typeof SUPPORT_ORACLES)[2] ? {
2878
+ feed: string;
2879
+ feedObject: string;
2880
+ } : never;
2881
+ };
2882
+ }>>;
2883
+ oracles: {
2884
+ [K in SupportOracleType]: K extends (typeof SUPPORT_ORACLES)[0] ? {
2885
+ registry: string;
2886
+ registryCap: string;
2887
+ holder: string;
2888
+ } : K extends (typeof SUPPORT_ORACLES)[1] ? {
2889
+ registry: string;
2890
+ registryCap: string;
2891
+ } : K extends (typeof SUPPORT_ORACLES)[2] ? {
2892
+ registry: string;
2893
+ registryCap: string;
2894
+ state: string;
2895
+ wormhole: string;
2896
+ wormholeState: string;
2897
+ } : never;
2898
+ } & {
2899
+ xOracle: string;
2900
+ xOracleCap: string;
2901
+ };
2902
+ packages: Partial<Record<SupportPackageType, {
2903
+ id: string;
2904
+ object?: string;
2905
+ upgradeCap: string;
2906
+ }>>;
2907
+ };
2908
+ spool: {
2909
+ id: string;
2910
+ adminCap: string;
2911
+ object: string;
2912
+ config: string;
2913
+ pools: Partial<Record<SupportStakeMarketCoins, {
2914
+ id: string;
2915
+ rewardPoolId: string;
2916
+ }>>;
2917
+ };
2918
+ borrowIncentive: {
2919
+ id: string;
2920
+ adminCap: string;
2921
+ object: string;
2922
+ query: string;
2923
+ config: string;
2924
+ incentivePools: string;
2925
+ incentiveAccounts: string;
2926
+ };
2927
+ vesca: {
2928
+ id: string;
2929
+ object: string;
2930
+ adminCap: string;
2931
+ tableId: string;
2932
+ table: string;
2933
+ treasury: string;
2934
+ config: string;
2935
+ };
2936
+ referral: {
2937
+ id: string;
2938
+ version: string;
2939
+ object: string;
2940
+ adminCap: string;
2941
+ referralBindings: string;
2942
+ bindingTableId: string;
2943
+ referralRevenuePool: string;
2944
+ revenueTableId: string;
2945
+ referralTiers: string;
2946
+ tiersTableId: string;
2947
+ authorizedWitnessList: string;
2948
+ };
2949
+ loyaltyProgram: {
2950
+ id: string;
2951
+ object: string;
2952
+ rewardPool: string;
2953
+ userRewardTableId: string;
2954
+ };
2955
+ scoin: {
2956
+ id: string;
2957
+ coins: Partial<Record<SupportSCoin, {
2958
+ coinType: string;
2959
+ symbol: string;
2960
+ treasury: string;
2961
+ metaData: string;
2962
+ }>>;
2963
+ };
2964
+ }
2965
+ type AddressPathsProps<T> = T extends string ? [] : {
2966
+ [K in Extract<keyof T, string>]: [K, ...AddressPathsProps<T[K]>];
2967
+ }[Extract<keyof T, string>];
2968
+ 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;
2969
+ type AddressStringPath = Join<AddressPathsProps<AddressesInterface>, '.'>;
2970
+
2971
+ type ScallopClientFnReturnType<T extends boolean> = T extends true ? SuiTransactionBlockResponse : Transaction;
2972
+ type ScallopClientVeScaReturnType<T extends boolean> = T extends true ? SuiTransactionBlockResponse : {
2973
+ tx: Transaction;
2974
+ scaCoin: TransactionResult;
2975
+ };
2976
+ type ScallopBaseInstanceParams = {
2977
+ suiKit?: SuiKit;
2978
+ };
2979
+ type ScallopCacheInstanceParams = ScallopBaseInstanceParams & {
2980
+ queryClient?: QueryClient;
2981
+ };
2982
+ type ScallopAddressInstanceParams = ScallopBaseInstanceParams & {
2983
+ cache?: ScallopCache;
2984
+ };
2985
+ type ScallopIndexerInstanceParams = {
2986
+ cache?: ScallopCache;
2987
+ };
2988
+ type ScallopUtilsInstanceParams = ScallopBaseInstanceParams & {
2989
+ address?: ScallopAddress;
2990
+ };
2991
+ type ScallopQueryInstanceParams = ScallopBaseInstanceParams & {
2992
+ utils?: ScallopUtils;
2993
+ indexer?: ScallopIndexer;
2994
+ };
2995
+ type ScallopBuilderInstanceParams = ScallopBaseInstanceParams & {
2996
+ query?: ScallopQuery;
2997
+ };
2998
+ type ScallopClientInstanceParams = ScallopBaseInstanceParams & {
2999
+ builder?: ScallopBuilder;
3000
+ };
3001
+ type ScallopAddressParams = {
3002
+ id: string;
3003
+ auth?: string;
3004
+ network?: NetworkType;
3005
+ forceInterface?: Partial<Record<NetworkType, AddressesInterface>>;
3006
+ };
3007
+ type ScallopParams = {
3008
+ addressesId?: string;
3009
+ forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
3010
+ walletAddress?: string;
3011
+ } & SuiKitParams;
3012
+ type ScallopClientParams = ScallopParams & ScallopBuilderParams & ScallopQueryParams & ScallopUtilsParams & ScallopCacheParams;
3013
+ type ScallopBuilderParams = ScallopParams & {
3014
+ pythEndpoints?: string[];
3015
+ usePythPullModel?: boolean;
3016
+ useOnChainXOracleList?: boolean;
3017
+ } & ScallopQueryParams;
3018
+ type ScallopQueryParams = ScallopParams & ScallopUtilsParams;
3019
+ type ScallopUtilsParams = ScallopParams & {
3020
+ pythEndpoints?: string[];
3021
+ };
3022
+ type ScallopCacheParams = Omit<ScallopParams, 'addressId' | 'forceAddressesInterface'> & {
3023
+ cacheOptions?: QueryClientConfig;
3024
+ };
3025
+
3026
+ type OptionalKeys<T> = {
3027
+ [K in keyof T]?: T[K];
3028
+ };
3029
+ type CoinPrices = OptionalKeys<Record<SupportCoins, number>>;
3030
+ type PoolAddressInfo = {
3031
+ name: string;
3032
+ coingeckoId: string;
3033
+ decimal: number;
3034
+ pythFeedId: string;
3035
+ lendingPoolAddress?: string;
3036
+ collateralPoolAddress?: string;
3037
+ borrowDynamic?: string;
3038
+ interestModelId?: string;
3039
+ borrowFeeKey?: string;
3040
+ supplyLimitKey?: string;
3041
+ borrowLimitKey?: string;
3042
+ isolatedAssetKey?: string;
3043
+ sCoinAddress: string | undefined;
3044
+ marketCoinAddress: string;
3045
+ sCoinName: string | undefined;
3046
+ };
3047
+
3048
+ declare const coinDecimals: SupportCoinDecimals;
3049
+ declare const assetCoins: AssetCoins;
3050
+ declare const marketCoins: MarketCoins;
3051
+ declare const sCoins: SCoins;
3052
+ declare const stakeMarketCoins: StakeMarketCoins;
3053
+ declare const spoolRewardCoins: StakeRewardCoins;
3054
+ declare const suiBridgeCoins: SuiBridgeCoins;
3055
+ declare const coinIds: AssetCoinIds;
3056
+ declare const wormholeCoinIds: WormholeCoinIds;
3057
+ declare const voloCoinIds: VoloCoinIds;
3058
+ declare const sCoinIds: SCoinIds;
3059
+ declare const sCoinTypeToName: Record<string, "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub" | "smusd" | "sns" | "susdy">;
3060
+ declare const sCoinRawNameToName: Record<string, "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub" | "smusd" | "sns" | "susdy">;
3061
+
3062
+ declare const FlashLoanFeeObjectMap: OptionalKeys<Record<SupportPoolCoins, string>>;
3063
+
3064
+ declare const POOL_ADDRESSES: OptionalKeys<Record<SupportPoolCoins, {
3065
+ coinName: string;
3066
+ symbol: string;
3067
+ coinType: string;
3068
+ lendingPoolAddress: string;
3069
+ borrowDynamic: string;
3070
+ interestModel: string;
3071
+ borrowFeeKey: string;
3072
+ coinMetadataId: string;
3073
+ decimals: number;
3074
+ pythFeed: string;
3075
+ pythFeedObjectId: string;
3076
+ collateralPoolAddress?: string;
3077
+ riskModel?: string;
3078
+ supplyLimitKey?: string;
3079
+ borrowLimitKey?: string;
3080
+ sCoinType?: string;
3081
+ sCoinName?: string;
3082
+ sCoinSymbol?: string;
3083
+ sCoinMetadataId?: string;
3084
+ sCoinTreasury?: string;
3085
+ isolatedAssetKey?: string;
3086
+ spool?: string;
3087
+ spoolReward?: string;
3088
+ spoolName?: string;
3089
+ }>>;
3090
+
3091
+ declare const PYTH_ENDPOINTS: {
3092
+ [k in 'mainnet' | 'testnet']: string[];
3093
+ };
3094
+ declare const PYTH_FEED_IDS: Record<SupportPoolCoins, string>;
3095
+
3096
+ declare const queryKeys: {
3097
+ api: {
3098
+ getAddresses: (addressesId?: string) => (string | {
3099
+ addressesId: string | undefined;
3100
+ })[];
3101
+ getMarket: () => string[];
3102
+ getSpools: () => string[];
3103
+ getBorrowIncentivePool: () => string[];
3104
+ getTotalValueLocked: () => string[];
3105
+ };
3106
+ rpc: {
3107
+ getInspectTxn: (queryTarget?: string, args?: SuiObjectArg[], typeArgs?: any[]) => (string | {
3108
+ queryTarget: string | undefined;
3109
+ args: string;
3110
+ typeArgs: string | undefined;
3111
+ })[];
3112
+ getObject: (objectId?: string, options?: SuiObjectDataOptions) => (string | {
3113
+ objectId: string | undefined;
3114
+ options: SuiObjectDataOptions | undefined;
3115
+ })[];
3116
+ getObjects: (objectIds?: string[]) => (string | {
3117
+ objectIds: string;
3118
+ })[];
3119
+ getOwnedObjects: (input?: Partial<GetOwnedObjectsParams>) => (string | {
3120
+ walletAddress: string | undefined;
3121
+ cursor: string | undefined;
3122
+ options: SuiObjectDataOptions | undefined;
3123
+ filter: string;
3124
+ limit: number | undefined;
3125
+ })[];
3126
+ getDynamicFields: (input?: Partial<GetDynamicFieldsParams>) => (string | {
3127
+ parentId: string | undefined;
3128
+ cursor: string | undefined;
3129
+ limit: number | undefined;
3130
+ })[];
3131
+ getDynamicFieldObject: (input?: Partial<GetDynamicFieldObjectParams>) => (string | {
3132
+ parentId: string | undefined;
3133
+ name: string;
3134
+ })[];
3135
+ getTotalVeScaTreasuryAmount: (refreshArgs?: any[], vescaAmountArgs?: (string | SuiObjectData | SuiTxArg)[]) => (string | {
3136
+ refreshArgs: string;
3137
+ vescaAmountArgs: string;
3138
+ })[];
3139
+ getAllCoinBalances: (owner?: string) => (string | {
3140
+ owner: string | undefined;
3141
+ })[];
3142
+ getNormalizedMoveFunction: (target?: string) => (string | undefined)[];
3143
+ };
3144
+ oracle: {
3145
+ getPythLatestPriceFeeds: () => string[];
3146
+ };
3147
+ };
3148
+
3149
+ declare const RPC_PROVIDERS: string[];
3150
+
3151
+ declare const TEST_ADDRESSES: AddressesInterface;
3152
+
3153
+ declare const UNLOCK_ROUND_DURATION: number;
3154
+ declare const MAX_LOCK_ROUNDS: 1460;
3155
+ declare const MAX_LOCK_DURATION: number;
3156
+ declare const MIN_INITIAL_LOCK_AMOUNT: 10000000000;
3157
+ declare const MIN_TOP_UP_AMOUNT: 1000000000;
3158
+
3159
+ declare const xOracleList: xOracleListType;
3160
+
3161
+ export { ADDRESSES_ID, API_BASE_URL, type AddressStringPath, type AddressesInterface, type AssetCoinIds, type AssetCoins, BORROW_FEE_PROTOCOL_ID, 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, COIN_GECKGO_IDS, 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, FlashLoanFeeObjectMap, 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 ObligationBorrowIcentiveReward, type ObligationBorrowIncentive, 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, PROTOCOL_OBJECT_ID, PYTH_ENDPOINTS, PYTH_FEED_IDS, type ParsedBorrowIncentiveAccountData, type ParsedBorrowIncentiveAccountPoolData, type ParsedBorrowIncentivePoolData, type ParsedBorrowIncentivePoolPointData, type ParsedMarketCollateralData, type ParsedMarketPoolData, type ParsedSpoolData, type ParsedSpoolRewardPoolData, type PoolAddressInfo, 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, SUPPORT_BORROW_INCENTIVE_POOLS, SUPPORT_BORROW_INCENTIVE_REWARDS, SUPPORT_COLLATERALS, SUPPORT_ORACLES, SUPPORT_PACKAGES, SUPPORT_POOLS, SUPPORT_SCOIN, SUPPORT_SPOOLS, SUPPORT_SPOOLS_REWARDS, SUPPORT_SUI_BRIDGE, SUPPORT_WORMHOLE, Scallop, ScallopAddress, type ScallopAddressInstanceParams, type ScallopAddressParams, type ScallopBaseInstanceParams, ScallopBuilder, type ScallopBuilderInstanceParams, type ScallopBuilderParams, ScallopCache, type ScallopCacheInstanceParams, type ScallopCacheParams, ScallopClient, type ScallopClientFnReturnType, type ScallopClientInstanceParams, type ScallopClientParams, type ScallopClientVeScaReturnType, ScallopIndexer, type ScallopIndexerInstanceParams, 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 SupportAssetCoins, type SupportBorrowIncentiveCoins, type SupportBorrowIncentiveRewardCoins, type SupportCoinDecimals, type SupportCoins, type SupportCollateralCoins, type SupportMarketCoins, type SupportOracleType, type SupportPackageType, type SupportPoolCoins, type SupportSCoin, type SupportStakeCoins, type SupportStakeMarketCoins, type SupportStakeRewardCoins, type SupportSuiBridgeCoins, type SupportWormholeCoins, 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 WormholeCoinIds, assetCoins, coinDecimals, coinIds, marketCoins, queryKeys, type sCoinBalance, sCoinIds, type sCoinNormalMethods, type sCoinPkgIds, type sCoinQuickMethods, sCoinRawNameToName, sCoinTypeToName, sCoins, spoolRewardCoins, stakeMarketCoins, suiBridgeCoins, voloCoinIds, wormholeCoinIds, xOracleList, type xOracleListType, type xOracleRuleType, type xOracleRules };