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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/index.d.mts +3159 -0
  2. package/dist/index.d.ts +3159 -3
  3. package/dist/index.js +78 -9966
  4. package/dist/index.mjs +15 -9892
  5. package/package.json +5 -6
  6. package/src/constants/coinGecko.ts +14 -4
  7. package/src/constants/common.ts +7 -0
  8. package/src/constants/enum.ts +23 -0
  9. package/src/constants/poolAddress.ts +112 -1
  10. package/src/constants/pyth.ts +4 -1
  11. package/src/constants/testAddress.ts +220 -49
  12. package/src/constants/xoracle.ts +3 -0
  13. package/src/models/scallopAddress.ts +9 -0
  14. package/src/models/scallopQuery.ts +4 -2
  15. package/src/queries/poolAddressesQuery.ts +2 -2
  16. package/src/queries/portfolioQuery.ts +7 -8
  17. package/src/types/address.ts +1 -0
  18. package/src/utils/util.ts +8 -3
  19. package/dist/builders/borrowIncentiveBuilder.d.ts +0 -12
  20. package/dist/builders/coreBuilder.d.ts +0 -12
  21. package/dist/builders/index.d.ts +0 -12
  22. package/dist/builders/loyaltyProgramBuilder.d.ts +0 -12
  23. package/dist/builders/oracle.d.ts +0 -14
  24. package/dist/builders/referralBuilder.d.ts +0 -12
  25. package/dist/builders/sCoinBuilder.d.ts +0 -4
  26. package/dist/builders/spoolBuilder.d.ts +0 -12
  27. package/dist/builders/vescaBuilder.d.ts +0 -25
  28. package/dist/constants/cache.d.ts +0 -14
  29. package/dist/constants/coinGecko.d.ts +0 -2
  30. package/dist/constants/common.d.ts +0 -20
  31. package/dist/constants/enum.d.ts +0 -14
  32. package/dist/constants/flashloan.d.ts +0 -2
  33. package/dist/constants/index.d.ts +0 -13
  34. package/dist/constants/poolAddress.d.ts +0 -27
  35. package/dist/constants/pyth.d.ts +0 -5
  36. package/dist/constants/queryKeys.d.ts +0 -54
  37. package/dist/constants/rpc.d.ts +0 -1
  38. package/dist/constants/testAddress.d.ts +0 -2
  39. package/dist/constants/vesca.d.ts +0 -5
  40. package/dist/constants/xoracle.d.ts +0 -2
  41. package/dist/index.js.map +0 -1
  42. package/dist/index.mjs.map +0 -1
  43. package/dist/models/index.d.ts +0 -8
  44. package/dist/models/scallop.d.ts +0 -73
  45. package/dist/models/scallopAddress.d.ts +0 -150
  46. package/dist/models/scallopBuilder.d.ts +0 -90
  47. package/dist/models/scallopCache.d.ts +0 -81
  48. package/dist/models/scallopClient.d.ts +0 -321
  49. package/dist/models/scallopIndexer.d.ts +0 -90
  50. package/dist/models/scallopPrice.d.ts +0 -0
  51. package/dist/models/scallopQuery.d.ts +0 -704
  52. package/dist/models/scallopUtils.d.ts +0 -229
  53. package/dist/models/suiKit.d.ts +0 -2
  54. package/dist/queries/borrowIncentiveQuery.d.ts +0 -82
  55. package/dist/queries/borrowLimitQuery.d.ts +0 -9
  56. package/dist/queries/coreQuery.d.ts +0 -171
  57. package/dist/queries/index.d.ts +0 -15
  58. package/dist/queries/isolatedAssetQuery.d.ts +0 -14
  59. package/dist/queries/loyaltyProgramQuery.d.ts +0 -10
  60. package/dist/queries/objectsQuery.d.ts +0 -2
  61. package/dist/queries/poolAddressesQuery.d.ts +0 -29
  62. package/dist/queries/portfolioQuery.d.ts +0 -143
  63. package/dist/queries/priceQuery.d.ts +0 -58
  64. package/dist/queries/referralQuery.d.ts +0 -7
  65. package/dist/queries/sCoinQuery.d.ts +0 -41
  66. package/dist/queries/spoolQuery.d.ts +0 -74
  67. package/dist/queries/supplyLimitQuery.d.ts +0 -9
  68. package/dist/queries/vescaQuery.d.ts +0 -36
  69. package/dist/queries/xOracleQuery.d.ts +0 -13
  70. package/dist/types/address.d.ts +0 -108
  71. package/dist/types/builder/borrowIncentive.d.ts +0 -35
  72. package/dist/types/builder/core.d.ts +0 -56
  73. package/dist/types/builder/index.d.ts +0 -24
  74. package/dist/types/builder/loyaltyProgram.d.ts +0 -23
  75. package/dist/types/builder/referral.d.ts +0 -30
  76. package/dist/types/builder/sCoin.d.ts +0 -37
  77. package/dist/types/builder/spool.d.ts +0 -29
  78. package/dist/types/builder/vesca.d.ts +0 -51
  79. package/dist/types/constant/common.d.ts +0 -24
  80. package/dist/types/constant/enum.d.ts +0 -48
  81. package/dist/types/constant/index.d.ts +0 -3
  82. package/dist/types/constant/xOracle.d.ts +0 -9
  83. package/dist/types/index.d.ts +0 -6
  84. package/dist/types/model.d.ts +0 -60
  85. package/dist/types/query/borrowIncentive.d.ts +0 -124
  86. package/dist/types/query/core.d.ts +0 -380
  87. package/dist/types/query/index.d.ts +0 -7
  88. package/dist/types/query/loyaltyProgram.d.ts +0 -5
  89. package/dist/types/query/portfolio.d.ts +0 -119
  90. package/dist/types/query/sCoin.d.ts +0 -1
  91. package/dist/types/query/spool.d.ts +0 -142
  92. package/dist/types/query/vesca.d.ts +0 -26
  93. package/dist/types/utils.d.ts +0 -22
  94. package/dist/utils/builder.d.ts +0 -15
  95. package/dist/utils/core.d.ts +0 -2
  96. package/dist/utils/index.d.ts +0 -5
  97. package/dist/utils/indexer.d.ts +0 -17
  98. package/dist/utils/query.d.ts +0 -62
  99. package/dist/utils/util.d.ts +0 -27
@@ -1,229 +0,0 @@
1
- import { SuiKit } from '@scallop-io/sui-kit';
2
- import { ScallopAddress } from './scallopAddress';
3
- import { ScallopCache } from './scallopCache';
4
- import type { ScallopUtilsParams, SupportCoins, SupportAssetCoins, SupportMarketCoins, SupportStakeMarketCoins, CoinWrappedType, SupportSCoin, ScallopUtilsInstanceParams, SupportSuiBridgeCoins, SupportWormholeCoins, PoolAddressInfo } from '../types';
5
- import type { SuiObjectArg, SuiTxBlock } from '@scallop-io/sui-kit';
6
- /**
7
- * @description
8
- * Integrates some helper functions frequently used in interactions with the Scallop contract.
9
- *
10
- * @example
11
- * ```typescript
12
- * const scallopUtils = new ScallopUtils(<parameters>);
13
- * await scallopUtils.init();
14
- * scallopUtils.<utils functions>();
15
- * await scallopUtils.<utils functions>();
16
- * ```
17
- */
18
- export declare class ScallopUtils {
19
- readonly params: ScallopUtilsParams;
20
- readonly isTestnet: boolean;
21
- suiKit: SuiKit;
22
- address: ScallopAddress;
23
- cache: ScallopCache;
24
- walletAddress: string;
25
- constructor(params: ScallopUtilsParams, instance?: ScallopUtilsInstanceParams);
26
- isSuiBridgeAsset(coinName: any): coinName is SupportSuiBridgeCoins;
27
- isWormholeAsset(coinName: any): coinName is SupportWormholeCoins;
28
- /**
29
- * Request the scallop API to initialize data.
30
- *
31
- * @param force - Whether to force initialization.
32
- * @param address - ScallopAddress instance.
33
- */
34
- init(force?: boolean, address?: ScallopAddress): Promise<void>;
35
- /**
36
- * Convert coin name to symbol.
37
- *
38
- * @param coinName - Specific support coin name.
39
- * @return Symbol string.
40
- */
41
- parseSymbol(coinName: SupportCoins): string;
42
- /**
43
- * Convert coin name to coin type.
44
- *
45
- * @description
46
- * The Coin type of wormhole is fixed `coin:Coin`. Here using package id
47
- * to determine and return the type.
48
- *
49
- * @param coinPackageId - Package id of coin.
50
- * @param coinName - Specific support coin name.
51
- * @return Coin type.
52
- */
53
- parseCoinType(coinName: SupportCoins, useOldMarketCoin?: boolean): string;
54
- /**
55
- * Convert coin name to sCoin name.
56
- *
57
- * @param coinName - Specific support coin name.
58
- * @return sCoin name.
59
- */
60
- parseSCoinName<T extends SupportSCoin>(coinName: SupportCoins | SupportMarketCoins): T | undefined;
61
- /**
62
- * Convert sCoin name to market coin name.
63
- * This function will parse new sCoin name `scallop_...` to its old market coin name which is shorter
64
- * e.g: `scallop_sui -> ssui
65
- * if no `scallop_...` is encountered, return coinName
66
- * @return sCoin name
67
- */
68
- parseSCoinTypeNameToMarketCoinName(coinName: string): "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub";
69
- /**
70
- * Convert sCoin name into sCoin type
71
- * @param sCoinName
72
- * @returns sCoin type
73
- */
74
- parseSCoinType(sCoinName: SupportSCoin): string;
75
- /**
76
- * Convert sCoinType into sCoin name
77
- * @param sCoinType
78
- * @returns sCoin name
79
- */
80
- parseSCoinNameFromType(sCoinType: string): "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub";
81
- /**
82
- * Convert sCoin name into its underlying coin type
83
- * @param sCoinName
84
- * @returns coin type
85
- */
86
- parseUnderlyingSCoinType(sCoinName: SupportSCoin): string;
87
- /**
88
- * Get sCoin treasury id from sCoin name
89
- * @param sCoinName
90
- * @returns sCoin treasury id
91
- */
92
- getSCoinTreasury(sCoinName: SupportSCoin): any;
93
- /**
94
- * Convert coin name to market coin type.
95
- *
96
- * @param coinPackageId - Package id of coin.
97
- * @param coinName - Specific support coin name.
98
- * @return Market coin type.
99
- */
100
- parseMarketCoinType(coinName: SupportCoins): string;
101
- /**
102
- * Convert coin type to coin name.
103
- *
104
- * @description
105
- * The coin name cannot be obtained directly from the wormhole type. Here
106
- * the package id is used to determine and return a specific name.
107
- *
108
- * @param coinType - Specific support coin type.
109
- * @return Coin Name.
110
- */
111
- parseCoinNameFromType<T extends SupportAssetCoins>(coinType: string): T extends SupportAssetCoins ? T : SupportAssetCoins;
112
- parseCoinNameFromType<T extends SupportMarketCoins>(coinType: string): T extends SupportMarketCoins ? T : SupportMarketCoins;
113
- parseCoinNameFromType<T extends SupportCoins>(coinType: string): T extends SupportCoins ? T : SupportCoins;
114
- parseCoinNameFromType<T extends SupportSCoin>(coinType: string): T extends SupportSCoin ? T : SupportSCoin;
115
- /**
116
- * Convert market coin name to coin name.
117
- *
118
- * @param marketCoinName - Specific support market coin name.
119
- * @return Coin Name.
120
- */
121
- parseCoinName<T extends SupportAssetCoins>(marketCoinName: string): T;
122
- /**
123
- * Convert coin name to market coin name.
124
- *
125
- * @param coinName - Specific support coin name.
126
- * @return Market coin name.
127
- */
128
- parseMarketCoinName<T extends SupportMarketCoins>(coinName: SupportCoins): T;
129
- /**
130
- * Get reward type of spool.
131
- *
132
- * @param stakeMarketCoinName - Support stake market coin.
133
- * @return Spool reward coin name.
134
- */
135
- getSpoolRewardCoinName: (stakeMarketCoinName: SupportStakeMarketCoins) => "sui";
136
- /**
137
- * Get coin decimal.
138
- *
139
- * return Coin decimal.
140
- */
141
- getCoinDecimal(coinName: SupportCoins): number;
142
- /**
143
- * Get coin wrapped type.
144
- *
145
- * return Coin wrapped type.
146
- */
147
- getCoinWrappedType(assetCoinName: SupportAssetCoins): CoinWrappedType;
148
- /**
149
- * Select coin id that add up to the given amount as transaction arguments.
150
- *
151
- * @param ownerAddress - The address of the owner.
152
- * @param amount - The amount that including coin decimals.
153
- * @param coinType - The coin type, default is 0x2::SUI::SUI.
154
- * @return The selected transaction coin arguments.
155
- */
156
- selectCoins(amount: number, coinType?: string, ownerAddress?: string): Promise<{
157
- objectId: string;
158
- digest: string;
159
- version: string;
160
- balance: string;
161
- }[]>;
162
- /**
163
- * Merge coins with type `coinType` to dest
164
- * @param txBlock
165
- * @param dest
166
- * @param coinType
167
- * @param sender
168
- */
169
- mergeSimilarCoins(txBlock: SuiTxBlock, dest: SuiObjectArg, coinType: string, sender?: string): Promise<void>;
170
- /**
171
- * Get all asset coin names in the obligation record by obligation id.
172
- *
173
- * @description
174
- * This can often be used to determine which assets in an obligation require
175
- * price updates before interacting with specific instructions of the Scallop contract.
176
- *
177
- * @param obligationId - The obligation id.
178
- * @return Asset coin Names.
179
- */
180
- getObligationCoinNames(obligationId: SuiObjectArg): Promise<SupportAssetCoins[] | undefined>;
181
- /**
182
- * Get asset coin price.
183
- *
184
- * @description
185
- * The strategy for obtaining the price is to get it through API first,
186
- * and then on-chain data if API cannot be retrieved.
187
- * Currently, we only support obtaining from pyth protocol, other
188
- * oracles will be supported in the future.
189
- *
190
- * @param assetCoinNames - Specific an array of support asset coin name.
191
- * @return Asset coin price.
192
- */
193
- getCoinPrices(_?: SupportAssetCoins[]): Promise<import("../types").OptionalKeys<Record<SupportCoins, number>>>;
194
- /**
195
- * Convert apr to apy.
196
- *
197
- * @param apr The annual percentage rate (APR).
198
- * @param compoundFrequency How often interest is compounded per year. Default is daily (365 times a year).
199
- * @return The equivalent annual percentage yield (APY) for the given APR and compounding frequency.
200
- */
201
- parseAprToApy(apr: number, compoundFrequency?: number): number;
202
- /**
203
- * Convert apy to apr.
204
- *
205
- * @param apr The equivalent annual percentage yield (APY).
206
- * @param compoundFrequency How often interest is compounded per year. Default is daily (365 times a year).
207
- * @return The equivalent annual percentage rate (APR) for the given APY and compounding frequency.
208
- */
209
- parseApyToApr(apy: number, compoundFrequency?: number): number;
210
- /**
211
- * Give extend lock period to get unlock at in seconds timestamp.
212
- *
213
- * @description
214
- * - When the user without remaining unlock period, If the extended unlock day is not specified,
215
- * the unlock period will be increased by one day by default.
216
- * - When the given extended day plus the user's remaining unlock period exceeds the maximum
217
- * unlock period, the maximum unlock period is used as unlock period.
218
- *
219
- * @param extendLockPeriodInDay The extend lock period in day.
220
- * @param unlockAtInSecondTimestamp The unlock timestamp from veSca object.
221
- * @return New unlock at in seconds timestamp.
222
- */
223
- getUnlockAt(extendLockPeriodInDay?: number, unlockAtInMillisTimestamp?: number): number;
224
- /**
225
- * Get detailed contract address and price id information for supported pool in Scallop
226
- * @returns Supported pool informations
227
- */
228
- getSupportedPoolAddresses(): PoolAddressInfo[];
229
- }
@@ -1,2 +0,0 @@
1
- import { SuiKit, SuiKitParams } from '@scallop-io/sui-kit';
2
- export declare const newSuiKit: (params: SuiKitParams) => SuiKit;
@@ -1,82 +0,0 @@
1
- import type { ScallopAddress, ScallopQuery, ScallopUtils } from '../models';
2
- import type { BorrowIncentivePoolsQueryInterface, SupportBorrowIncentiveCoins, BorrowIncentivePool, CoinPrices, MarketPools } from '../types';
3
- import { SuiObjectRef } from '@mysten/sui/client';
4
- /**
5
- * Query borrow incentive pools data using moveCall
6
- * @param address
7
- * @returns
8
- */
9
- export declare const queryBorrowIncentivePools: (address: ScallopAddress) => Promise<BorrowIncentivePoolsQueryInterface | undefined>;
10
- /**
11
- * Get borrow incentive pools data.
12
- *
13
- * @param query - The Scallop query instance.
14
- * @param borrowIncentiveCoinNames - Specific an array of support borrow incentive coin name.
15
- * @param indexer - Whether to use indexer.
16
- * @return Borrow incentive pools data.
17
- */
18
- export declare const getBorrowIncentivePools: (query: ScallopQuery, borrowIncentiveCoinNames?: SupportBorrowIncentiveCoins[], indexer?: boolean, marketPools?: MarketPools, coinPrices?: CoinPrices) => Promise<{
19
- usdc?: BorrowIncentivePool | undefined;
20
- sbeth?: BorrowIncentivePool | undefined;
21
- sbusdt?: BorrowIncentivePool | undefined;
22
- sbwbtc?: BorrowIncentivePool | undefined;
23
- weth?: BorrowIncentivePool | undefined;
24
- wbtc?: BorrowIncentivePool | undefined;
25
- wusdc?: BorrowIncentivePool | undefined;
26
- wusdt?: BorrowIncentivePool | undefined;
27
- sui?: BorrowIncentivePool | undefined;
28
- wapt?: BorrowIncentivePool | undefined;
29
- wsol?: BorrowIncentivePool | undefined;
30
- cetus?: BorrowIncentivePool | undefined;
31
- afsui?: BorrowIncentivePool | undefined;
32
- hasui?: BorrowIncentivePool | undefined;
33
- vsui?: BorrowIncentivePool | undefined;
34
- sca?: BorrowIncentivePool | undefined;
35
- fud?: BorrowIncentivePool | undefined;
36
- deep?: BorrowIncentivePool | undefined;
37
- fdusd?: BorrowIncentivePool | undefined;
38
- blub?: BorrowIncentivePool | undefined;
39
- }>;
40
- /**
41
- * Query borrow incentive accounts data.
42
- *
43
- * @param query - The Scallop query instance.
44
- * @param borrowIncentiveCoinNames - Specific an array of support borrow incentive coin name.
45
- * @return Borrow incentive accounts data.
46
- */
47
- export declare const queryBorrowIncentiveAccounts: ({ utils, }: {
48
- utils: ScallopUtils;
49
- }, obligationId: string | SuiObjectRef, borrowIncentiveCoinNames?: SupportBorrowIncentiveCoins[]) => Promise<{
50
- usdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
51
- sbeth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
52
- sbusdt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
53
- sbwbtc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
54
- weth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
55
- wbtc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
56
- wusdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
57
- wusdt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
58
- sui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
59
- wapt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
60
- wsol?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
61
- cetus?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
62
- afsui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
63
- hasui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
64
- vsui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
65
- sca?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
66
- fud?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
67
- deep?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
68
- fdusd?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
69
- blub?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
70
- }>;
71
- /**
72
- * Check veSca bind status
73
- * @param query
74
- * @param veScaKey
75
- * @returns
76
- */
77
- export declare const getBindedObligationId: ({ address, }: {
78
- address: ScallopAddress;
79
- }, veScaKeyId: string) => Promise<string | null>;
80
- export declare const getBindedVeScaKey: ({ address, }: {
81
- address: ScallopAddress;
82
- }, obligationId: string) => Promise<string | null>;
@@ -1,9 +0,0 @@
1
- import { ScallopUtils } from 'src/models';
2
- import { SupportPoolCoins } from 'src/types';
3
- /**
4
- * Return supply limit of a pool (including the decimals)
5
- * @param utils
6
- * @param poolName
7
- * @returns supply limit (decimals included)
8
- */
9
- export declare const getBorrowLimit: (utils: ScallopUtils, poolName: SupportPoolCoins) => Promise<string | null>;
@@ -1,171 +0,0 @@
1
- import type { SuiObjectData } from '@mysten/sui/client';
2
- import type { SuiObjectArg } from '@scallop-io/sui-kit';
3
- import type { ScallopAddress, ScallopCache, ScallopQuery } from '../models';
4
- import { Market, MarketPools, MarketPool, MarketCollaterals, MarketCollateral, SupportAssetCoins, SupportPoolCoins, SupportCollateralCoins, ObligationQueryInterface, Obligation, SupportMarketCoins, OptionalKeys, CoinPrices } from '../types';
5
- /**
6
- * Query market data.
7
- *
8
- * @deprecated Use query market pools
9
- *
10
- * @description
11
- * Use inspectTxn call to obtain the data provided in the scallop contract query module.
12
- *
13
- * @param query - The Scallop query instance.
14
- * @param indexer - Whether to use indexer.
15
- * @return Market data.
16
- */
17
- export declare const queryMarket: (query: ScallopQuery, indexer?: boolean, coinPrices?: CoinPrices) => Promise<Market>;
18
- /**
19
- * Get coin market pools data.
20
- *
21
- * @description
22
- * To obtain all market pools information at once, it is recommended to use
23
- * the `queryMarket` method to reduce time consumption.
24
- *
25
- * @param query - The Scallop query instance.
26
- * @param coinNames - Specific an array of support pool coin name.
27
- * @param indexer - Whether to use indexer.
28
- * @return Market pools data.
29
- */
30
- export declare const getMarketPools: (query: ScallopQuery, poolCoinNames: SupportPoolCoins[], indexer?: boolean, coinPrices?: CoinPrices) => Promise<{
31
- pools: MarketPools;
32
- collaterals: MarketCollaterals;
33
- }>;
34
- /**
35
- * Get market pool data.
36
- *
37
- * @param query - The Scallop query instance.
38
- * @param poolCoinName - Specific support pool coin name.
39
- * @param indexer - Whether to use indexer.
40
- * @param marketObject - The market object.
41
- * @param coinPrice - The coin price.
42
- * @returns Market pool data.
43
- */
44
- export declare const getMarketPool: (query: ScallopQuery, poolCoinName: SupportPoolCoins, indexer: boolean | undefined, coinPrice: number, requiredObjects?: {
45
- balanceSheet: SuiObjectData;
46
- borrowDynamic: SuiObjectData;
47
- interestModel: SuiObjectData;
48
- borrowFeeKey: SuiObjectData;
49
- supplyLimitKey: SuiObjectData;
50
- borrowLimitKey: SuiObjectData;
51
- isolatedAssetKey: SuiObjectData;
52
- }) => Promise<{
53
- marketPool: MarketPool;
54
- collateral?: MarketCollateral;
55
- } | undefined>;
56
- /**
57
- * Get coin market collaterals data.
58
- *
59
- * @description
60
- * To obtain all market collaterals information at once, it is recommended to use
61
- * the `queryMarket` method to reduce time consumption.
62
- *
63
- * @param query - The Scallop query instance.
64
- * @param collateralCoinNames - Specific an array of support collateral coin name.
65
- * @param indexer - Whether to use indexer.
66
- * @return Market collaterals data.
67
- */
68
- export declare const getMarketCollaterals: (query: ScallopQuery, collateralCoinNames?: SupportCollateralCoins[], indexer?: boolean) => Promise<{
69
- usdc?: MarketCollateral | undefined;
70
- sbeth?: MarketCollateral | undefined;
71
- sbusdt?: MarketCollateral | undefined;
72
- sbwbtc?: MarketCollateral | undefined;
73
- weth?: MarketCollateral | undefined;
74
- wbtc?: MarketCollateral | undefined;
75
- wusdc?: MarketCollateral | undefined;
76
- wusdt?: MarketCollateral | undefined;
77
- sui?: MarketCollateral | undefined;
78
- wapt?: MarketCollateral | undefined;
79
- wsol?: MarketCollateral | undefined;
80
- cetus?: MarketCollateral | undefined;
81
- afsui?: MarketCollateral | undefined;
82
- hasui?: MarketCollateral | undefined;
83
- vsui?: MarketCollateral | undefined;
84
- sca?: MarketCollateral | undefined;
85
- fdusd?: MarketCollateral | undefined;
86
- }>;
87
- /**
88
- * Get market collateral data.
89
- *
90
- * @param query - The Scallop query instance.
91
- * @param collateralCoinName - Specific support collateral coin name.
92
- * @param indexer - Whether to use indexer.
93
- * @param marketObject - The market object.
94
- * @param coinPrice - The coin price.
95
- * @returns Market collateral data.
96
- */
97
- export declare const getMarketCollateral: (query: ScallopQuery, collateralCoinName: SupportCollateralCoins, indexer?: boolean, marketObject?: SuiObjectData | null, coinPrice?: number) => Promise<MarketCollateral | undefined>;
98
- /**
99
- * Query all owned obligations.
100
- *
101
- * @param query - The Scallop query instance.
102
- * @param ownerAddress - The owner address.
103
- * @return Owned obligations.
104
- */
105
- export declare const getObligations: ({ address, }: {
106
- address: ScallopAddress;
107
- }, ownerAddress: string) => Promise<Obligation[]>;
108
- /**
109
- * Query obligation locked status.
110
- *
111
- * @param query - The Scallop query instance.
112
- * @param obligation - The obligation id or the obligation object.
113
- * @return Obligation locked status.
114
- */
115
- export declare const getObligationLocked: (cache: ScallopCache, obligation: string | SuiObjectData) => Promise<boolean>;
116
- /**
117
- * Query obligation data.
118
- *
119
- * @description
120
- * Use inspectTxn call to obtain the data provided in the scallop contract query module.
121
- *
122
- * @param query - The Scallop query instance.
123
- * @param obligationId - The obligation id.
124
- * @return Obligation data.
125
- */
126
- export declare const queryObligation: ({ address, }: {
127
- address: ScallopAddress;
128
- }, obligationId: SuiObjectArg, version?: SuiObjectArg, market?: SuiObjectArg) => Promise<ObligationQueryInterface | undefined>;
129
- /**
130
- * Query all owned coin amount.
131
- *
132
- * @param query - The Scallop query instance.
133
- * @param assetCoinNames - Specific an array of support asset coin name.
134
- * @param ownerAddress - The owner address.
135
- * @return All owned coin amounts.
136
- */
137
- export declare const getCoinAmounts: (query: ScallopQuery, assetCoinNames?: SupportAssetCoins[], ownerAddress?: string) => Promise<OptionalKeys<Record<SupportAssetCoins, number>>>;
138
- /**
139
- * Query owned coin amount.
140
- *
141
- * @param query - The Scallop query instance.
142
- * @param assetCoinName - Specific support asset coin name.
143
- * @param ownerAddress - The owner address.
144
- * @return Owned coin amount.
145
- */
146
- export declare const getCoinAmount: (query: ScallopQuery, assetCoinName: SupportAssetCoins, ownerAddress?: string) => Promise<number>;
147
- /**
148
- * Query all owned market coins (sCoin) amount.
149
- *
150
- * @param query - The Scallop query instance.
151
- * @param marketCoinNames - Specific an array of support market coin name.
152
- * @param ownerAddress - The owner address.
153
- * @return All owned market coins amount.
154
- */
155
- export declare const getMarketCoinAmounts: (query: ScallopQuery, marketCoinNames?: SupportMarketCoins[], ownerAddress?: string) => Promise<OptionalKeys<Record<SupportMarketCoins, number>>>;
156
- /**
157
- * Query owned market coin (sCoin) amount.
158
- *
159
- * @param query - The Scallop query instance.
160
- * @param marketCoinNames - Specific support market coin name.
161
- * @param ownerAddress - The owner address.
162
- * @return Owned market coin amount.
163
- */
164
- export declare const getMarketCoinAmount: (query: ScallopQuery, marketCoinName: SupportMarketCoins, ownerAddress?: string) => Promise<number>;
165
- /**
166
- * Get flashloan fee for specific asset
167
- * @param query - The Scallop query instance.
168
- * @param assetNames - Specific an array of support pool coin name.
169
- * @returns Record of asset name to flashloan fee in decimal
170
- */
171
- export declare const getFlashLoanFees: (query: ScallopQuery, assetNames: SupportPoolCoins[]) => Promise<Record<SupportPoolCoins, number>>;
@@ -1,15 +0,0 @@
1
- export * from './borrowIncentiveQuery';
2
- export * from './coreQuery';
3
- export * from './isolatedAssetQuery';
4
- export * from './loyaltyProgramQuery';
5
- export * from './portfolioQuery';
6
- export * from './priceQuery';
7
- export * from './referralQuery';
8
- export * from './sCoinQuery';
9
- export * from './spoolQuery';
10
- export * from './supplyLimitQuery';
11
- export * from './vescaQuery';
12
- export * from './borrowLimitQuery';
13
- export * from './poolAddressesQuery';
14
- export * from './objectsQuery';
15
- export * from './xOracleQuery';
@@ -1,14 +0,0 @@
1
- import { ScallopQuery, ScallopUtils } from '../models';
2
- import { SupportPoolCoins } from '../types';
3
- /**
4
- * Return list of isolated assets coin types
5
- * @param utils ScallopUtils
6
- * @returns list of isolated assets coin types
7
- */
8
- export declare const getIsolatedAssets: (query: ScallopQuery) => Promise<string[]>;
9
- /**
10
- * Check if the coin type is an isolated asset
11
- * @param coinName coin name
12
- * @returns true if the coin type is an isolated asset
13
- */
14
- export declare const isIsolatedAsset: (utils: ScallopUtils, coinName: SupportPoolCoins) => Promise<boolean>;
@@ -1,10 +0,0 @@
1
- import { SuiObjectData } from '@mysten/sui/client';
2
- import { ScallopQuery } from 'src/models';
3
- import { LoyaltyProgramInfo } from 'src/types';
4
- /**
5
- * Get user's loyalty program information and pending rewards if exists
6
- * @param query
7
- * @param veScaKey
8
- * @returns
9
- */
10
- export declare const getLoyaltyProgramInformations: (query: ScallopQuery, veScaKey?: string | SuiObjectData) => Promise<LoyaltyProgramInfo | null>;
@@ -1,2 +0,0 @@
1
- import { ScallopCache } from 'src/models/scallopCache';
2
- export declare const queryMultipleObjects: (cache: ScallopCache, rawObjectIds: string[], partitionSize?: number) => Promise<import("@mysten/sui/dist/cjs/client").SuiObjectData[]>;
@@ -1,29 +0,0 @@
1
- import { ScallopQuery } from 'src/models';
2
- import { OptionalKeys, SupportPoolCoins } from 'src/types';
3
- export declare const getAllAddresses: (query: ScallopQuery, pools?: SupportPoolCoins[]) => Promise<OptionalKeys<Record<"usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub", {
4
- coinName: string;
5
- symbol: string;
6
- lendingPoolAddress?: string;
7
- collateralPoolAddress?: string;
8
- borrowDynamic?: string;
9
- spoolReward?: string;
10
- spool?: string;
11
- sCoinType?: string;
12
- sCoinName?: string;
13
- sCoinSymbol?: string;
14
- sCoinTreasury?: string;
15
- interestModel?: string;
16
- riskModel?: string;
17
- borrowFeeKey?: string;
18
- supplyLimitKey?: string;
19
- borrowLimitKey?: string;
20
- isolatedAssetKey?: string;
21
- coinMetadataId?: string;
22
- borrowIncentivePoolId?: string;
23
- coinType?: string;
24
- sCoinMetadataId?: string;
25
- spoolName?: string;
26
- decimals: number;
27
- pythFeed?: string;
28
- pythFeedObjectId?: string;
29
- }>>>;