@scallop-io/sui-scallop-sdk 1.5.3 → 2.0.0-alpha.2
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.
- package/dist/index.d.mts +451 -602
- package/dist/index.d.ts +451 -602
- package/dist/index.js +29 -60
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
- package/src/builders/loyaltyProgramBuilder.ts +5 -3
- package/src/builders/oracle.ts +10 -24
- package/src/builders/referralBuilder.ts +5 -9
- package/src/builders/sCoinBuilder.ts +9 -8
- package/src/builders/spoolBuilder.ts +4 -6
- package/src/constants/common.ts +114 -126
- package/src/constants/index.ts +0 -5
- package/src/constants/pyth.ts +25 -34
- package/src/constants/queryKeys.ts +2 -0
- package/src/models/index.ts +1 -0
- package/src/models/scallop.ts +23 -19
- package/src/models/scallopAddress.ts +7 -4
- package/src/models/scallopBuilder.ts +36 -41
- package/src/models/scallopCache.ts +1 -1
- package/src/models/scallopClient.ts +93 -94
- package/src/models/scallopConstants.ts +342 -0
- package/src/models/scallopIndexer.ts +11 -24
- package/src/models/scallopQuery.ts +70 -77
- package/src/models/scallopUtils.ts +122 -249
- package/src/queries/borrowIncentiveQuery.ts +21 -56
- package/src/queries/borrowLimitQuery.ts +3 -6
- package/src/queries/coreQuery.ts +94 -112
- package/src/queries/flashloanFeeQuery.ts +86 -0
- package/src/queries/isolatedAssetQuery.ts +12 -11
- package/src/queries/poolAddressesQuery.ts +187 -112
- package/src/queries/portfolioQuery.ts +65 -67
- package/src/queries/priceQuery.ts +16 -22
- package/src/queries/sCoinQuery.ts +15 -16
- package/src/queries/spoolQuery.ts +49 -59
- package/src/queries/supplyLimitQuery.ts +2 -6
- package/src/queries/xOracleQuery.ts +4 -15
- package/src/types/address.ts +12 -18
- package/src/types/builder/borrowIncentive.ts +2 -3
- package/src/types/builder/core.ts +20 -27
- package/src/types/builder/index.ts +1 -2
- package/src/types/builder/referral.ts +4 -8
- package/src/types/builder/sCoin.ts +4 -8
- package/src/types/builder/spool.ts +7 -10
- package/src/types/constant/common.ts +43 -49
- package/src/types/constant/enum.ts +15 -27
- package/src/types/constant/xOracle.ts +3 -5
- package/src/types/model.ts +49 -28
- package/src/types/query/borrowIncentive.ts +7 -24
- package/src/types/query/core.ts +8 -18
- package/src/types/query/portfolio.ts +8 -17
- package/src/types/query/spool.ts +5 -11
- package/src/types/utils.ts +1 -21
- package/src/utils/core.ts +1 -1
- package/src/utils/query.ts +13 -20
- package/src/utils/util.ts +6 -84
- package/src/constants/coinGecko.ts +0 -34
- package/src/constants/enum.ts +0 -268
- package/src/constants/flashloan.ts +0 -18
- package/src/constants/poolAddress.ts +0 -898
- package/src/models/scallopPrice.ts +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, DevInspectResults, SuiObjectResponse, DynamicFieldPage, CoinBalance, GetBalanceParams, SuiObjectRef, SuiTransactionBlockResponse } from '@mysten/sui/client';
|
|
2
2
|
import * as _scallop_io_sui_kit from '@scallop-io/sui-kit';
|
|
3
|
-
import {
|
|
3
|
+
import { SuiObjectArg, SuiTxArg, SuiKit, NetworkType, SuiTxBlock, SuiVecTxArg, SuiAmountsArg, SuiAddressArg, TransactionResult as TransactionResult$1, SuiKitParams } from '@scallop-io/sui-kit';
|
|
4
4
|
import * as _mysten_sui_dist_cjs_client from '@mysten/sui/dist/cjs/client';
|
|
5
|
+
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
5
6
|
import { QueryClient, QueryClientConfig } from '@tanstack/query-core';
|
|
6
7
|
import { Transaction, TransactionObjectArgument, Argument, TransactionResult } from '@mysten/sui/transactions';
|
|
8
|
+
import { AxiosInstance } from 'axios';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Default cache options for the QueryClient.
|
|
@@ -20,51 +22,69 @@ declare const DEFAULT_CACHE_OPTIONS: {
|
|
|
20
22
|
};
|
|
21
23
|
};
|
|
22
24
|
|
|
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
25
|
declare const API_BASE_URL: "https://sui.apis.scallop.io";
|
|
49
26
|
declare const SDK_API_BASE_URL: "https://sdk.api.scallop.io";
|
|
50
27
|
declare const IS_VE_SCA_TEST: boolean;
|
|
51
28
|
declare const USE_TEST_ADDRESS: boolean;
|
|
52
|
-
declare const ADDRESS_ID: "65fb07c39c845425d71d7b18" | "67c44a103fe1b8c454eb9699";
|
|
53
|
-
declare const PROTOCOL_OBJECT_ID: "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" | "0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf";
|
|
54
|
-
declare const BORROW_FEE_PROTOCOL_ID: "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" | "0xc38f849e81cfe46d4e4320f508ea7dda42934a329d5a6571bb4c3cb6ea63f5da";
|
|
55
29
|
declare const SCA_COIN_TYPE: "0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA" | "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
|
|
56
30
|
declare const OLD_BORROW_INCENTIVE_PROTOCOL_ID: "0xc63072e7f5f4983a2efaf5bdba1480d5e7d74d57948e1c7cc436f8e22cbeb410";
|
|
57
|
-
|
|
58
|
-
declare const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
31
|
+
|
|
32
|
+
declare const queryKeys: {
|
|
33
|
+
api: {
|
|
34
|
+
getAddresses: (addressId?: string) => (string | {
|
|
35
|
+
addressId: string | undefined;
|
|
36
|
+
})[];
|
|
37
|
+
getWhiteList: () => string[];
|
|
38
|
+
getPoolAddresses: () => string[];
|
|
39
|
+
getMarket: () => string[];
|
|
40
|
+
getSpools: () => string[];
|
|
41
|
+
getBorrowIncentivePool: () => string[];
|
|
42
|
+
getTotalValueLocked: () => string[];
|
|
43
|
+
};
|
|
44
|
+
rpc: {
|
|
45
|
+
getInspectTxn: (queryTarget?: string, args?: SuiObjectArg[], typeArgs?: any[]) => (string | {
|
|
46
|
+
queryTarget: string | undefined;
|
|
47
|
+
args: string;
|
|
48
|
+
typeArgs: string | undefined;
|
|
49
|
+
})[];
|
|
50
|
+
getObject: (objectId?: string, options?: SuiObjectDataOptions) => (string | {
|
|
51
|
+
objectId: string | undefined;
|
|
52
|
+
options: SuiObjectDataOptions | undefined;
|
|
53
|
+
})[];
|
|
54
|
+
getObjects: (objectIds?: string[]) => (string | {
|
|
55
|
+
objectIds: string;
|
|
56
|
+
})[];
|
|
57
|
+
getOwnedObjects: (input?: Partial<GetOwnedObjectsParams>) => (string | {
|
|
58
|
+
walletAddress: string | undefined;
|
|
59
|
+
cursor: string | undefined;
|
|
60
|
+
options: SuiObjectDataOptions | undefined;
|
|
61
|
+
filter: string;
|
|
62
|
+
limit: number | undefined;
|
|
63
|
+
})[];
|
|
64
|
+
getDynamicFields: (input?: Partial<GetDynamicFieldsParams>) => (string | {
|
|
65
|
+
parentId: string | undefined;
|
|
66
|
+
cursor: string | undefined;
|
|
67
|
+
limit: number | undefined;
|
|
68
|
+
})[];
|
|
69
|
+
getDynamicFieldObject: (input?: Partial<GetDynamicFieldObjectParams>) => (string | {
|
|
70
|
+
parentId: string | undefined;
|
|
71
|
+
name: string;
|
|
72
|
+
})[];
|
|
73
|
+
getTotalVeScaTreasuryAmount: (refreshArgs?: any[], vescaAmountArgs?: (string | SuiObjectData | SuiTxArg)[]) => (string | {
|
|
74
|
+
refreshArgs: string;
|
|
75
|
+
vescaAmountArgs: string;
|
|
76
|
+
})[];
|
|
77
|
+
getAllCoinBalances: (owner?: string) => (string | {
|
|
78
|
+
owner: string | undefined;
|
|
79
|
+
})[];
|
|
80
|
+
getNormalizedMoveFunction: (target?: string) => (string | undefined)[];
|
|
81
|
+
};
|
|
82
|
+
oracle: {
|
|
83
|
+
getPythLatestPriceFeeds: () => string[];
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
declare const RPC_PROVIDERS: string[];
|
|
68
88
|
|
|
69
89
|
type QueryInspectTxnParams = {
|
|
70
90
|
queryTarget: string;
|
|
@@ -290,6 +310,61 @@ declare class ScallopAddress {
|
|
|
290
310
|
delete(id?: string, auth?: string): Promise<void>;
|
|
291
311
|
}
|
|
292
312
|
|
|
313
|
+
/**
|
|
314
|
+
* @description
|
|
315
|
+
* It provides methods to construct constants for Scallop SDK instances.
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```typescript
|
|
319
|
+
* const scallopConstants = new ScallopConstants();
|
|
320
|
+
* await scallopConstants.init();
|
|
321
|
+
* ```
|
|
322
|
+
*/
|
|
323
|
+
declare class ScallopConstants {
|
|
324
|
+
readonly params: ScallopConstantsParams;
|
|
325
|
+
private readonly _requestClient;
|
|
326
|
+
address: ScallopAddress;
|
|
327
|
+
cache: ScallopCache;
|
|
328
|
+
private _poolAddresses;
|
|
329
|
+
private _whitelist;
|
|
330
|
+
private _coinDecimals;
|
|
331
|
+
private _coinNameToCoinTypeMap;
|
|
332
|
+
private _coinNameToOldMarketCoinTypeMap;
|
|
333
|
+
private _scoinRawNameToSCoinNameMap;
|
|
334
|
+
private _scoinTypeToSCoinNameMap;
|
|
335
|
+
private _wormholeCoinTypeToCoinNameMap;
|
|
336
|
+
private _voloCoinTypeToCoinNameMap;
|
|
337
|
+
private _suiBridgeCoinTypeToCoinNameMap;
|
|
338
|
+
private _coinTypes;
|
|
339
|
+
private _sCoinTypes;
|
|
340
|
+
private _coinTypeToCoinNameMap;
|
|
341
|
+
constructor(params: ScallopConstantsParams, instance?: ScallopConstantsInstanceParams);
|
|
342
|
+
get isAddressInitialized(): boolean;
|
|
343
|
+
get isInitialized(): boolean;
|
|
344
|
+
get queryClient(): _tanstack_query_core.QueryClient;
|
|
345
|
+
get poolAddresses(): Record<string, PoolAddress | undefined>;
|
|
346
|
+
get whitelist(): Whitelist;
|
|
347
|
+
parseToOldMarketCoin(coinType: string): string;
|
|
348
|
+
get protocolObjectId(): string;
|
|
349
|
+
get coinDecimals(): Record<string, number | undefined>;
|
|
350
|
+
get coinTypes(): Record<string, string | undefined>;
|
|
351
|
+
get wormholeCoinTypeToCoinName(): Record<string, string | undefined>;
|
|
352
|
+
get coinNameToCoinTypeMap(): Record<string, string | undefined>;
|
|
353
|
+
get coinTypeToCoinNameMap(): Record<string, string | undefined>;
|
|
354
|
+
get coinNameToOldMarketCoinTypeMap(): Record<string, string | undefined>;
|
|
355
|
+
get sCoinRawNameToScoinNameMap(): Record<string, string | undefined>;
|
|
356
|
+
get sCoinTypeToSCoinNameMap(): Record<string, string | undefined>;
|
|
357
|
+
get voloCoinTypeToCoinNameMap(): Record<string, string | undefined>;
|
|
358
|
+
get suiBridgeCoinTypeToCoinNameMap(): Record<string, string | undefined>;
|
|
359
|
+
get sCoinTypes(): Record<string, string | undefined>;
|
|
360
|
+
get supportedBorrowIncentiveRewards(): Set<string>;
|
|
361
|
+
private isEmptyObject;
|
|
362
|
+
private readApi;
|
|
363
|
+
readWhiteList(): Promise<Whitelist>;
|
|
364
|
+
readPoolAddresses(): Promise<Record<string, PoolAddress>>;
|
|
365
|
+
init(params?: Partial<ScallopConstantsParams>): Promise<void>;
|
|
366
|
+
}
|
|
367
|
+
|
|
293
368
|
/**
|
|
294
369
|
* @description
|
|
295
370
|
* Integrates some helper functions frequently used in interactions with the Scallop contract.
|
|
@@ -304,28 +379,30 @@ declare class ScallopAddress {
|
|
|
304
379
|
*/
|
|
305
380
|
declare class ScallopUtils {
|
|
306
381
|
readonly params: ScallopUtilsParams;
|
|
307
|
-
readonly isTestnet: boolean;
|
|
308
382
|
suiKit: SuiKit;
|
|
309
383
|
address: ScallopAddress;
|
|
310
384
|
cache: ScallopCache;
|
|
385
|
+
constants: ScallopConstants;
|
|
311
386
|
walletAddress: string;
|
|
312
387
|
constructor(params: ScallopUtilsParams, instance?: ScallopUtilsInstanceParams);
|
|
313
|
-
|
|
314
|
-
|
|
388
|
+
get whitelist(): Whitelist;
|
|
389
|
+
isSuiBridgeAsset(coinName: any): boolean;
|
|
390
|
+
isWormholeAsset(coinName: any): boolean;
|
|
391
|
+
isMarketCoin(coinName: string): boolean;
|
|
315
392
|
/**
|
|
316
393
|
* Request the scallop API to initialize data.
|
|
317
394
|
*
|
|
318
395
|
* @param force - Whether to force initialization.
|
|
319
396
|
* @param address - ScallopAddress instance.
|
|
320
397
|
*/
|
|
321
|
-
init(force?: boolean
|
|
398
|
+
init(force?: boolean): Promise<void>;
|
|
322
399
|
/**
|
|
323
400
|
* Convert coin name to symbol.
|
|
324
401
|
*
|
|
325
402
|
* @param coinName - Specific support coin name.
|
|
326
403
|
* @return Symbol string.
|
|
327
404
|
*/
|
|
328
|
-
parseSymbol(coinName:
|
|
405
|
+
parseSymbol(coinName: string): string;
|
|
329
406
|
/**
|
|
330
407
|
* Convert coin name to coin type.
|
|
331
408
|
*
|
|
@@ -337,14 +414,14 @@ declare class ScallopUtils {
|
|
|
337
414
|
* @param coinName - Specific support coin name.
|
|
338
415
|
* @return Coin type.
|
|
339
416
|
*/
|
|
340
|
-
parseCoinType(coinName:
|
|
417
|
+
parseCoinType(coinName: string, useOldMarketCoin?: boolean): string;
|
|
341
418
|
/**
|
|
342
419
|
* Convert coin name to sCoin name.
|
|
343
420
|
*
|
|
344
421
|
* @param coinName - Specific support coin name.
|
|
345
422
|
* @return sCoin name.
|
|
346
423
|
*/
|
|
347
|
-
parseSCoinName<T extends
|
|
424
|
+
parseSCoinName<T extends string>(coinName: string): T | undefined;
|
|
348
425
|
/**
|
|
349
426
|
* Convert sCoin name to market coin name.
|
|
350
427
|
* This function will parse new sCoin name `scallop_...` to its old market coin name which is shorter
|
|
@@ -352,31 +429,31 @@ declare class ScallopUtils {
|
|
|
352
429
|
* if no `scallop_...` is encountered, return coinName
|
|
353
430
|
* @return sCoin name
|
|
354
431
|
*/
|
|
355
|
-
parseSCoinTypeNameToMarketCoinName(coinName: string):
|
|
432
|
+
parseSCoinTypeNameToMarketCoinName(coinName: string): string;
|
|
356
433
|
/**
|
|
357
434
|
* Convert sCoin name into sCoin type
|
|
358
435
|
* @param sCoinName
|
|
359
436
|
* @returns sCoin type
|
|
360
437
|
*/
|
|
361
|
-
parseSCoinType(sCoinName:
|
|
438
|
+
parseSCoinType(sCoinName: string): string;
|
|
362
439
|
/**
|
|
363
440
|
* Convert sCoinType into sCoin name
|
|
364
441
|
* @param sCoinType
|
|
365
442
|
* @returns sCoin name
|
|
366
443
|
*/
|
|
367
|
-
parseSCoinNameFromType(sCoinType: string):
|
|
444
|
+
parseSCoinNameFromType(sCoinType: string): string | undefined;
|
|
368
445
|
/**
|
|
369
446
|
* Convert sCoin name into its underlying coin type
|
|
370
447
|
* @param sCoinName
|
|
371
448
|
* @returns coin type
|
|
372
449
|
*/
|
|
373
|
-
parseUnderlyingSCoinType(sCoinName:
|
|
450
|
+
parseUnderlyingSCoinType(sCoinName: string): string;
|
|
374
451
|
/**
|
|
375
452
|
* Get sCoin treasury id from sCoin name
|
|
376
453
|
* @param sCoinName
|
|
377
454
|
* @returns sCoin treasury id
|
|
378
455
|
*/
|
|
379
|
-
getSCoinTreasury(sCoinName:
|
|
456
|
+
getSCoinTreasury(sCoinName: string): any;
|
|
380
457
|
/**
|
|
381
458
|
* Convert coin name to market coin type.
|
|
382
459
|
*
|
|
@@ -384,7 +461,7 @@ declare class ScallopUtils {
|
|
|
384
461
|
* @param coinName - Specific support coin name.
|
|
385
462
|
* @return Market coin type.
|
|
386
463
|
*/
|
|
387
|
-
parseMarketCoinType(coinName:
|
|
464
|
+
parseMarketCoinType(coinName: string): string;
|
|
388
465
|
/**
|
|
389
466
|
* Convert coin type to coin name.
|
|
390
467
|
*
|
|
@@ -395,43 +472,40 @@ declare class ScallopUtils {
|
|
|
395
472
|
* @param coinType - Specific support coin type.
|
|
396
473
|
* @return Coin Name.
|
|
397
474
|
*/
|
|
398
|
-
parseCoinNameFromType
|
|
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;
|
|
475
|
+
parseCoinNameFromType(coinType: string): string;
|
|
402
476
|
/**
|
|
403
477
|
* Convert market coin name to coin name.
|
|
404
478
|
*
|
|
405
479
|
* @param marketCoinName - Specific support market coin name.
|
|
406
480
|
* @return Coin Name.
|
|
407
481
|
*/
|
|
408
|
-
parseCoinName<T extends
|
|
482
|
+
parseCoinName<T extends string>(marketCoinName: string): T;
|
|
409
483
|
/**
|
|
410
484
|
* Convert coin name to market coin name.
|
|
411
485
|
*
|
|
412
486
|
* @param coinName - Specific support coin name.
|
|
413
487
|
* @return Market coin name.
|
|
414
488
|
*/
|
|
415
|
-
parseMarketCoinName<T extends
|
|
489
|
+
parseMarketCoinName<T extends string>(coinName: string): T;
|
|
416
490
|
/**
|
|
417
491
|
* Get reward type of spool.
|
|
418
492
|
*
|
|
419
493
|
* @param stakeMarketCoinName - Support stake market coin.
|
|
420
494
|
* @return Spool reward coin name.
|
|
421
495
|
*/
|
|
422
|
-
getSpoolRewardCoinName: (
|
|
496
|
+
getSpoolRewardCoinName: () => string;
|
|
423
497
|
/**
|
|
424
498
|
* Get coin decimal.
|
|
425
499
|
*
|
|
426
500
|
* return Coin decimal.
|
|
427
501
|
*/
|
|
428
|
-
getCoinDecimal(coinName:
|
|
502
|
+
getCoinDecimal(coinName: string): number;
|
|
429
503
|
/**
|
|
430
504
|
* Get coin wrapped type.
|
|
431
505
|
*
|
|
432
506
|
* return Coin wrapped type.
|
|
433
507
|
*/
|
|
434
|
-
getCoinWrappedType(assetCoinName:
|
|
508
|
+
getCoinWrappedType(assetCoinName: string): CoinWrappedType;
|
|
435
509
|
/**
|
|
436
510
|
* Select coin id that add up to the given amount as transaction arguments.
|
|
437
511
|
*
|
|
@@ -464,7 +538,7 @@ declare class ScallopUtils {
|
|
|
464
538
|
* @param obligationId - The obligation id.
|
|
465
539
|
* @return Asset coin Names.
|
|
466
540
|
*/
|
|
467
|
-
getObligationCoinNames(obligationId: SuiObjectArg): Promise<
|
|
541
|
+
getObligationCoinNames(obligationId: SuiObjectArg): Promise<string[] | undefined>;
|
|
468
542
|
/**
|
|
469
543
|
* Get asset coin price.
|
|
470
544
|
*
|
|
@@ -477,7 +551,7 @@ declare class ScallopUtils {
|
|
|
477
551
|
* @param assetCoinNames - Specific an array of support asset coin name.
|
|
478
552
|
* @return Asset coin price.
|
|
479
553
|
*/
|
|
480
|
-
getCoinPrices(
|
|
554
|
+
getCoinPrices(coinNames?: string[]): Promise<OptionalKeys<Record<string, number>>>;
|
|
481
555
|
/**
|
|
482
556
|
* Convert apr to apy.
|
|
483
557
|
*
|
|
@@ -512,7 +586,7 @@ declare class ScallopUtils {
|
|
|
512
586
|
* Get detailed contract address and price id information for supported pool in Scallop
|
|
513
587
|
* @returns Supported pool informations
|
|
514
588
|
*/
|
|
515
|
-
getSupportedPoolAddresses():
|
|
589
|
+
getSupportedPoolAddresses(): PoolAddress[];
|
|
516
590
|
}
|
|
517
591
|
|
|
518
592
|
/**
|
|
@@ -529,9 +603,9 @@ declare class ScallopUtils {
|
|
|
529
603
|
*/
|
|
530
604
|
declare class ScallopIndexer {
|
|
531
605
|
private readonly cache;
|
|
532
|
-
readonly params:
|
|
606
|
+
readonly params: ScallopIndexerParams;
|
|
533
607
|
private readonly _requestClient;
|
|
534
|
-
constructor(params
|
|
608
|
+
constructor(params: ScallopIndexerParams, instance?: ScallopIndexerInstanceParams);
|
|
535
609
|
/**
|
|
536
610
|
* Get market index data.
|
|
537
611
|
*
|
|
@@ -549,7 +623,7 @@ declare class ScallopIndexer {
|
|
|
549
623
|
*
|
|
550
624
|
* @return Market pool data.
|
|
551
625
|
*/
|
|
552
|
-
getMarketPool(poolCoinName:
|
|
626
|
+
getMarketPool(poolCoinName: string): Promise<MarketPool>;
|
|
553
627
|
/**
|
|
554
628
|
* Get market collaterals index data.
|
|
555
629
|
*
|
|
@@ -561,7 +635,7 @@ declare class ScallopIndexer {
|
|
|
561
635
|
*
|
|
562
636
|
* @return Market collateral data.
|
|
563
637
|
*/
|
|
564
|
-
getMarketCollateral(collateralCoinName:
|
|
638
|
+
getMarketCollateral(collateralCoinName: string): Promise<MarketCollateral>;
|
|
565
639
|
/**
|
|
566
640
|
* Get spools index data.
|
|
567
641
|
*
|
|
@@ -573,7 +647,7 @@ declare class ScallopIndexer {
|
|
|
573
647
|
*
|
|
574
648
|
* @return Spool data.
|
|
575
649
|
*/
|
|
576
|
-
getSpool(marketCoinName:
|
|
650
|
+
getSpool(marketCoinName: string): Promise<Spool>;
|
|
577
651
|
/**
|
|
578
652
|
* Get borrow incentive pools index data.
|
|
579
653
|
*
|
|
@@ -585,7 +659,7 @@ declare class ScallopIndexer {
|
|
|
585
659
|
*
|
|
586
660
|
* @return Borrow incentive pool data.
|
|
587
661
|
*/
|
|
588
|
-
getBorrowIncentivePool(borrowIncentiveCoinName:
|
|
662
|
+
getBorrowIncentivePool(borrowIncentiveCoinName: string): Promise<BorrowIncentivePool>;
|
|
589
663
|
/**
|
|
590
664
|
* Get total value locked index data.
|
|
591
665
|
*
|
|
@@ -601,7 +675,7 @@ declare class ScallopIndexer {
|
|
|
601
675
|
*
|
|
602
676
|
* @return price data.
|
|
603
677
|
*/
|
|
604
|
-
getCoinPrice(poolCoinName:
|
|
678
|
+
getCoinPrice(poolCoinName: string): Promise<number>;
|
|
605
679
|
getCoinPrices(): Promise<Record<string, number>>;
|
|
606
680
|
}
|
|
607
681
|
|
|
@@ -622,17 +696,18 @@ declare class ScallopQuery {
|
|
|
622
696
|
suiKit: SuiKit;
|
|
623
697
|
address: ScallopAddress;
|
|
624
698
|
utils: ScallopUtils;
|
|
699
|
+
constants: ScallopConstants;
|
|
625
700
|
indexer: ScallopIndexer;
|
|
626
701
|
cache: ScallopCache;
|
|
627
702
|
walletAddress: string;
|
|
628
|
-
constructor(params
|
|
703
|
+
constructor(params: ScallopQueryParams, instance?: ScallopQueryInstanceParams);
|
|
629
704
|
/**
|
|
630
705
|
* Request the scallop API to initialize data.
|
|
631
706
|
*
|
|
632
707
|
* @param force - Whether to force initialization.
|
|
633
708
|
* @param address - ScallopAddress instance.
|
|
634
709
|
*/
|
|
635
|
-
init(force?: boolean
|
|
710
|
+
init(force?: boolean): Promise<void>;
|
|
636
711
|
/**
|
|
637
712
|
* @deprecated use getMarketPools
|
|
638
713
|
* Query market data.
|
|
@@ -654,7 +729,7 @@ declare class ScallopQuery {
|
|
|
654
729
|
* @param indexer - Whether to use indexer.
|
|
655
730
|
* @return Market pools data.
|
|
656
731
|
*/
|
|
657
|
-
getMarketPools(poolCoinNames?:
|
|
732
|
+
getMarketPools(poolCoinNames?: string[], args?: {
|
|
658
733
|
coinPrices?: CoinPrices;
|
|
659
734
|
indexer?: boolean;
|
|
660
735
|
}): Promise<{
|
|
@@ -668,7 +743,7 @@ declare class ScallopQuery {
|
|
|
668
743
|
* @param indexer - Whether to use indexer.
|
|
669
744
|
* @return Market pool data.
|
|
670
745
|
*/
|
|
671
|
-
getMarketPool(poolCoinName:
|
|
746
|
+
getMarketPool(poolCoinName: string, args?: {
|
|
672
747
|
coinPrice?: number;
|
|
673
748
|
indexer?: boolean;
|
|
674
749
|
}): Promise<MarketPool | undefined>;
|
|
@@ -683,27 +758,10 @@ declare class ScallopQuery {
|
|
|
683
758
|
* @param indexer - Whether to use indexer.
|
|
684
759
|
* @return Market collaterals data.
|
|
685
760
|
*/
|
|
686
|
-
getMarketCollaterals(collateralCoinNames?:
|
|
761
|
+
getMarketCollaterals(collateralCoinNames?: string[], args?: {
|
|
687
762
|
indexer?: boolean;
|
|
688
763
|
}): Promise<{
|
|
689
|
-
|
|
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;
|
|
764
|
+
[x: string]: MarketCollateral | undefined;
|
|
707
765
|
}>;
|
|
708
766
|
/**
|
|
709
767
|
* Get market collateral
|
|
@@ -712,7 +770,7 @@ declare class ScallopQuery {
|
|
|
712
770
|
* @param indexer - Whether to use indexer.
|
|
713
771
|
* @return Market collateral data.
|
|
714
772
|
*/
|
|
715
|
-
getMarketCollateral(collateralCoinName:
|
|
773
|
+
getMarketCollateral(collateralCoinName: string, args?: {
|
|
716
774
|
indexer?: boolean;
|
|
717
775
|
}): Promise<MarketCollateral | undefined>;
|
|
718
776
|
/**
|
|
@@ -736,7 +794,7 @@ declare class ScallopQuery {
|
|
|
736
794
|
* @param ownerAddress - The owner address.
|
|
737
795
|
* @return All coin amounts.
|
|
738
796
|
*/
|
|
739
|
-
getCoinAmounts(assetCoinNames?:
|
|
797
|
+
getCoinAmounts(assetCoinNames?: string[], ownerAddress?: string): Promise<OptionalKeys<Record<string, number>>>;
|
|
740
798
|
/**
|
|
741
799
|
* Get asset coin amount.
|
|
742
800
|
*
|
|
@@ -744,7 +802,7 @@ declare class ScallopQuery {
|
|
|
744
802
|
* @param ownerAddress - The owner address.
|
|
745
803
|
* @return Coin amount.
|
|
746
804
|
*/
|
|
747
|
-
getCoinAmount(assetCoinName:
|
|
805
|
+
getCoinAmount(assetCoinName: string, ownerAddress?: string): Promise<number>;
|
|
748
806
|
/**
|
|
749
807
|
* Get all market coin amounts.
|
|
750
808
|
*
|
|
@@ -752,7 +810,7 @@ declare class ScallopQuery {
|
|
|
752
810
|
* @param ownerAddress - The owner address.
|
|
753
811
|
* @return All market market coin amounts.
|
|
754
812
|
*/
|
|
755
|
-
getMarketCoinAmounts(marketCoinNames?:
|
|
813
|
+
getMarketCoinAmounts(marketCoinNames?: string[], ownerAddress?: string): Promise<OptionalKeys<Record<string, number>>>;
|
|
756
814
|
/**
|
|
757
815
|
* Get market coin amount.
|
|
758
816
|
*
|
|
@@ -760,21 +818,21 @@ declare class ScallopQuery {
|
|
|
760
818
|
* @param ownerAddress - The owner address.
|
|
761
819
|
* @return Market market coin amount.
|
|
762
820
|
*/
|
|
763
|
-
getMarketCoinAmount(marketCoinName:
|
|
821
|
+
getMarketCoinAmount(marketCoinName: string, ownerAddress?: string): Promise<number>;
|
|
764
822
|
/**
|
|
765
823
|
* Get price from pyth fee object.
|
|
766
824
|
*
|
|
767
825
|
* @param assetCoinName - Specific support asset coin name.
|
|
768
826
|
* @return Asset coin price.
|
|
769
827
|
*/
|
|
770
|
-
getPriceFromPyth(assetCoinName:
|
|
828
|
+
getPriceFromPyth(assetCoinName: string): Promise<number>;
|
|
771
829
|
/**
|
|
772
830
|
* Get prices from pyth fee object.
|
|
773
831
|
*
|
|
774
832
|
* @param assetCoinNames - Array of supported asset coin names.
|
|
775
833
|
* @return Array of asset coin prices.
|
|
776
834
|
*/
|
|
777
|
-
getPricesFromPyth(assetCoinNames:
|
|
835
|
+
getPricesFromPyth(assetCoinNames: string[]): Promise<Record<string, number>>;
|
|
778
836
|
/**
|
|
779
837
|
* Get spools data.
|
|
780
838
|
*
|
|
@@ -782,20 +840,12 @@ declare class ScallopQuery {
|
|
|
782
840
|
* @param indexer - Whether to use indexer.
|
|
783
841
|
* @return Spools data.
|
|
784
842
|
*/
|
|
785
|
-
getSpools(stakeMarketCoinNames?:
|
|
843
|
+
getSpools(stakeMarketCoinNames?: string[], args?: {
|
|
786
844
|
marketPools?: MarketPools;
|
|
787
845
|
coinPrices?: CoinPrices;
|
|
788
846
|
indexer?: boolean;
|
|
789
847
|
}): Promise<{
|
|
790
|
-
|
|
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;
|
|
848
|
+
[x: string]: Spool | undefined;
|
|
799
849
|
}>;
|
|
800
850
|
/**
|
|
801
851
|
* Get spool data.
|
|
@@ -804,7 +854,7 @@ declare class ScallopQuery {
|
|
|
804
854
|
* @param indexer - Whether to use indexer.
|
|
805
855
|
* @return Spool data.
|
|
806
856
|
*/
|
|
807
|
-
getSpool(stakeMarketCoinName:
|
|
857
|
+
getSpool(stakeMarketCoinName: string, args?: {
|
|
808
858
|
marketPool?: MarketPool;
|
|
809
859
|
coinPrices?: CoinPrices;
|
|
810
860
|
indexer?: boolean;
|
|
@@ -823,7 +873,7 @@ declare class ScallopQuery {
|
|
|
823
873
|
* @param ownerAddress - The owner address.
|
|
824
874
|
* @return Stake accounts data.
|
|
825
875
|
*/
|
|
826
|
-
getStakeAccounts(stakeMarketCoinName:
|
|
876
|
+
getStakeAccounts(stakeMarketCoinName: string, ownerAddress?: string): Promise<StakeAccount[]>;
|
|
827
877
|
/**
|
|
828
878
|
* Get stake pools (spools) data.
|
|
829
879
|
*
|
|
@@ -834,16 +884,8 @@ declare class ScallopQuery {
|
|
|
834
884
|
* @param stakeMarketCoinNames - Specific an array of support stake market coin name.
|
|
835
885
|
* @return Stake pools data.
|
|
836
886
|
*/
|
|
837
|
-
getStakePools(stakeMarketCoinNames?:
|
|
838
|
-
|
|
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;
|
|
887
|
+
getStakePools(stakeMarketCoinNames?: string[]): Promise<{
|
|
888
|
+
[x: string]: StakePool | undefined;
|
|
847
889
|
}>;
|
|
848
890
|
/**
|
|
849
891
|
* Get stake pool (spool) data.
|
|
@@ -855,7 +897,7 @@ declare class ScallopQuery {
|
|
|
855
897
|
* @param stakeMarketCoinName - Specific support stake market coin name.
|
|
856
898
|
* @return Stake pool data.
|
|
857
899
|
*/
|
|
858
|
-
getStakePool(stakeMarketCoinName:
|
|
900
|
+
getStakePool(stakeMarketCoinName: string): Promise<StakePool | undefined>;
|
|
859
901
|
/**
|
|
860
902
|
* Get stake reward pools data.
|
|
861
903
|
*
|
|
@@ -866,16 +908,8 @@ declare class ScallopQuery {
|
|
|
866
908
|
* @param stakeMarketCoinNames - Specific an array of stake market coin name.
|
|
867
909
|
* @return Stake reward pools data.
|
|
868
910
|
*/
|
|
869
|
-
getStakeRewardPools(stakeMarketCoinNames?:
|
|
870
|
-
|
|
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;
|
|
911
|
+
getStakeRewardPools(stakeMarketCoinNames?: string[]): Promise<{
|
|
912
|
+
[x: string]: StakeRewardPool | undefined;
|
|
879
913
|
}>;
|
|
880
914
|
/**
|
|
881
915
|
* Get stake reward pool data.
|
|
@@ -887,7 +921,7 @@ declare class ScallopQuery {
|
|
|
887
921
|
* @param marketCoinName - Specific support stake market coin name.
|
|
888
922
|
* @return Stake reward pool data.
|
|
889
923
|
*/
|
|
890
|
-
getStakeRewardPool(stakeMarketCoinName:
|
|
924
|
+
getStakeRewardPool(stakeMarketCoinName: string): Promise<StakeRewardPool | undefined>;
|
|
891
925
|
/**
|
|
892
926
|
* Get borrow incentive pools data.
|
|
893
927
|
*
|
|
@@ -895,34 +929,12 @@ declare class ScallopQuery {
|
|
|
895
929
|
* @param indexer - Whether to use indexer.
|
|
896
930
|
* @return Borrow incentive pools data.
|
|
897
931
|
*/
|
|
898
|
-
getBorrowIncentivePools(coinNames?:
|
|
932
|
+
getBorrowIncentivePools(coinNames?: string[], args?: {
|
|
899
933
|
coinPrices?: CoinPrices;
|
|
900
934
|
indexer?: boolean;
|
|
901
935
|
marketPools?: MarketPools;
|
|
902
936
|
}): Promise<{
|
|
903
|
-
|
|
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;
|
|
937
|
+
[x: string]: BorrowIncentivePool | undefined;
|
|
926
938
|
}>;
|
|
927
939
|
/**
|
|
928
940
|
* Get borrow incentive accounts data.
|
|
@@ -931,30 +943,8 @@ declare class ScallopQuery {
|
|
|
931
943
|
* @param ownerAddress - The owner address.
|
|
932
944
|
* @return Borrow incentive accounts data.
|
|
933
945
|
*/
|
|
934
|
-
getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef, coinNames?:
|
|
935
|
-
|
|
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;
|
|
946
|
+
getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef, coinNames?: string[]): Promise<{
|
|
947
|
+
[x: string]: ParsedBorrowIncentiveAccountData | undefined;
|
|
958
948
|
}>;
|
|
959
949
|
/**
|
|
960
950
|
* Get user lending and spool infomation for specific pools.
|
|
@@ -964,34 +954,12 @@ declare class ScallopQuery {
|
|
|
964
954
|
* @param indexer - Whether to use indexer.
|
|
965
955
|
* @return All lending and spool infomation.
|
|
966
956
|
*/
|
|
967
|
-
getLendings(poolCoinNames?:
|
|
957
|
+
getLendings(poolCoinNames?: string[], ownerAddress?: string, args?: {
|
|
968
958
|
indexer?: boolean;
|
|
969
959
|
marketPools?: MarketPools;
|
|
970
960
|
coinPrices?: CoinPrices;
|
|
971
961
|
}): Promise<{
|
|
972
|
-
|
|
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;
|
|
962
|
+
[x: string]: Lending | undefined;
|
|
995
963
|
}>;
|
|
996
964
|
/**
|
|
997
965
|
* Get user lending and spool information for specific pool.
|
|
@@ -1001,7 +969,7 @@ declare class ScallopQuery {
|
|
|
1001
969
|
* @param indexer - Whether to use indexer.
|
|
1002
970
|
* @return Lending pool data.
|
|
1003
971
|
*/
|
|
1004
|
-
getLending(poolCoinName:
|
|
972
|
+
getLending(poolCoinName: string, ownerAddress?: string, args?: {
|
|
1005
973
|
indexer?: boolean;
|
|
1006
974
|
}): Promise<Lending>;
|
|
1007
975
|
/**
|
|
@@ -1099,7 +1067,7 @@ declare class ScallopQuery {
|
|
|
1099
1067
|
* @param sCoinName - Supported sCoin name
|
|
1100
1068
|
* @returns Total Supply
|
|
1101
1069
|
*/
|
|
1102
|
-
getSCoinTotalSupply(sCoinName:
|
|
1070
|
+
getSCoinTotalSupply(sCoinName: string): Promise<number>;
|
|
1103
1071
|
/**
|
|
1104
1072
|
* Get all sCoin amounts.
|
|
1105
1073
|
*
|
|
@@ -1107,7 +1075,7 @@ declare class ScallopQuery {
|
|
|
1107
1075
|
* @param ownerAddress - The owner address.
|
|
1108
1076
|
* @return All market sCoin amounts.
|
|
1109
1077
|
*/
|
|
1110
|
-
getSCoinAmounts(sCoinNames?:
|
|
1078
|
+
getSCoinAmounts(sCoinNames?: string[], ownerAddress?: string): Promise<OptionalKeys<Record<string, number>>>;
|
|
1111
1079
|
/**
|
|
1112
1080
|
* Get sCoin amount.
|
|
1113
1081
|
*
|
|
@@ -1115,22 +1083,22 @@ declare class ScallopQuery {
|
|
|
1115
1083
|
* @param ownerAddress - The owner address.
|
|
1116
1084
|
* @return sCoin amount.
|
|
1117
1085
|
*/
|
|
1118
|
-
getSCoinAmount(sCoinName:
|
|
1086
|
+
getSCoinAmount(sCoinName: string | string, ownerAddress?: string): Promise<number>;
|
|
1119
1087
|
/**
|
|
1120
1088
|
* Get swap rate from sCoin A to sCoin B
|
|
1121
1089
|
* @param assetCoinNames
|
|
1122
1090
|
* @returns
|
|
1123
1091
|
*/
|
|
1124
|
-
getSCoinSwapRate(fromSCoin:
|
|
1125
|
-
getFlashLoanFees(assetCoinNames?:
|
|
1092
|
+
getSCoinSwapRate(fromSCoin: string, toSCoin: string): Promise<number>;
|
|
1093
|
+
getFlashLoanFees(assetCoinNames?: string[]): Promise<Record<string, number>>;
|
|
1126
1094
|
/**
|
|
1127
1095
|
* Get supply limit of lending pool
|
|
1128
1096
|
*/
|
|
1129
|
-
getPoolSupplyLimit(poolName:
|
|
1097
|
+
getPoolSupplyLimit(poolName: string): Promise<string | null>;
|
|
1130
1098
|
/**
|
|
1131
1099
|
* Get borrow limit of borrow pool
|
|
1132
1100
|
*/
|
|
1133
|
-
getPoolBorrowLimit(poolName:
|
|
1101
|
+
getPoolBorrowLimit(poolName: string): Promise<string | null>;
|
|
1134
1102
|
/**
|
|
1135
1103
|
* Get list of isolated assets
|
|
1136
1104
|
*/
|
|
@@ -1138,13 +1106,13 @@ declare class ScallopQuery {
|
|
|
1138
1106
|
/**
|
|
1139
1107
|
* Check if asset is an isolated asset
|
|
1140
1108
|
*/
|
|
1141
|
-
isIsolatedAsset(assetCoinName:
|
|
1109
|
+
isIsolatedAsset(assetCoinName: string): Promise<boolean>;
|
|
1142
1110
|
/**
|
|
1143
1111
|
* Get pool coin price from indexer
|
|
1144
1112
|
* @param coinName
|
|
1145
1113
|
* @returns price data
|
|
1146
1114
|
*/
|
|
1147
|
-
getCoinPriceByIndexer(poolName:
|
|
1115
|
+
getCoinPriceByIndexer(poolName: string): Promise<number>;
|
|
1148
1116
|
/**
|
|
1149
1117
|
* Get all supported pool price from indexer
|
|
1150
1118
|
* @returns prices data
|
|
@@ -1159,84 +1127,13 @@ declare class ScallopQuery {
|
|
|
1159
1127
|
coinPrices?: CoinPrices;
|
|
1160
1128
|
indexer?: boolean;
|
|
1161
1129
|
}): Promise<{
|
|
1162
|
-
|
|
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;
|
|
1130
|
+
[x: string]: number | undefined;
|
|
1208
1131
|
}>;
|
|
1209
1132
|
/**
|
|
1210
1133
|
* Query all address (lending pool, collateral pool, borrow dynamics, interest models, etc.) of all pool
|
|
1211
1134
|
* @returns
|
|
1212
1135
|
*/
|
|
1213
|
-
getPoolAddresses(
|
|
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
|
-
}>>>;
|
|
1136
|
+
getPoolAddresses(apiAddressId?: string | undefined): Promise<OptionalKeys<Record<string, PoolAddress>>>;
|
|
1240
1137
|
/**
|
|
1241
1138
|
* Get user portfolio
|
|
1242
1139
|
*/
|
|
@@ -1249,7 +1146,7 @@ declare class ScallopQuery {
|
|
|
1249
1146
|
suppliedCoin: number;
|
|
1250
1147
|
suppliedValue: number;
|
|
1251
1148
|
stakedCoin: number;
|
|
1252
|
-
coinName:
|
|
1149
|
+
coinName: string;
|
|
1253
1150
|
symbol: string;
|
|
1254
1151
|
coinType: string;
|
|
1255
1152
|
coinPrice: number;
|
|
@@ -1266,7 +1163,7 @@ declare class ScallopQuery {
|
|
|
1266
1163
|
availableCollateralInUsd: number;
|
|
1267
1164
|
totalUnhealthyCollateralInUsd: number;
|
|
1268
1165
|
borrowedPools: {
|
|
1269
|
-
coinName:
|
|
1166
|
+
coinName: string;
|
|
1270
1167
|
symbol: string;
|
|
1271
1168
|
coinDecimals: number;
|
|
1272
1169
|
coinType: string;
|
|
@@ -1276,7 +1173,7 @@ declare class ScallopQuery {
|
|
|
1276
1173
|
borrowApr: number | undefined;
|
|
1277
1174
|
borrowApy: number | undefined;
|
|
1278
1175
|
incentiveInfos: {
|
|
1279
|
-
coinName:
|
|
1176
|
+
coinName: string;
|
|
1280
1177
|
symbol: string;
|
|
1281
1178
|
coinType: string;
|
|
1282
1179
|
incentiveApr: number;
|
|
@@ -1312,7 +1209,7 @@ declare class ScallopQuery {
|
|
|
1312
1209
|
* Return the supported primary and secondary oracles for all supported pool assets
|
|
1313
1210
|
* @returns
|
|
1314
1211
|
*/
|
|
1315
|
-
getAssetOracles(): Promise<Record<
|
|
1212
|
+
getAssetOracles(): Promise<Record<string, xOracleRules>>;
|
|
1316
1213
|
}
|
|
1317
1214
|
|
|
1318
1215
|
/**
|
|
@@ -1331,18 +1228,19 @@ declare class ScallopBuilder {
|
|
|
1331
1228
|
readonly isTestnet: boolean;
|
|
1332
1229
|
suiKit: SuiKit;
|
|
1333
1230
|
address: ScallopAddress;
|
|
1231
|
+
constants: ScallopConstants;
|
|
1334
1232
|
query: ScallopQuery;
|
|
1335
1233
|
utils: ScallopUtils;
|
|
1336
1234
|
walletAddress: string;
|
|
1337
1235
|
cache: ScallopCache;
|
|
1338
|
-
constructor(params
|
|
1236
|
+
constructor(params: ScallopBuilderParams, instance?: ScallopBuilderInstanceParams);
|
|
1339
1237
|
/**
|
|
1340
1238
|
* Request the scallop API to initialize data.
|
|
1341
1239
|
*
|
|
1342
1240
|
* @param force - Whether to force initialization.
|
|
1343
1241
|
* @param address - ScallopAddress instance.
|
|
1344
1242
|
*/
|
|
1345
|
-
init(force?: boolean
|
|
1243
|
+
init(force?: boolean): Promise<void>;
|
|
1346
1244
|
/**
|
|
1347
1245
|
* Create a scallop txBlock instance that enhances transaction block.
|
|
1348
1246
|
*
|
|
@@ -1359,7 +1257,7 @@ declare class ScallopBuilder {
|
|
|
1359
1257
|
* @param sender - Sender address.
|
|
1360
1258
|
* @return Take coin and left coin.
|
|
1361
1259
|
*/
|
|
1362
|
-
selectCoin<T extends
|
|
1260
|
+
selectCoin<T extends string>(txBlock: ScallopTxBlock | SuiTxBlock, assetCoinName: T, amount: number, sender?: string): Promise<SelectCoinReturnType<T>>;
|
|
1363
1261
|
/**
|
|
1364
1262
|
* Specifying the sender's amount of market coins to get coins args from transaction result.
|
|
1365
1263
|
*
|
|
@@ -1369,7 +1267,7 @@ declare class ScallopBuilder {
|
|
|
1369
1267
|
* @param sender - Sender address.
|
|
1370
1268
|
* @return Take coin and left coin.
|
|
1371
1269
|
*/
|
|
1372
|
-
selectMarketCoin(txBlock: ScallopTxBlock | SuiTxBlock, marketCoinName:
|
|
1270
|
+
selectMarketCoin(txBlock: ScallopTxBlock | SuiTxBlock, marketCoinName: string, amount: number, sender?: string): Promise<{
|
|
1373
1271
|
takeCoin: _scallop_io_sui_kit.TransactionObjectArgument;
|
|
1374
1272
|
leftCoin: _scallop_io_sui_kit.TransactionObjectArgument;
|
|
1375
1273
|
totalAmount: number;
|
|
@@ -1383,7 +1281,7 @@ declare class ScallopBuilder {
|
|
|
1383
1281
|
* @param sender - Sender address.
|
|
1384
1282
|
* @return Take coin and left coin.
|
|
1385
1283
|
*/
|
|
1386
|
-
selectSCoin(txBlock: ScallopTxBlock | SuiTxBlock, sCoinName:
|
|
1284
|
+
selectSCoin(txBlock: ScallopTxBlock | SuiTxBlock, sCoinName: string, amount: number, sender?: string): Promise<{
|
|
1387
1285
|
takeCoin: _scallop_io_sui_kit.TransactionObjectArgument;
|
|
1388
1286
|
leftCoin: _scallop_io_sui_kit.TransactionObjectArgument;
|
|
1389
1287
|
totalAmount: number;
|
|
@@ -1413,12 +1311,13 @@ declare class ScallopClient {
|
|
|
1413
1311
|
readonly params: ScallopClientParams;
|
|
1414
1312
|
suiKit: SuiKit;
|
|
1415
1313
|
address: ScallopAddress;
|
|
1314
|
+
constants: ScallopConstants;
|
|
1416
1315
|
builder: ScallopBuilder;
|
|
1417
1316
|
query: ScallopQuery;
|
|
1418
1317
|
utils: ScallopUtils;
|
|
1419
1318
|
cache: ScallopCache;
|
|
1420
1319
|
walletAddress: string;
|
|
1421
|
-
constructor(params
|
|
1320
|
+
constructor(params: ScallopClientParams, instance?: ScallopClientInstanceParams);
|
|
1422
1321
|
/**
|
|
1423
1322
|
* Request the scallop API to initialize data.
|
|
1424
1323
|
*
|
|
@@ -1474,7 +1373,7 @@ declare class ScallopClient {
|
|
|
1474
1373
|
* @param ownerAddress - The owner address.
|
|
1475
1374
|
* @return Stake accounts data.
|
|
1476
1375
|
*/
|
|
1477
|
-
getStakeAccounts(stakeMarketCoinName:
|
|
1376
|
+
getStakeAccounts(stakeMarketCoinName: string, ownerAddress?: string): Promise<StakeAccount[]>;
|
|
1478
1377
|
/**
|
|
1479
1378
|
* Query stake pool data.
|
|
1480
1379
|
*
|
|
@@ -1484,7 +1383,7 @@ declare class ScallopClient {
|
|
|
1484
1383
|
* @param stakeMarketCoinName - Support stake market coin.
|
|
1485
1384
|
* @return Stake pool data.
|
|
1486
1385
|
*/
|
|
1487
|
-
getStakePool(stakeMarketCoinName:
|
|
1386
|
+
getStakePool(stakeMarketCoinName: string): Promise<StakePool | undefined>;
|
|
1488
1387
|
/**
|
|
1489
1388
|
* Query reward pool data.
|
|
1490
1389
|
*
|
|
@@ -1494,7 +1393,7 @@ declare class ScallopClient {
|
|
|
1494
1393
|
* @param stakeMarketCoinName - Support stake market coin.
|
|
1495
1394
|
* @return Reward pool data.
|
|
1496
1395
|
*/
|
|
1497
|
-
getStakeRewardPool(stakeMarketCoinName:
|
|
1396
|
+
getStakeRewardPool(stakeMarketCoinName: string): Promise<StakeRewardPool | undefined>;
|
|
1498
1397
|
/**
|
|
1499
1398
|
* Open obligation.
|
|
1500
1399
|
*
|
|
@@ -1513,8 +1412,8 @@ declare class ScallopClient {
|
|
|
1513
1412
|
* @param walletAddress - The wallet address of the owner.
|
|
1514
1413
|
* @return Transaction block response or transaction block.
|
|
1515
1414
|
*/
|
|
1516
|
-
depositCollateral(collateralCoinName:
|
|
1517
|
-
depositCollateral<S extends boolean>(collateralCoinName:
|
|
1415
|
+
depositCollateral(collateralCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
1416
|
+
depositCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign?: S, obligationId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1518
1417
|
/**
|
|
1519
1418
|
* Withdraw collateral from the specific pool.
|
|
1520
1419
|
*
|
|
@@ -1526,7 +1425,7 @@ declare class ScallopClient {
|
|
|
1526
1425
|
* @param walletAddress - The wallet address of the owner.
|
|
1527
1426
|
* @return Transaction block response or transaction block.
|
|
1528
1427
|
*/
|
|
1529
|
-
withdrawCollateral<S extends boolean>(collateralCoinName:
|
|
1428
|
+
withdrawCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1530
1429
|
/**
|
|
1531
1430
|
* Deposit asset into the specific pool.
|
|
1532
1431
|
*
|
|
@@ -1536,8 +1435,8 @@ declare class ScallopClient {
|
|
|
1536
1435
|
* @param walletAddress - The wallet address of the owner.
|
|
1537
1436
|
* @return Transaction block response or transaction block.
|
|
1538
1437
|
*/
|
|
1539
|
-
deposit(poolCoinName:
|
|
1540
|
-
deposit<S extends boolean>(poolCoinName:
|
|
1438
|
+
deposit(poolCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
1439
|
+
deposit<S extends boolean>(poolCoinName: string, amount: number, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1541
1440
|
/**
|
|
1542
1441
|
* Deposit asset into the specific pool and Stake market coin into the corresponding spool.
|
|
1543
1442
|
*
|
|
@@ -1548,8 +1447,8 @@ declare class ScallopClient {
|
|
|
1548
1447
|
* @param walletAddress - The wallet address of the owner.
|
|
1549
1448
|
* @return Transaction block response or transaction block.
|
|
1550
1449
|
*/
|
|
1551
|
-
depositAndStake(stakeCoinName:
|
|
1552
|
-
depositAndStake<S extends boolean>(stakeCoinName:
|
|
1450
|
+
depositAndStake(stakeCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
1451
|
+
depositAndStake<S extends boolean>(stakeCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1553
1452
|
/**
|
|
1554
1453
|
* Withdraw asset from the specific pool, must return market coin.
|
|
1555
1454
|
*
|
|
@@ -1559,8 +1458,8 @@ declare class ScallopClient {
|
|
|
1559
1458
|
* @param walletAddress - The wallet address of the owner.
|
|
1560
1459
|
* @return Transaction block response or transaction block.
|
|
1561
1460
|
*/
|
|
1562
|
-
withdraw(poolCoinName:
|
|
1563
|
-
withdraw<S extends boolean>(poolCoinName:
|
|
1461
|
+
withdraw(poolCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
1462
|
+
withdraw<S extends boolean>(poolCoinName: string, amount: number, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1564
1463
|
/**
|
|
1565
1464
|
* Borrow asset from the specific pool.
|
|
1566
1465
|
*
|
|
@@ -1572,7 +1471,7 @@ declare class ScallopClient {
|
|
|
1572
1471
|
* @param walletAddress - The wallet address of the owner.
|
|
1573
1472
|
* @return Transaction block response or transaction block.
|
|
1574
1473
|
*/
|
|
1575
|
-
borrow<S extends boolean>(poolCoinName:
|
|
1474
|
+
borrow<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1576
1475
|
/**
|
|
1577
1476
|
* Repay asset into the specific pool.
|
|
1578
1477
|
*
|
|
@@ -1583,7 +1482,7 @@ declare class ScallopClient {
|
|
|
1583
1482
|
* @param walletAddress - The wallet address of the owner.
|
|
1584
1483
|
* @return Transaction block response or transaction block.
|
|
1585
1484
|
*/
|
|
1586
|
-
repay<S extends boolean>(poolCoinName:
|
|
1485
|
+
repay<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1587
1486
|
/**
|
|
1588
1487
|
* FlashLoan asset from the specific pool.
|
|
1589
1488
|
*
|
|
@@ -1593,8 +1492,8 @@ declare class ScallopClient {
|
|
|
1593
1492
|
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
1594
1493
|
* @return Transaction block response or transaction block.
|
|
1595
1494
|
*/
|
|
1596
|
-
flashLoan(poolCoinName:
|
|
1597
|
-
flashLoan<S extends boolean>(poolCoinName:
|
|
1495
|
+
flashLoan(poolCoinName: string, amount: number, callback: (txBlock: ScallopTxBlock, coin: TransactionObjectArgument | string) => SuiObjectArg): Promise<SuiTransactionBlockResponse>;
|
|
1496
|
+
flashLoan<S extends boolean>(poolCoinName: string, amount: number, callback: (txBlock: ScallopTxBlock, coin: TransactionObjectArgument | string) => SuiObjectArg, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1598
1497
|
/**
|
|
1599
1498
|
* Create stake account.
|
|
1600
1499
|
*
|
|
@@ -1602,8 +1501,8 @@ declare class ScallopClient {
|
|
|
1602
1501
|
* @param walletAddress - The wallet address of the owner.
|
|
1603
1502
|
* @return Transaction block response or transaction block.
|
|
1604
1503
|
*/
|
|
1605
|
-
createStakeAccount(marketCoinName:
|
|
1606
|
-
createStakeAccount<S extends boolean>(marketCoinName:
|
|
1504
|
+
createStakeAccount(marketCoinName: string): Promise<SuiTransactionBlockResponse>;
|
|
1505
|
+
createStakeAccount<S extends boolean>(marketCoinName: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1607
1506
|
/**
|
|
1608
1507
|
* Stake market coin into the specific spool.
|
|
1609
1508
|
*
|
|
@@ -1614,8 +1513,8 @@ declare class ScallopClient {
|
|
|
1614
1513
|
* @param walletAddress - The wallet address of the owner.
|
|
1615
1514
|
* @return Transaction block response or transaction block.
|
|
1616
1515
|
*/
|
|
1617
|
-
stake(stakeMarketCoinName:
|
|
1618
|
-
stake<S extends boolean>(stakeMarketCoinName:
|
|
1516
|
+
stake(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
1517
|
+
stake<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1619
1518
|
/**
|
|
1620
1519
|
* Unstake market coin from the specific spool.
|
|
1621
1520
|
*
|
|
@@ -1626,8 +1525,8 @@ declare class ScallopClient {
|
|
|
1626
1525
|
* @param walletAddress - The wallet address of the owner.
|
|
1627
1526
|
* @return Transaction block response or transaction block.
|
|
1628
1527
|
*/
|
|
1629
|
-
unstake(stakeMarketCoinName:
|
|
1630
|
-
unstake<S extends boolean>(stakeMarketCoinName:
|
|
1528
|
+
unstake(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
1529
|
+
unstake<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1631
1530
|
/**
|
|
1632
1531
|
* Unstake market coin from the specific spool and withdraw asset from the corresponding pool.
|
|
1633
1532
|
*
|
|
@@ -1638,8 +1537,8 @@ declare class ScallopClient {
|
|
|
1638
1537
|
* @param walletAddress - The wallet address of the owner.
|
|
1639
1538
|
* @return Transaction block response or transaction block.
|
|
1640
1539
|
*/
|
|
1641
|
-
unstakeAndWithdraw(stakeMarketCoinName:
|
|
1642
|
-
unstakeAndWithdraw<S extends boolean>(stakeMarketCoinName:
|
|
1540
|
+
unstakeAndWithdraw(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
1541
|
+
unstakeAndWithdraw<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1643
1542
|
/**
|
|
1644
1543
|
* Claim reward coin from the specific spool.
|
|
1645
1544
|
*
|
|
@@ -1650,8 +1549,8 @@ declare class ScallopClient {
|
|
|
1650
1549
|
* @param walletAddress - The wallet address of the owner.
|
|
1651
1550
|
* @return Transaction block response or transaction block.
|
|
1652
1551
|
*/
|
|
1653
|
-
claim(stakeMarketCoinName:
|
|
1654
|
-
claim<S extends boolean>(stakeMarketCoinName:
|
|
1552
|
+
claim(stakeMarketCoinName: string): Promise<SuiTransactionBlockResponse>;
|
|
1553
|
+
claim<S extends boolean>(stakeMarketCoinName: string, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1655
1554
|
/**
|
|
1656
1555
|
* stake obligaion.
|
|
1657
1556
|
*
|
|
@@ -1705,8 +1604,8 @@ declare class ScallopClient {
|
|
|
1705
1604
|
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
1706
1605
|
* @return Transaction block response or transaction block.
|
|
1707
1606
|
*/
|
|
1708
|
-
mintTestCoin(assetCoinName: Exclude<
|
|
1709
|
-
mintTestCoin<S extends boolean>(assetCoinName: Exclude<
|
|
1607
|
+
mintTestCoin(assetCoinName: Exclude<string, 'sui'>, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
1608
|
+
mintTestCoin<S extends boolean>(assetCoinName: Exclude<string, 'sui'>, amount: number, sign?: S, receiveAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
1710
1609
|
}
|
|
1711
1610
|
|
|
1712
1611
|
/**
|
|
@@ -1731,7 +1630,9 @@ declare class Scallop {
|
|
|
1731
1630
|
suiKit: SuiKit;
|
|
1732
1631
|
cache: ScallopCache;
|
|
1733
1632
|
private address;
|
|
1633
|
+
private constants;
|
|
1734
1634
|
constructor(params: ScallopParams, cacheOptions?: QueryClientConfig, queryClient?: QueryClient);
|
|
1635
|
+
private initConstants;
|
|
1735
1636
|
/**
|
|
1736
1637
|
* Get a scallop address instance that already has read addresses.
|
|
1737
1638
|
*
|
|
@@ -1744,20 +1645,20 @@ declare class Scallop {
|
|
|
1744
1645
|
*
|
|
1745
1646
|
* @return Scallop Builder.
|
|
1746
1647
|
*/
|
|
1747
|
-
createScallopBuilder(params?: ScallopBuilderParams): Promise<ScallopBuilder>;
|
|
1648
|
+
createScallopBuilder(params?: Partial<ScallopBuilderParams>): Promise<ScallopBuilder>;
|
|
1748
1649
|
/**
|
|
1749
1650
|
* Create a scallop client instance that already has initial data.
|
|
1750
1651
|
*
|
|
1751
1652
|
* @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
1653
|
* @return Scallop Client.
|
|
1753
1654
|
*/
|
|
1754
|
-
createScallopClient(params?: ScallopClientParams): Promise<ScallopClient>;
|
|
1655
|
+
createScallopClient(params?: Partial<ScallopClientParams>): Promise<ScallopClient>;
|
|
1755
1656
|
/**
|
|
1756
1657
|
* Create a scallop query instance.
|
|
1757
1658
|
*
|
|
1758
1659
|
* @return Scallop Query.
|
|
1759
1660
|
*/
|
|
1760
|
-
createScallopQuery(params?: ScallopQueryParams): Promise<ScallopQuery>;
|
|
1661
|
+
createScallopQuery(params?: Partial<ScallopQueryParams>): Promise<ScallopQuery>;
|
|
1761
1662
|
/**
|
|
1762
1663
|
* Create a scallop indexer instance.
|
|
1763
1664
|
*
|
|
@@ -1769,65 +1670,9 @@ declare class Scallop {
|
|
|
1769
1670
|
*
|
|
1770
1671
|
* @return Scallop Utils.
|
|
1771
1672
|
*/
|
|
1772
|
-
createScallopUtils(params?: ScallopUtilsParams): Promise<ScallopUtils>;
|
|
1673
|
+
createScallopUtils(params?: Partial<ScallopUtilsParams>): Promise<ScallopUtils>;
|
|
1773
1674
|
}
|
|
1774
1675
|
|
|
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
1676
|
type CoreIds = {
|
|
1832
1677
|
protocolPkg: string;
|
|
1833
1678
|
market: string;
|
|
@@ -1845,28 +1690,28 @@ type CoreNormalMethods = {
|
|
|
1845
1690
|
openObligation: () => [Obligation$1, ObligationKey, ObligationHotPotato];
|
|
1846
1691
|
returnObligation: (obligation: SuiObjectArg, obligationHotPotato: SuiObjectArg) => void;
|
|
1847
1692
|
openObligationEntry: () => void;
|
|
1848
|
-
addCollateral: (obligation: SuiObjectArg, coin: SuiObjectArg, collateralCoinName:
|
|
1849
|
-
takeCollateral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, collateralCoinName:
|
|
1850
|
-
deposit: (coin: SuiObjectArg, poolCoinName:
|
|
1851
|
-
depositEntry: (coin: SuiObjectArg, poolCoinName:
|
|
1852
|
-
withdraw: (marketCoin: SuiObjectArg, poolCoinName:
|
|
1853
|
-
withdrawEntry: (marketCoin: SuiObjectArg, poolCoinName:
|
|
1854
|
-
borrow: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName:
|
|
1855
|
-
borrowWithReferral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, borrowReferral: SuiObjectArg, amount: number | SuiTxArg, poolCoinName:
|
|
1856
|
-
borrowEntry: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName:
|
|
1857
|
-
repay: (obligation: SuiObjectArg, coin: SuiObjectArg, poolCoinName:
|
|
1858
|
-
borrowFlashLoan: (amount: number | SuiTxArg, poolCoinName:
|
|
1859
|
-
repayFlashLoan: (coin: SuiObjectArg, loan: SuiObjectArg, poolCoinName:
|
|
1693
|
+
addCollateral: (obligation: SuiObjectArg, coin: SuiObjectArg, collateralCoinName: string) => void;
|
|
1694
|
+
takeCollateral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, collateralCoinName: string) => TransactionResult;
|
|
1695
|
+
deposit: (coin: SuiObjectArg, poolCoinName: string) => TransactionResult;
|
|
1696
|
+
depositEntry: (coin: SuiObjectArg, poolCoinName: string) => TransactionResult;
|
|
1697
|
+
withdraw: (marketCoin: SuiObjectArg, poolCoinName: string) => TransactionResult;
|
|
1698
|
+
withdrawEntry: (marketCoin: SuiObjectArg, poolCoinName: string) => TransactionResult;
|
|
1699
|
+
borrow: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: string) => TransactionResult;
|
|
1700
|
+
borrowWithReferral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, borrowReferral: SuiObjectArg, amount: number | SuiTxArg, poolCoinName: string) => TransactionResult;
|
|
1701
|
+
borrowEntry: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: string) => TransactionResult;
|
|
1702
|
+
repay: (obligation: SuiObjectArg, coin: SuiObjectArg, poolCoinName: string) => void;
|
|
1703
|
+
borrowFlashLoan: (amount: number | SuiTxArg, poolCoinName: string) => TransactionResult;
|
|
1704
|
+
repayFlashLoan: (coin: SuiObjectArg, loan: SuiObjectArg, poolCoinName: string) => void;
|
|
1860
1705
|
};
|
|
1861
1706
|
type CoreQuickMethods = {
|
|
1862
|
-
addCollateralQuick: (amount: number, collateralCoinName:
|
|
1863
|
-
takeCollateralQuick: (amount: number, collateralCoinName:
|
|
1864
|
-
borrowQuick: (amount: number, poolCoinName:
|
|
1865
|
-
borrowWithReferralQuick: (amount: number, poolCoinName:
|
|
1866
|
-
depositQuick: (amount: number, poolCoinName:
|
|
1867
|
-
withdrawQuick: (amount: number, poolCoinName:
|
|
1868
|
-
repayQuick: (amount: number, poolCoinName:
|
|
1869
|
-
updateAssetPricesQuick: (assetCoinNames?:
|
|
1707
|
+
addCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg) => Promise<void>;
|
|
1708
|
+
takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg) => Promise<TransactionResult>;
|
|
1709
|
+
borrowQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg) => Promise<TransactionResult>;
|
|
1710
|
+
borrowWithReferralQuick: (amount: number, poolCoinName: string, borrowReferral: SuiObjectArg, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg) => Promise<TransactionResult>;
|
|
1711
|
+
depositQuick: (amount: number, poolCoinName: string, returnSCoin?: boolean) => Promise<TransactionResult>;
|
|
1712
|
+
withdrawQuick: (amount: number, poolCoinName: string) => Promise<TransactionResult>;
|
|
1713
|
+
repayQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg) => Promise<void>;
|
|
1714
|
+
updateAssetPricesQuick: (assetCoinNames?: string[]) => Promise<void>;
|
|
1870
1715
|
};
|
|
1871
1716
|
type SuiTxBlockWithCoreNormalMethods = SuiTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
|
|
1872
1717
|
type CoreTxBlock = SuiTxBlockWithCoreNormalMethods & CoreQuickMethods;
|
|
@@ -1883,15 +1728,15 @@ type SpoolIds = {
|
|
|
1883
1728
|
spoolPkg: string;
|
|
1884
1729
|
};
|
|
1885
1730
|
type SpoolNormalMethods = {
|
|
1886
|
-
createStakeAccount: (stakeMarketCoinName:
|
|
1887
|
-
stake: (stakeAccount: SuiAddressArg, coin: SuiObjectArg, stakeMarketCoinName:
|
|
1888
|
-
unstake: (stakeAccount: SuiAddressArg, amount: number, stakeMarketCoinName:
|
|
1889
|
-
claim: (stakeAccount: SuiAddressArg, stakeMarketCoinName:
|
|
1731
|
+
createStakeAccount: (stakeMarketCoinName: string) => TransactionResult;
|
|
1732
|
+
stake: (stakeAccount: SuiAddressArg, coin: SuiObjectArg, stakeMarketCoinName: string) => void;
|
|
1733
|
+
unstake: (stakeAccount: SuiAddressArg, amount: number, stakeMarketCoinName: string) => TransactionResult;
|
|
1734
|
+
claim: (stakeAccount: SuiAddressArg, stakeMarketCoinName: string) => TransactionResult;
|
|
1890
1735
|
};
|
|
1891
1736
|
type SpoolQuickMethods = {
|
|
1892
|
-
stakeQuick(amountOrMarketCoin: SuiObjectArg | number, stakeMarketCoinName:
|
|
1893
|
-
unstakeQuick(amount: number, stakeMarketCoinName:
|
|
1894
|
-
claimQuick(stakeMarketCoinName:
|
|
1737
|
+
stakeQuick(amountOrMarketCoin: SuiObjectArg | number, stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg): Promise<void>;
|
|
1738
|
+
unstakeQuick(amount: number, stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg, returnSCoin?: boolean): Promise<TransactionResult | undefined>;
|
|
1739
|
+
claimQuick(stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg): Promise<TransactionResult[]>;
|
|
1895
1740
|
};
|
|
1896
1741
|
type SuiTxBlockWithSpoolNormalMethods = SuiTxBlock & SuiTxBlockWithSCoin & SpoolNormalMethods;
|
|
1897
1742
|
type SpoolTxBlock = SuiTxBlockWithSpoolNormalMethods & SpoolQuickMethods;
|
|
@@ -1916,14 +1761,14 @@ type BorrowIncentiveNormalMethods = {
|
|
|
1916
1761
|
stakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
|
|
1917
1762
|
stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey: SuiObjectArg) => void;
|
|
1918
1763
|
unstakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
|
|
1919
|
-
claimBorrowIncentive: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, rewardType:
|
|
1764
|
+
claimBorrowIncentive: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, rewardType: string) => TransactionResult;
|
|
1920
1765
|
deactivateBoost: (obligation: SuiObjectArg, veScaKey: SuiObjectArg) => void;
|
|
1921
1766
|
};
|
|
1922
1767
|
type BorrowIncentiveQuickMethods = {
|
|
1923
1768
|
stakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
|
|
1924
1769
|
stakeObligationWithVeScaQuick(obligation?: string, obligationKey?: string, veScaKey?: string): Promise<void>;
|
|
1925
1770
|
unstakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
|
|
1926
|
-
claimBorrowIncentiveQuick(rewardType:
|
|
1771
|
+
claimBorrowIncentiveQuick(rewardType: string, obligation?: string, obligationKey?: string): Promise<TransactionResult>;
|
|
1927
1772
|
};
|
|
1928
1773
|
type SuiTxBlockWithBorrowIncentiveNormalMethods = SuiTxBlock & BorrowIncentiveNormalMethods;
|
|
1929
1774
|
type BorrowIncentiveTxBlock = SuiTxBlockWithBorrowIncentiveNormalMethods & BorrowIncentiveQuickMethods;
|
|
@@ -1987,12 +1832,12 @@ type GenerateVeScaQuickMethod = (params: {
|
|
|
1987
1832
|
|
|
1988
1833
|
type ReferralNormalMethods = {
|
|
1989
1834
|
bindToReferral: (veScaKeyId: string) => void;
|
|
1990
|
-
claimReferralTicket: (poolCoinName:
|
|
1991
|
-
burnReferralTicket: (ticket: SuiObjectArg, poolCoinName:
|
|
1992
|
-
claimReferralRevenue: (veScaKey: SuiObjectArg, poolCoinName:
|
|
1835
|
+
claimReferralTicket: (poolCoinName: string) => TransactionResult$1;
|
|
1836
|
+
burnReferralTicket: (ticket: SuiObjectArg, poolCoinName: string) => void;
|
|
1837
|
+
claimReferralRevenue: (veScaKey: SuiObjectArg, poolCoinName: string) => TransactionResult$1;
|
|
1993
1838
|
};
|
|
1994
1839
|
type ReferralQuickMethods = {
|
|
1995
|
-
claimReferralRevenueQuick: (veScaKey: SuiObjectArg, coinNames:
|
|
1840
|
+
claimReferralRevenueQuick: (veScaKey: SuiObjectArg, coinNames: string[]) => Promise<void>;
|
|
1996
1841
|
};
|
|
1997
1842
|
type SuiTxBlockWithReferralNormalMethods = SuiTxBlock & ReferralNormalMethods;
|
|
1998
1843
|
type ReferralTxBlock = SuiTxBlockWithReferralNormalMethods & ReferralQuickMethods;
|
|
@@ -2029,18 +1874,18 @@ type sCoinNormalMethods = {
|
|
|
2029
1874
|
* @param marketCoin
|
|
2030
1875
|
* @returns
|
|
2031
1876
|
*/
|
|
2032
|
-
mintSCoin: (marketCoinName:
|
|
1877
|
+
mintSCoin: (marketCoinName: string, marketCoin: SuiObjectArg) => TransactionResult$1;
|
|
2033
1878
|
/**
|
|
2034
1879
|
* Burn sCoin and return marketCoin
|
|
2035
1880
|
* @param sCoinName
|
|
2036
1881
|
* @param sCoin
|
|
2037
1882
|
* @returns
|
|
2038
1883
|
*/
|
|
2039
|
-
burnSCoin: (sCoinName:
|
|
1884
|
+
burnSCoin: (sCoinName: string, sCoin: SuiObjectArg) => TransactionResult$1;
|
|
2040
1885
|
};
|
|
2041
1886
|
type sCoinQuickMethods = {
|
|
2042
|
-
mintSCoinQuick: (marketCoinName:
|
|
2043
|
-
burnSCoinQuick: (sCoinName:
|
|
1887
|
+
mintSCoinQuick: (marketCoinName: string, amount: number) => Promise<TransactionResult$1>;
|
|
1888
|
+
burnSCoinQuick: (sCoinName: string, amount: number) => Promise<TransactionResult$1>;
|
|
2044
1889
|
};
|
|
2045
1890
|
type SuiTxBlockWithSCoinNormalMethods = SuiTxBlock & BaseScallopTxBlock & sCoinNormalMethods;
|
|
2046
1891
|
type SCoinTxBlock = SuiTxBlockWithSCoinNormalMethods & sCoinQuickMethods;
|
|
@@ -2057,13 +1902,116 @@ type BaseScallopTxBlock = ReferralTxBlock & LoyaltyProgramTxBlock & BorrowIncent
|
|
|
2057
1902
|
type SuiTxBlockWithSCoin = BaseScallopTxBlock & SCoinTxBlock;
|
|
2058
1903
|
type SuiTxBlockWithSpool = SuiTxBlockWithSCoin & SpoolTxBlock;
|
|
2059
1904
|
type ScallopTxBlock = SuiTxBlockWithSpool & CoreTxBlock;
|
|
2060
|
-
type SelectCoinReturnType<T extends
|
|
1905
|
+
type SelectCoinReturnType<T extends string> = T extends 'sui' ? {
|
|
2061
1906
|
takeCoin: NestedResult;
|
|
2062
1907
|
} : {
|
|
2063
1908
|
takeCoin: NestedResult;
|
|
2064
1909
|
leftCoin: NestedResult;
|
|
2065
1910
|
};
|
|
2066
1911
|
|
|
1912
|
+
type PoolAddress = {
|
|
1913
|
+
coinName: string;
|
|
1914
|
+
symbol: string;
|
|
1915
|
+
coinType: string;
|
|
1916
|
+
coinMetadataId: string;
|
|
1917
|
+
decimals: number;
|
|
1918
|
+
pythFeed?: string;
|
|
1919
|
+
pythFeedObjectId?: string;
|
|
1920
|
+
lendingPoolAddress?: string;
|
|
1921
|
+
borrowDynamic?: string;
|
|
1922
|
+
interestModel?: string;
|
|
1923
|
+
borrowFeeKey?: string;
|
|
1924
|
+
flashloanFeeObject?: string;
|
|
1925
|
+
coinGeckoId?: string;
|
|
1926
|
+
collateralPoolAddress?: string;
|
|
1927
|
+
riskModel?: string;
|
|
1928
|
+
supplyLimitKey?: string;
|
|
1929
|
+
borrowLimitKey?: string;
|
|
1930
|
+
sCoinType?: string;
|
|
1931
|
+
sCoinName?: string;
|
|
1932
|
+
sCoinSymbol?: string;
|
|
1933
|
+
sCoinMetadataId?: string;
|
|
1934
|
+
sCoinTreasury?: string;
|
|
1935
|
+
isolatedAssetKey?: string;
|
|
1936
|
+
spool?: string;
|
|
1937
|
+
spoolReward?: string;
|
|
1938
|
+
spoolName?: string;
|
|
1939
|
+
};
|
|
1940
|
+
type Whitelist = {
|
|
1941
|
+
lending: Set<string>;
|
|
1942
|
+
borrowing: Set<string>;
|
|
1943
|
+
collateral: Set<string>;
|
|
1944
|
+
packages: Set<string>;
|
|
1945
|
+
spool: Set<string>;
|
|
1946
|
+
scoin: Set<string>;
|
|
1947
|
+
suiBridge: Set<string>;
|
|
1948
|
+
wormhole: Set<string>;
|
|
1949
|
+
oracles: Set<string>;
|
|
1950
|
+
borrowIncentiveRewards: Set<string>;
|
|
1951
|
+
pythEndpoints: Set<string>;
|
|
1952
|
+
deprecated: Set<string>;
|
|
1953
|
+
};
|
|
1954
|
+
type CoinWrappedType = {
|
|
1955
|
+
from: string;
|
|
1956
|
+
type: string;
|
|
1957
|
+
} | undefined;
|
|
1958
|
+
|
|
1959
|
+
type Coins = {
|
|
1960
|
+
[K in string]: K;
|
|
1961
|
+
};
|
|
1962
|
+
type AssetCoins = {
|
|
1963
|
+
[K in string]: K;
|
|
1964
|
+
};
|
|
1965
|
+
type MarketCoins = {
|
|
1966
|
+
[K in string]: K;
|
|
1967
|
+
};
|
|
1968
|
+
type SCoins = {
|
|
1969
|
+
[K in string]: K;
|
|
1970
|
+
};
|
|
1971
|
+
type StakeMarketCoins = {
|
|
1972
|
+
[K in string]: K;
|
|
1973
|
+
};
|
|
1974
|
+
type StakeRewardCoins = {
|
|
1975
|
+
[key in string]: string;
|
|
1976
|
+
};
|
|
1977
|
+
type SuiBridgeCoins = {
|
|
1978
|
+
[K in string]: K;
|
|
1979
|
+
};
|
|
1980
|
+
type BorrowIncentiveRewardCoins = {
|
|
1981
|
+
[key in string]: string[];
|
|
1982
|
+
};
|
|
1983
|
+
type AssetCoinIds = {
|
|
1984
|
+
[key in string]: string;
|
|
1985
|
+
};
|
|
1986
|
+
type SCoinIds = {
|
|
1987
|
+
[key in string]: string;
|
|
1988
|
+
};
|
|
1989
|
+
type SCoinTreasuryCaps = {
|
|
1990
|
+
[key in string]: string;
|
|
1991
|
+
};
|
|
1992
|
+
type SCoinConverterTreasury = {
|
|
1993
|
+
[key in string]: string;
|
|
1994
|
+
};
|
|
1995
|
+
type PickFromUnion<T, K extends string> = K extends T ? K : never;
|
|
1996
|
+
type WormholeCoinIds = {
|
|
1997
|
+
[key in PickFromUnion<string, 'weth' | 'wbtc' | 'wusdc' | 'wusdt' | 'wapt' | 'wsol'>]: string;
|
|
1998
|
+
};
|
|
1999
|
+
type VoloCoinIds = {
|
|
2000
|
+
[key in PickFromUnion<string, 'vsui'>]: string;
|
|
2001
|
+
};
|
|
2002
|
+
type SuiBridgedCoinPackageIds = {
|
|
2003
|
+
[key in string]: string;
|
|
2004
|
+
};
|
|
2005
|
+
|
|
2006
|
+
type xOracleRules = {
|
|
2007
|
+
primary: string[];
|
|
2008
|
+
secondary: string[];
|
|
2009
|
+
};
|
|
2010
|
+
type xOracleRuleType = keyof xOracleRules;
|
|
2011
|
+
type xOracleListType = {
|
|
2012
|
+
[key in string]: xOracleRules;
|
|
2013
|
+
};
|
|
2014
|
+
|
|
2067
2015
|
interface BorrowIncentiveAccountKey {
|
|
2068
2016
|
id: string;
|
|
2069
2017
|
onwerId: string;
|
|
@@ -2071,16 +2019,16 @@ interface BorrowIncentiveAccountKey {
|
|
|
2071
2019
|
type OptionalKeys$4<T> = {
|
|
2072
2020
|
[K in keyof T]?: T[K];
|
|
2073
2021
|
};
|
|
2074
|
-
type BorrowIncentivePools = OptionalKeys$4<Record<
|
|
2022
|
+
type BorrowIncentivePools = OptionalKeys$4<Record<string, BorrowIncentivePool>>;
|
|
2075
2023
|
type BorrowIncentivePoolPoints = {
|
|
2076
2024
|
symbol: string;
|
|
2077
|
-
coinName:
|
|
2025
|
+
coinName: string;
|
|
2078
2026
|
coinType: string;
|
|
2079
2027
|
coinDecimal: number;
|
|
2080
2028
|
coinPrice: number;
|
|
2081
2029
|
} & Required<Pick<ParsedBorrowIncentivePoolPointData, 'points' | 'distributedPoint' | 'weightedAmount'>> & CalculatedBorrowIncentivePoolPointData;
|
|
2082
2030
|
type BorrowIncentivePool = {
|
|
2083
|
-
coinName:
|
|
2031
|
+
coinName: string;
|
|
2084
2032
|
symbol: string;
|
|
2085
2033
|
coinType: string;
|
|
2086
2034
|
coinDecimal: number;
|
|
@@ -2088,7 +2036,7 @@ type BorrowIncentivePool = {
|
|
|
2088
2036
|
stakedAmount: number;
|
|
2089
2037
|
stakedCoin: number;
|
|
2090
2038
|
stakedValue: number;
|
|
2091
|
-
points: OptionalKeys$4<Record<
|
|
2039
|
+
points: OptionalKeys$4<Record<string, BorrowIncentivePoolPoints>>;
|
|
2092
2040
|
};
|
|
2093
2041
|
type OriginBorrowIncentivePoolPointData = {
|
|
2094
2042
|
point_type: {
|
|
@@ -2128,7 +2076,7 @@ type ParsedBorrowIncentivePoolPointData = {
|
|
|
2128
2076
|
};
|
|
2129
2077
|
type ParsedBorrowIncentivePoolData = {
|
|
2130
2078
|
poolType: string;
|
|
2131
|
-
poolPoints: OptionalKeys$4<Record<
|
|
2079
|
+
poolPoints: OptionalKeys$4<Record<string, ParsedBorrowIncentivePoolPointData>>;
|
|
2132
2080
|
minStakes: number;
|
|
2133
2081
|
maxStakes: number;
|
|
2134
2082
|
staked: number;
|
|
@@ -2145,7 +2093,7 @@ type CalculatedBorrowIncentivePoolPointData = {
|
|
|
2145
2093
|
rewardApr: number;
|
|
2146
2094
|
rewardPerSec: number;
|
|
2147
2095
|
};
|
|
2148
|
-
type BorrowIncentiveAccounts = OptionalKeys$4<Record<
|
|
2096
|
+
type BorrowIncentiveAccounts = OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountData>>;
|
|
2149
2097
|
type OriginBorrowIncentiveAccountPoolData = {
|
|
2150
2098
|
point_type: {
|
|
2151
2099
|
name: string;
|
|
@@ -2170,7 +2118,7 @@ type ParsedBorrowIncentiveAccountPoolData = {
|
|
|
2170
2118
|
index: number;
|
|
2171
2119
|
};
|
|
2172
2120
|
type ParsedBorrowIncentiveAccountData = {
|
|
2173
|
-
pointList: OptionalKeys$4<Record<
|
|
2121
|
+
pointList: OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountPoolData>>;
|
|
2174
2122
|
poolType: string;
|
|
2175
2123
|
debtAmount: number;
|
|
2176
2124
|
};
|
|
@@ -2190,11 +2138,11 @@ interface BorrowIncentiveAccountsQueryInterface {
|
|
|
2190
2138
|
type OptionalKeys$3<T> = {
|
|
2191
2139
|
[K in keyof T]?: T[K];
|
|
2192
2140
|
};
|
|
2193
|
-
type MarketPools = OptionalKeys$3<Record<
|
|
2194
|
-
type MarketCollaterals = OptionalKeys$3<Record<
|
|
2195
|
-
type CoinAmounts = OptionalKeys$3<Record<
|
|
2196
|
-
type MarketCoinAmounts = OptionalKeys$3<Record<
|
|
2197
|
-
type SCoinAmounts = OptionalKeys$3<Record<
|
|
2141
|
+
type MarketPools = OptionalKeys$3<Record<string, MarketPool>>;
|
|
2142
|
+
type MarketCollaterals = OptionalKeys$3<Record<string, MarketCollateral>>;
|
|
2143
|
+
type CoinAmounts = OptionalKeys$3<Record<string, number>>;
|
|
2144
|
+
type MarketCoinAmounts = OptionalKeys$3<Record<string, number>>;
|
|
2145
|
+
type SCoinAmounts = OptionalKeys$3<Record<string, number>>;
|
|
2198
2146
|
type BalanceSheet = {
|
|
2199
2147
|
cash: string;
|
|
2200
2148
|
debt: string;
|
|
@@ -2305,7 +2253,7 @@ type CollateralStat = {
|
|
|
2305
2253
|
amount: string;
|
|
2306
2254
|
};
|
|
2307
2255
|
type MarketPool = {
|
|
2308
|
-
coinName:
|
|
2256
|
+
coinName: string;
|
|
2309
2257
|
symbol: string;
|
|
2310
2258
|
coinType: string;
|
|
2311
2259
|
marketCoinType: string;
|
|
@@ -2318,7 +2266,7 @@ type MarketPool = {
|
|
|
2318
2266
|
isIsolated: boolean;
|
|
2319
2267
|
} & Required<Pick<ParsedMarketPoolData, 'highKink' | 'midKink' | 'reserveFactor' | 'borrowWeight' | 'borrowFee' | 'marketCoinSupplyAmount' | 'minBorrowAmount'>> & CalculatedMarketPoolData;
|
|
2320
2268
|
type MarketCollateral = {
|
|
2321
|
-
coinName:
|
|
2269
|
+
coinName: string;
|
|
2322
2270
|
symbol: string;
|
|
2323
2271
|
coinType: string;
|
|
2324
2272
|
marketCoinType: string;
|
|
@@ -2575,9 +2523,9 @@ type LoyaltyProgramInfo = {
|
|
|
2575
2523
|
type OptionalKeys$2<T> = {
|
|
2576
2524
|
[K in keyof T]?: T[K];
|
|
2577
2525
|
};
|
|
2578
|
-
type Spools = OptionalKeys$2<Record<
|
|
2526
|
+
type Spools = OptionalKeys$2<Record<string, Spool>>;
|
|
2579
2527
|
type Spool = {
|
|
2580
|
-
marketCoinName:
|
|
2528
|
+
marketCoinName: string;
|
|
2581
2529
|
symbol: string;
|
|
2582
2530
|
coinType: string;
|
|
2583
2531
|
marketCoinType: string;
|
|
@@ -2676,9 +2624,9 @@ type CalculatedSpoolRewardPoolData = {
|
|
|
2676
2624
|
claimedRewardValue: number;
|
|
2677
2625
|
rewardPerSec: number;
|
|
2678
2626
|
};
|
|
2679
|
-
type StakePools = OptionalKeys$2<Record<
|
|
2680
|
-
type StakeRewardPools = OptionalKeys$2<Record<
|
|
2681
|
-
type StakeAccounts = Record<
|
|
2627
|
+
type StakePools = OptionalKeys$2<Record<string, StakePool>>;
|
|
2628
|
+
type StakeRewardPools = OptionalKeys$2<Record<string, StakeRewardPool>>;
|
|
2629
|
+
type StakeAccounts = Record<string, StakeAccount[]>;
|
|
2682
2630
|
interface StakeAccount {
|
|
2683
2631
|
id: string;
|
|
2684
2632
|
type: string;
|
|
@@ -2716,7 +2664,7 @@ interface StakeRewardPool {
|
|
|
2716
2664
|
type OptionalKeys$1<T> = {
|
|
2717
2665
|
[K in keyof T]?: T[K];
|
|
2718
2666
|
};
|
|
2719
|
-
type Lendings = OptionalKeys$1<Record<
|
|
2667
|
+
type Lendings = OptionalKeys$1<Record<string, Lending>>;
|
|
2720
2668
|
type ObligationAccounts = OptionalKeys$1<Record<string, ObligationAccount>>;
|
|
2721
2669
|
type Lending = Required<Pick<MarketPool, 'coinName' | 'symbol' | 'coinType' | 'marketCoinType' | 'sCoinType' | 'coinDecimal' | 'coinPrice' | 'conversionRate' | 'isIsolated'> & Pick<Spool, 'marketCoinPrice'>> & {
|
|
2722
2670
|
supplyApr: number;
|
|
@@ -2760,12 +2708,12 @@ type ObligationAccount = {
|
|
|
2760
2708
|
totalDepositedPools: number;
|
|
2761
2709
|
totalBorrowedPools: number;
|
|
2762
2710
|
totalRewardedPools: number;
|
|
2763
|
-
collaterals: OptionalKeys$1<Record<
|
|
2764
|
-
debts: OptionalKeys$1<Record<
|
|
2765
|
-
borrowIncentives: OptionalKeys$1<Record<
|
|
2711
|
+
collaterals: OptionalKeys$1<Record<string, ObligationCollateral>>;
|
|
2712
|
+
debts: OptionalKeys$1<Record<string, ObligationDebt>>;
|
|
2713
|
+
borrowIncentives: OptionalKeys$1<Record<string, ObligationBorrowIncentive>>;
|
|
2766
2714
|
};
|
|
2767
2715
|
type ObligationCollateral = {
|
|
2768
|
-
coinName:
|
|
2716
|
+
coinName: string;
|
|
2769
2717
|
coinType: string;
|
|
2770
2718
|
symbol: string;
|
|
2771
2719
|
coinDecimal: number;
|
|
@@ -2781,7 +2729,7 @@ type ObligationCollateral = {
|
|
|
2781
2729
|
availableWithdrawCoin: number;
|
|
2782
2730
|
};
|
|
2783
2731
|
type ObligationDebt = {
|
|
2784
|
-
coinName:
|
|
2732
|
+
coinName: string;
|
|
2785
2733
|
coinType: string;
|
|
2786
2734
|
symbol: string;
|
|
2787
2735
|
coinDecimal: number;
|
|
@@ -2799,7 +2747,7 @@ type ObligationDebt = {
|
|
|
2799
2747
|
availableRepayCoin: number;
|
|
2800
2748
|
};
|
|
2801
2749
|
type ObligationBorrowIcentiveReward = {
|
|
2802
|
-
coinName:
|
|
2750
|
+
coinName: string;
|
|
2803
2751
|
coinType: string;
|
|
2804
2752
|
symbol: string;
|
|
2805
2753
|
coinDecimal: number;
|
|
@@ -2809,7 +2757,7 @@ type ObligationBorrowIcentiveReward = {
|
|
|
2809
2757
|
boostValue: number;
|
|
2810
2758
|
};
|
|
2811
2759
|
type ObligationBorrowIncentive = {
|
|
2812
|
-
coinName:
|
|
2760
|
+
coinName: string;
|
|
2813
2761
|
coinType: string;
|
|
2814
2762
|
symbol: string;
|
|
2815
2763
|
coinDecimal: number;
|
|
@@ -2857,6 +2805,8 @@ type VeScaTreasuryInfo = {
|
|
|
2857
2805
|
averageLockingPeriodUnit: string;
|
|
2858
2806
|
};
|
|
2859
2807
|
|
|
2808
|
+
declare const _SUPPORT_ORACLES: readonly ["supra", "switchboard", "pyth"];
|
|
2809
|
+
type SupportOracleType = (typeof _SUPPORT_ORACLES)[number];
|
|
2860
2810
|
interface AddressesInterface {
|
|
2861
2811
|
core: {
|
|
2862
2812
|
version: string;
|
|
@@ -2866,7 +2816,7 @@ interface AddressesInterface {
|
|
|
2866
2816
|
adminCap: string;
|
|
2867
2817
|
coinDecimalsRegistry: string;
|
|
2868
2818
|
obligationAccessStore: string;
|
|
2869
|
-
coins: Partial<Record<
|
|
2819
|
+
coins: Partial<Record<string, {
|
|
2870
2820
|
id: string;
|
|
2871
2821
|
treasury: string;
|
|
2872
2822
|
metaData: string;
|
|
@@ -2874,21 +2824,21 @@ interface AddressesInterface {
|
|
|
2874
2824
|
symbol: string;
|
|
2875
2825
|
decimals: number;
|
|
2876
2826
|
oracle: {
|
|
2877
|
-
[K in SupportOracleType]: K extends (typeof
|
|
2827
|
+
[K in SupportOracleType]: K extends (typeof _SUPPORT_ORACLES)[0] ? string : K extends (typeof _SUPPORT_ORACLES)[1] ? string : K extends (typeof _SUPPORT_ORACLES)[2] ? {
|
|
2878
2828
|
feed: string;
|
|
2879
2829
|
feedObject: string;
|
|
2880
2830
|
} : never;
|
|
2881
2831
|
};
|
|
2882
2832
|
}>>;
|
|
2883
2833
|
oracles: {
|
|
2884
|
-
[K in SupportOracleType]: K extends (typeof
|
|
2834
|
+
[K in SupportOracleType]: K extends (typeof _SUPPORT_ORACLES)[0] ? {
|
|
2885
2835
|
registry: string;
|
|
2886
2836
|
registryCap: string;
|
|
2887
2837
|
holder: string;
|
|
2888
|
-
} : K extends (typeof
|
|
2838
|
+
} : K extends (typeof _SUPPORT_ORACLES)[1] ? {
|
|
2889
2839
|
registry: string;
|
|
2890
2840
|
registryCap: string;
|
|
2891
|
-
} : K extends (typeof
|
|
2841
|
+
} : K extends (typeof _SUPPORT_ORACLES)[2] ? {
|
|
2892
2842
|
registry: string;
|
|
2893
2843
|
registryCap: string;
|
|
2894
2844
|
state: string;
|
|
@@ -2899,7 +2849,7 @@ interface AddressesInterface {
|
|
|
2899
2849
|
xOracle: string;
|
|
2900
2850
|
xOracleCap: string;
|
|
2901
2851
|
};
|
|
2902
|
-
packages: Partial<Record<
|
|
2852
|
+
packages: Partial<Record<string, {
|
|
2903
2853
|
id: string;
|
|
2904
2854
|
object?: string;
|
|
2905
2855
|
upgradeCap: string;
|
|
@@ -2910,7 +2860,7 @@ interface AddressesInterface {
|
|
|
2910
2860
|
adminCap: string;
|
|
2911
2861
|
object: string;
|
|
2912
2862
|
config: string;
|
|
2913
|
-
pools: Partial<Record<
|
|
2863
|
+
pools: Partial<Record<string, {
|
|
2914
2864
|
id: string;
|
|
2915
2865
|
rewardPoolId: string;
|
|
2916
2866
|
}>>;
|
|
@@ -2954,7 +2904,7 @@ interface AddressesInterface {
|
|
|
2954
2904
|
};
|
|
2955
2905
|
scoin: {
|
|
2956
2906
|
id: string;
|
|
2957
|
-
coins: Partial<Record<
|
|
2907
|
+
coins: Partial<Record<string, {
|
|
2958
2908
|
coinType: string;
|
|
2959
2909
|
symbol: string;
|
|
2960
2910
|
treasury: string;
|
|
@@ -2975,6 +2925,7 @@ type ScallopClientVeScaReturnType<T extends boolean> = T extends true ? SuiTrans
|
|
|
2975
2925
|
};
|
|
2976
2926
|
type ScallopBaseInstanceParams = {
|
|
2977
2927
|
suiKit?: SuiKit;
|
|
2928
|
+
cache?: ScallopCache;
|
|
2978
2929
|
};
|
|
2979
2930
|
type ScallopCacheInstanceParams = ScallopBaseInstanceParams & {
|
|
2980
2931
|
queryClient?: QueryClient;
|
|
@@ -2982,11 +2933,15 @@ type ScallopCacheInstanceParams = ScallopBaseInstanceParams & {
|
|
|
2982
2933
|
type ScallopAddressInstanceParams = ScallopBaseInstanceParams & {
|
|
2983
2934
|
cache?: ScallopCache;
|
|
2984
2935
|
};
|
|
2936
|
+
type ScallopConstantsInstanceParams = {
|
|
2937
|
+
address?: ScallopAddress;
|
|
2938
|
+
cache?: ScallopCache;
|
|
2939
|
+
};
|
|
2985
2940
|
type ScallopIndexerInstanceParams = {
|
|
2986
2941
|
cache?: ScallopCache;
|
|
2987
2942
|
};
|
|
2988
2943
|
type ScallopUtilsInstanceParams = ScallopBaseInstanceParams & {
|
|
2989
|
-
|
|
2944
|
+
constants?: ScallopConstants;
|
|
2990
2945
|
};
|
|
2991
2946
|
type ScallopQueryInstanceParams = ScallopBaseInstanceParams & {
|
|
2992
2947
|
utils?: ScallopUtils;
|
|
@@ -2998,155 +2953,49 @@ type ScallopBuilderInstanceParams = ScallopBaseInstanceParams & {
|
|
|
2998
2953
|
type ScallopClientInstanceParams = ScallopBaseInstanceParams & {
|
|
2999
2954
|
builder?: ScallopBuilder;
|
|
3000
2955
|
};
|
|
3001
|
-
type
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
network?: NetworkType;
|
|
3005
|
-
forceInterface?: Partial<Record<NetworkType, AddressesInterface>>;
|
|
2956
|
+
type ScallopCacheConfig = {
|
|
2957
|
+
tokensPerInterval?: number;
|
|
2958
|
+
interval?: number;
|
|
3006
2959
|
};
|
|
3007
|
-
type
|
|
3008
|
-
addressId?: string;
|
|
3009
|
-
forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
|
|
2960
|
+
type ScallopCacheParams = {
|
|
3010
2961
|
walletAddress?: string;
|
|
2962
|
+
cacheOptions?: QueryClientConfig;
|
|
2963
|
+
config?: ScallopCacheConfig;
|
|
3011
2964
|
} & SuiKitParams;
|
|
3012
|
-
type
|
|
3013
|
-
|
|
2965
|
+
type ScallopIndexerParams = ScallopCacheParams & {
|
|
2966
|
+
indexerApiUrl?: string;
|
|
2967
|
+
axios?: AxiosInstance;
|
|
2968
|
+
};
|
|
2969
|
+
type ScallopAddressParams = ScallopCacheParams & {
|
|
2970
|
+
addressApiUrl?: string;
|
|
2971
|
+
addressId: string;
|
|
2972
|
+
auth?: string;
|
|
2973
|
+
network?: NetworkType;
|
|
2974
|
+
forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
|
|
2975
|
+
};
|
|
2976
|
+
type ScallopConstantsParams = ScallopAddressParams & {
|
|
2977
|
+
poolAddressesApiUrl?: string;
|
|
2978
|
+
whitelistApiUrl?: string;
|
|
2979
|
+
forcePoolAddressInterface?: Record<string, PoolAddress>;
|
|
2980
|
+
forceWhitelistInterface?: Whitelist;
|
|
2981
|
+
};
|
|
2982
|
+
type ScallopUtilsParams = ScallopAddressParams & ScallopConstantsParams & {
|
|
3014
2983
|
pythEndpoints?: string[];
|
|
2984
|
+
};
|
|
2985
|
+
type ScallopQueryParams = ScallopUtilsParams & ScallopIndexerParams;
|
|
2986
|
+
type ScallopBuilderParams = ScallopQueryParams & {
|
|
3015
2987
|
usePythPullModel?: boolean;
|
|
3016
2988
|
useOnChainXOracleList?: boolean;
|
|
3017
|
-
} & ScallopQueryParams;
|
|
3018
|
-
type ScallopQueryParams = ScallopParams & ScallopUtilsParams;
|
|
3019
|
-
type ScallopUtilsParams = ScallopParams & {
|
|
3020
|
-
pythEndpoints?: string[];
|
|
3021
2989
|
};
|
|
3022
|
-
type
|
|
3023
|
-
|
|
2990
|
+
type ScallopClientParams = ScallopBuilderParams;
|
|
2991
|
+
type ScallopParams = SuiKitParams & ScallopAddressParams & ScallopConstantsParams & {
|
|
2992
|
+
walletAddress?: string;
|
|
3024
2993
|
};
|
|
3025
2994
|
|
|
3026
2995
|
type OptionalKeys<T> = {
|
|
3027
2996
|
[K in keyof T]?: T[K];
|
|
3028
2997
|
};
|
|
3029
|
-
type CoinPrices = OptionalKeys<Record<
|
|
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: (addressId?: string) => (string | {
|
|
3099
|
-
addressId: 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[];
|
|
2998
|
+
type CoinPrices = OptionalKeys<Record<string, number>>;
|
|
3150
2999
|
|
|
3151
3000
|
declare const TEST_ADDRESSES: AddressesInterface;
|
|
3152
3001
|
|
|
@@ -3158,4 +3007,4 @@ declare const MIN_TOP_UP_AMOUNT: 1000000000;
|
|
|
3158
3007
|
|
|
3159
3008
|
declare const xOracleList: xOracleListType;
|
|
3160
3009
|
|
|
3161
|
-
export {
|
|
3010
|
+
export { API_BASE_URL, type AddressStringPath, type AddressesInterface, type AssetCoinIds, type AssetCoins, type BalanceSheet, type BaseScallopTxBlock, type BorrowDynamic, type BorrowFee, type BorrowIncentiveAccountKey, type BorrowIncentiveAccounts, type BorrowIncentiveAccountsQueryInterface, type BorrowIncentiveIds, type BorrowIncentiveNormalMethods, type BorrowIncentivePool, type BorrowIncentivePoolPoints, type BorrowIncentivePools, type BorrowIncentivePoolsQueryInterface, type BorrowIncentiveQuickMethods, type BorrowIncentiveRewardCoins, type BorrowIncentiveTxBlock, type CalculatedBorrowIncentivePoolPointData, type CalculatedMarketCollateralData, type CalculatedMarketPoolData, type CalculatedSpoolData, type CalculatedSpoolRewardPoolData, type CoinAmounts, type CoinPrices, type CoinWrappedType, type Coins, type CollateralStat, type CoreIds, type CoreNormalMethods, type CoreQuickMethods, type CoreTxBlock, DEFAULT_CACHE_OPTIONS, type GenerateBorrowIncentiveNormalMethod, type GenerateBorrowIncentiveQuickMethod, type GenerateCoreNormalMethod, type GenerateCoreQuickMethod, type GenerateLoyaltyProgramNormalMethod, type GenerateLoyaltyProgramQuickMethod, type GenerateSCoinNormalMethod, type GenerateSCoinQuickMethod, type GenerateSpoolNormalMethod, type GenerateSpoolQuickMethod, type GenerateVeScaNormalMethod, type GenerateVeScaQuickMethod, IS_VE_SCA_TEST, type InterestModel, type Lending, type Lendings, type LoyaltyProgramIds, type LoyaltyProgramInfo, type LoyaltyProgramNormalMethods, type LoyaltyProgramQuickMethods, type LoyaltyProgramTxBlock, MAX_LOCK_DURATION, MAX_LOCK_ROUNDS, MIN_INITIAL_LOCK_AMOUNT, MIN_TOP_UP_AMOUNT, type Market, type MarketCoinAmounts, type MarketCoins, type MarketCollateral, type MarketCollaterals, type MarketPool, type MarketPools, type MarketQueryInterface, type NestedResult, OLD_BORROW_INCENTIVE_PROTOCOL_ID, type Obligation, type ObligationAccount, type ObligationAccounts, type 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, type ParsedBorrowIncentiveAccountData, type ParsedBorrowIncentiveAccountPoolData, type ParsedBorrowIncentivePoolData, type ParsedBorrowIncentivePoolPointData, type ParsedMarketCollateralData, type ParsedMarketPoolData, type ParsedSpoolData, type ParsedSpoolRewardPoolData, type PoolAddress, RPC_PROVIDERS, type RedeemScaQuickReturnType, type RiskModel, SCA_COIN_TYPE, type SCoinAmounts, type SCoinConverterTreasury, type SCoinIds, type SCoinTreasuryCaps, type SCoinTxBlock, type SCoins, SDK_API_BASE_URL, Scallop, ScallopAddress, type ScallopAddressInstanceParams, type ScallopAddressParams, type ScallopBaseInstanceParams, ScallopBuilder, type ScallopBuilderInstanceParams, type ScallopBuilderParams, ScallopCache, type ScallopCacheConfig, type ScallopCacheInstanceParams, type ScallopCacheParams, ScallopClient, type ScallopClientFnReturnType, type ScallopClientInstanceParams, type ScallopClientParams, type ScallopClientVeScaReturnType, ScallopConstants, type ScallopConstantsInstanceParams, type ScallopConstantsParams, ScallopIndexer, type ScallopIndexerInstanceParams, type ScallopIndexerParams, type ScallopParams, ScallopQuery, type ScallopQueryInstanceParams, type ScallopQueryParams, type ScallopTxBlock, ScallopUtils, type ScallopUtilsInstanceParams, type ScallopUtilsParams, type SelectCoinReturnType, type Spool, type SpoolData, type SpoolIds, type SpoolNormalMethods, type SpoolQuickMethods, type SpoolRewardPool, type SpoolTxBlock, type Spools, type StakeAccount, type StakeAccounts, type StakeMarketCoins, type StakePool, type StakePools, type StakeRewardCoins, type StakeRewardPool, type StakeRewardPools, type SuiBridgeCoins, type SuiBridgedCoinPackageIds, type SuiTxBlockWithBorrowIncentiveNormalMethods, type SuiTxBlockWithCoreNormalMethods, type SuiTxBlockWithLoyaltyProgramNormalMethods, type SuiTxBlockWithSCoin, type SuiTxBlockWithSCoinNormalMethods, type SuiTxBlockWithSpool, type SuiTxBlockWithSpoolNormalMethods, type SuiTxBlockWithVeScaNormalMethods, TEST_ADDRESSES, type TotalValueLocked, UNLOCK_ROUND_DURATION, USE_TEST_ADDRESS, type VeScaNormalMethods, type VeScaQuickMethods, type VeScaTreasuryFields, type VeScaTreasuryInfo, type VeScaTxBlock, type Vesca, type VescaIds, type VoloCoinIds, type Whitelist, type WormholeCoinIds, queryKeys, type sCoinBalance, type sCoinNormalMethods, type sCoinPkgIds, type sCoinQuickMethods, xOracleList, type xOracleListType, type xOracleRuleType, type xOracleRules };
|