@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.
- package/dist/index.d.mts +3159 -0
- package/dist/index.d.ts +3159 -3
- package/dist/index.js +78 -9966
- package/dist/index.mjs +15 -9892
- package/package.json +5 -6
- package/src/constants/coinGecko.ts +14 -4
- package/src/constants/common.ts +7 -0
- package/src/constants/enum.ts +23 -0
- package/src/constants/poolAddress.ts +112 -1
- package/src/constants/pyth.ts +4 -1
- package/src/constants/testAddress.ts +220 -49
- package/src/constants/xoracle.ts +3 -0
- package/src/models/scallopAddress.ts +9 -0
- package/src/models/scallopQuery.ts +4 -2
- package/src/queries/poolAddressesQuery.ts +2 -2
- package/src/queries/portfolioQuery.ts +7 -8
- package/src/types/address.ts +1 -0
- package/src/utils/util.ts +8 -3
- package/dist/builders/borrowIncentiveBuilder.d.ts +0 -12
- package/dist/builders/coreBuilder.d.ts +0 -12
- package/dist/builders/index.d.ts +0 -12
- package/dist/builders/loyaltyProgramBuilder.d.ts +0 -12
- package/dist/builders/oracle.d.ts +0 -14
- package/dist/builders/referralBuilder.d.ts +0 -12
- package/dist/builders/sCoinBuilder.d.ts +0 -4
- package/dist/builders/spoolBuilder.d.ts +0 -12
- package/dist/builders/vescaBuilder.d.ts +0 -25
- package/dist/constants/cache.d.ts +0 -14
- package/dist/constants/coinGecko.d.ts +0 -2
- package/dist/constants/common.d.ts +0 -20
- package/dist/constants/enum.d.ts +0 -14
- package/dist/constants/flashloan.d.ts +0 -2
- package/dist/constants/index.d.ts +0 -13
- package/dist/constants/poolAddress.d.ts +0 -27
- package/dist/constants/pyth.d.ts +0 -5
- package/dist/constants/queryKeys.d.ts +0 -54
- package/dist/constants/rpc.d.ts +0 -1
- package/dist/constants/testAddress.d.ts +0 -2
- package/dist/constants/vesca.d.ts +0 -5
- package/dist/constants/xoracle.d.ts +0 -2
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/models/index.d.ts +0 -8
- package/dist/models/scallop.d.ts +0 -73
- package/dist/models/scallopAddress.d.ts +0 -150
- package/dist/models/scallopBuilder.d.ts +0 -90
- package/dist/models/scallopCache.d.ts +0 -81
- package/dist/models/scallopClient.d.ts +0 -321
- package/dist/models/scallopIndexer.d.ts +0 -90
- package/dist/models/scallopPrice.d.ts +0 -0
- package/dist/models/scallopQuery.d.ts +0 -704
- package/dist/models/scallopUtils.d.ts +0 -229
- package/dist/models/suiKit.d.ts +0 -2
- package/dist/queries/borrowIncentiveQuery.d.ts +0 -82
- package/dist/queries/borrowLimitQuery.d.ts +0 -9
- package/dist/queries/coreQuery.d.ts +0 -171
- package/dist/queries/index.d.ts +0 -15
- package/dist/queries/isolatedAssetQuery.d.ts +0 -14
- package/dist/queries/loyaltyProgramQuery.d.ts +0 -10
- package/dist/queries/objectsQuery.d.ts +0 -2
- package/dist/queries/poolAddressesQuery.d.ts +0 -29
- package/dist/queries/portfolioQuery.d.ts +0 -143
- package/dist/queries/priceQuery.d.ts +0 -58
- package/dist/queries/referralQuery.d.ts +0 -7
- package/dist/queries/sCoinQuery.d.ts +0 -41
- package/dist/queries/spoolQuery.d.ts +0 -74
- package/dist/queries/supplyLimitQuery.d.ts +0 -9
- package/dist/queries/vescaQuery.d.ts +0 -36
- package/dist/queries/xOracleQuery.d.ts +0 -13
- package/dist/types/address.d.ts +0 -108
- package/dist/types/builder/borrowIncentive.d.ts +0 -35
- package/dist/types/builder/core.d.ts +0 -56
- package/dist/types/builder/index.d.ts +0 -24
- package/dist/types/builder/loyaltyProgram.d.ts +0 -23
- package/dist/types/builder/referral.d.ts +0 -30
- package/dist/types/builder/sCoin.d.ts +0 -37
- package/dist/types/builder/spool.d.ts +0 -29
- package/dist/types/builder/vesca.d.ts +0 -51
- package/dist/types/constant/common.d.ts +0 -24
- package/dist/types/constant/enum.d.ts +0 -48
- package/dist/types/constant/index.d.ts +0 -3
- package/dist/types/constant/xOracle.d.ts +0 -9
- package/dist/types/index.d.ts +0 -6
- package/dist/types/model.d.ts +0 -60
- package/dist/types/query/borrowIncentive.d.ts +0 -124
- package/dist/types/query/core.d.ts +0 -380
- package/dist/types/query/index.d.ts +0 -7
- package/dist/types/query/loyaltyProgram.d.ts +0 -5
- package/dist/types/query/portfolio.d.ts +0 -119
- package/dist/types/query/sCoin.d.ts +0 -1
- package/dist/types/query/spool.d.ts +0 -142
- package/dist/types/query/vesca.d.ts +0 -26
- package/dist/types/utils.d.ts +0 -22
- package/dist/utils/builder.d.ts +0 -15
- package/dist/utils/core.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/indexer.d.ts +0 -17
- package/dist/utils/query.d.ts +0 -62
- package/dist/utils/util.d.ts +0 -27
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import { SuiKit } from '@scallop-io/sui-kit';
|
|
2
|
-
import { ScallopAddress } from './scallopAddress';
|
|
3
|
-
import { ScallopUtils } from './scallopUtils';
|
|
4
|
-
import { ScallopBuilder } from './scallopBuilder';
|
|
5
|
-
import { ScallopQuery } from './scallopQuery';
|
|
6
|
-
import type { SuiTransactionBlockResponse } from '@mysten/sui/client';
|
|
7
|
-
import type { TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
8
|
-
import { ScallopCache } from './scallopCache';
|
|
9
|
-
import type { SuiObjectArg } from '@scallop-io/sui-kit';
|
|
10
|
-
import type { ScallopClientFnReturnType, ScallopClientParams, SupportPoolCoins, SupportCollateralCoins, SupportAssetCoins, SupportStakeCoins, SupportStakeMarketCoins, ScallopTxBlock, ScallopClientVeScaReturnType, ScallopClientInstanceParams } from '../types';
|
|
11
|
-
/**
|
|
12
|
-
* @description
|
|
13
|
-
* It provides contract interaction operations for general users.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* const scallopClient = new ScallopClient(<parameters>);
|
|
18
|
-
* await scallopClient.init();
|
|
19
|
-
* scallopClient.<client functions>();
|
|
20
|
-
* await scallopClient.<client async functions>();
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare class ScallopClient {
|
|
24
|
-
readonly params: ScallopClientParams;
|
|
25
|
-
suiKit: SuiKit;
|
|
26
|
-
address: ScallopAddress;
|
|
27
|
-
builder: ScallopBuilder;
|
|
28
|
-
query: ScallopQuery;
|
|
29
|
-
utils: ScallopUtils;
|
|
30
|
-
cache: ScallopCache;
|
|
31
|
-
walletAddress: string;
|
|
32
|
-
constructor(params?: ScallopClientParams, instance?: ScallopClientInstanceParams);
|
|
33
|
-
/**
|
|
34
|
-
* Request the scallop API to initialize data.
|
|
35
|
-
*
|
|
36
|
-
* @param force - Whether to force initialization.
|
|
37
|
-
*/
|
|
38
|
-
init(force?: boolean): Promise<void>;
|
|
39
|
-
/**
|
|
40
|
-
* Query market data.
|
|
41
|
-
*
|
|
42
|
-
* @description
|
|
43
|
-
* This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
44
|
-
*
|
|
45
|
-
* @return Market data.
|
|
46
|
-
*/
|
|
47
|
-
queryMarket(): Promise<import("../types").Market>;
|
|
48
|
-
/**
|
|
49
|
-
* Get obligations data.
|
|
50
|
-
*
|
|
51
|
-
* @description
|
|
52
|
-
* This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
53
|
-
*
|
|
54
|
-
* @param ownerAddress - The owner address.
|
|
55
|
-
* @return Obligations data.
|
|
56
|
-
*/
|
|
57
|
-
getObligations(ownerAddress?: string): Promise<import("../types").Obligation[]>;
|
|
58
|
-
/**
|
|
59
|
-
* Query obligation data.
|
|
60
|
-
*
|
|
61
|
-
* @description
|
|
62
|
-
* This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
63
|
-
*
|
|
64
|
-
* @param obligationId - The obligation id.
|
|
65
|
-
* @return Obligation data.
|
|
66
|
-
*/
|
|
67
|
-
queryObligation(obligationId: string): Promise<import("../types").ObligationQueryInterface | undefined>;
|
|
68
|
-
/**
|
|
69
|
-
* Query all stake accounts data.
|
|
70
|
-
*
|
|
71
|
-
* @description
|
|
72
|
-
* This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
73
|
-
*
|
|
74
|
-
* @param ownerAddress - The owner address.
|
|
75
|
-
* @return All stake accounts data.
|
|
76
|
-
*/
|
|
77
|
-
getAllStakeAccounts(ownerAddress?: string): Promise<import("../types").StakeAccounts>;
|
|
78
|
-
/**
|
|
79
|
-
* Query stake account data.
|
|
80
|
-
*
|
|
81
|
-
* @description
|
|
82
|
-
* This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
83
|
-
*
|
|
84
|
-
* @param stakeMarketCoinName - Support stake market coin.
|
|
85
|
-
* @param ownerAddress - The owner address.
|
|
86
|
-
* @return Stake accounts data.
|
|
87
|
-
*/
|
|
88
|
-
getStakeAccounts(stakeMarketCoinName: SupportStakeMarketCoins, ownerAddress?: string): Promise<import("../types").StakeAccount[]>;
|
|
89
|
-
/**
|
|
90
|
-
* Query stake pool data.
|
|
91
|
-
*
|
|
92
|
-
* @description
|
|
93
|
-
* This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
94
|
-
*
|
|
95
|
-
* @param stakeMarketCoinName - Support stake market coin.
|
|
96
|
-
* @return Stake pool data.
|
|
97
|
-
*/
|
|
98
|
-
getStakePool(stakeMarketCoinName: SupportStakeMarketCoins): Promise<import("../types").StakePool | undefined>;
|
|
99
|
-
/**
|
|
100
|
-
* Query reward pool data.
|
|
101
|
-
*
|
|
102
|
-
* @description
|
|
103
|
-
* This method might be @deprecated in the future, please use the {@link ScallopQuery} query instance instead.
|
|
104
|
-
*
|
|
105
|
-
* @param stakeMarketCoinName - Support stake market coin.
|
|
106
|
-
* @return Reward pool data.
|
|
107
|
-
*/
|
|
108
|
-
getStakeRewardPool(stakeMarketCoinName: SupportStakeMarketCoins): Promise<import("../types").StakeRewardPool | undefined>;
|
|
109
|
-
/**
|
|
110
|
-
* Open obligation.
|
|
111
|
-
*
|
|
112
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
113
|
-
* @return Transaction block response or transaction block.
|
|
114
|
-
*/
|
|
115
|
-
openObligation(): Promise<SuiTransactionBlockResponse>;
|
|
116
|
-
openObligation<S extends boolean>(sign?: S): Promise<ScallopClientFnReturnType<S>>;
|
|
117
|
-
/**
|
|
118
|
-
* Deposit collateral into the specific pool.
|
|
119
|
-
*
|
|
120
|
-
* @param collateralCoinName - Types of collateral coin.
|
|
121
|
-
* @param amount - The amount of coins would deposit.
|
|
122
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
123
|
-
* @param obligationId - The obligation object.
|
|
124
|
-
* @param walletAddress - The wallet address of the owner.
|
|
125
|
-
* @return Transaction block response or transaction block.
|
|
126
|
-
*/
|
|
127
|
-
depositCollateral(collateralCoinName: SupportCollateralCoins, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
128
|
-
depositCollateral<S extends boolean>(collateralCoinName: SupportCollateralCoins, amount: number, sign?: S, obligationId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
129
|
-
/**
|
|
130
|
-
* Withdraw collateral from the specific pool.
|
|
131
|
-
*
|
|
132
|
-
* @param collateralCoinName - Types of collateral coin.
|
|
133
|
-
* @param amount - The amount of coins would deposit.
|
|
134
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
135
|
-
* @param obligationId - The obligation object.
|
|
136
|
-
* @param obligationKey - The obligation key object to verifying obligation authority.
|
|
137
|
-
* @param walletAddress - The wallet address of the owner.
|
|
138
|
-
* @return Transaction block response or transaction block.
|
|
139
|
-
*/
|
|
140
|
-
withdrawCollateral<S extends boolean>(collateralCoinName: SupportCollateralCoins, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
141
|
-
/**
|
|
142
|
-
* Deposit asset into the specific pool.
|
|
143
|
-
*
|
|
144
|
-
* @param poolCoinName - Types of pool coin.
|
|
145
|
-
* @param amount - The amount of coins would deposit.
|
|
146
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
147
|
-
* @param walletAddress - The wallet address of the owner.
|
|
148
|
-
* @return Transaction block response or transaction block.
|
|
149
|
-
*/
|
|
150
|
-
deposit(poolCoinName: SupportPoolCoins, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
151
|
-
deposit<S extends boolean>(poolCoinName: SupportPoolCoins, amount: number, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
152
|
-
/**
|
|
153
|
-
* Deposit asset into the specific pool and Stake market coin into the corresponding spool.
|
|
154
|
-
*
|
|
155
|
-
* @param stakeCoinName - Types of stake coin.
|
|
156
|
-
* @param amount - The amount of coins would deposit.
|
|
157
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
158
|
-
* @param stakeAccountId - The stake account object.
|
|
159
|
-
* @param walletAddress - The wallet address of the owner.
|
|
160
|
-
* @return Transaction block response or transaction block.
|
|
161
|
-
*/
|
|
162
|
-
depositAndStake(stakeCoinName: SupportStakeCoins, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
163
|
-
depositAndStake<S extends boolean>(stakeCoinName: SupportStakeCoins, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
164
|
-
/**
|
|
165
|
-
* Withdraw asset from the specific pool, must return market coin.
|
|
166
|
-
*
|
|
167
|
-
* @param poolCoinName - Specific support pool coin name.
|
|
168
|
-
* @param amount - The amount of coins would withdraw.
|
|
169
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
170
|
-
* @param walletAddress - The wallet address of the owner.
|
|
171
|
-
* @return Transaction block response or transaction block.
|
|
172
|
-
*/
|
|
173
|
-
withdraw(poolCoinName: SupportPoolCoins, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
174
|
-
withdraw<S extends boolean>(poolCoinName: SupportPoolCoins, amount: number, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
175
|
-
/**
|
|
176
|
-
* Borrow asset from the specific pool.
|
|
177
|
-
*
|
|
178
|
-
* @param poolCoinName - Specific support pool coin name.
|
|
179
|
-
* @param amount - The amount of coins would borrow.
|
|
180
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
181
|
-
* @param obligationId - The obligation object.
|
|
182
|
-
* @param obligationKey - The obligation key object to verifying obligation authority.
|
|
183
|
-
* @param walletAddress - The wallet address of the owner.
|
|
184
|
-
* @return Transaction block response or transaction block.
|
|
185
|
-
*/
|
|
186
|
-
borrow<S extends boolean>(poolCoinName: SupportPoolCoins, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
187
|
-
/**
|
|
188
|
-
* Repay asset into the specific pool.
|
|
189
|
-
*
|
|
190
|
-
* @param poolCoinName - Specific support pool coin name.
|
|
191
|
-
* @param amount - The amount of coins would repay.
|
|
192
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
193
|
-
* @param obligationId - The obligation object.
|
|
194
|
-
* @param walletAddress - The wallet address of the owner.
|
|
195
|
-
* @return Transaction block response or transaction block.
|
|
196
|
-
*/
|
|
197
|
-
repay<S extends boolean>(poolCoinName: SupportPoolCoins, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
198
|
-
/**
|
|
199
|
-
* FlashLoan asset from the specific pool.
|
|
200
|
-
*
|
|
201
|
-
* @param poolCoinName - Specific support pool coin name..
|
|
202
|
-
* @param amount - The amount of coins would repay.
|
|
203
|
-
* @param callback - The callback function to build transaction block and return coin argument.
|
|
204
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
205
|
-
* @return Transaction block response or transaction block.
|
|
206
|
-
*/
|
|
207
|
-
flashLoan(poolCoinName: SupportPoolCoins, amount: number, callback: (txBlock: ScallopTxBlock, coin: TransactionObjectArgument | string) => SuiObjectArg): Promise<SuiTransactionBlockResponse>;
|
|
208
|
-
flashLoan<S extends boolean>(poolCoinName: SupportPoolCoins, amount: number, callback: (txBlock: ScallopTxBlock, coin: TransactionObjectArgument | string) => SuiObjectArg, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
209
|
-
/**
|
|
210
|
-
* Create stake account.
|
|
211
|
-
*
|
|
212
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
213
|
-
* @param walletAddress - The wallet address of the owner.
|
|
214
|
-
* @return Transaction block response or transaction block.
|
|
215
|
-
*/
|
|
216
|
-
createStakeAccount(marketCoinName: SupportStakeMarketCoins): Promise<SuiTransactionBlockResponse>;
|
|
217
|
-
createStakeAccount<S extends boolean>(marketCoinName: SupportStakeMarketCoins, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
218
|
-
/**
|
|
219
|
-
* Stake market coin into the specific spool.
|
|
220
|
-
*
|
|
221
|
-
* @param marketCoinName - Types of market coin.
|
|
222
|
-
* @param amount - The amount of coins would deposit.
|
|
223
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
224
|
-
* @param stakeAccountId - The stake account object.
|
|
225
|
-
* @param walletAddress - The wallet address of the owner.
|
|
226
|
-
* @return Transaction block response or transaction block.
|
|
227
|
-
*/
|
|
228
|
-
stake(stakeMarketCoinName: SupportStakeMarketCoins, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
229
|
-
stake<S extends boolean>(stakeMarketCoinName: SupportStakeMarketCoins, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
230
|
-
/**
|
|
231
|
-
* Unstake market coin from the specific spool.
|
|
232
|
-
*
|
|
233
|
-
* @param stakeMarketCoinName - Types of mak coin.
|
|
234
|
-
* @param amount - The amount of coins would deposit.
|
|
235
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
236
|
-
* @param accountId - The stake account object.
|
|
237
|
-
* @param walletAddress - The wallet address of the owner.
|
|
238
|
-
* @return Transaction block response or transaction block.
|
|
239
|
-
*/
|
|
240
|
-
unstake(stakeMarketCoinName: SupportStakeMarketCoins, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
241
|
-
unstake<S extends boolean>(stakeMarketCoinName: SupportStakeMarketCoins, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
242
|
-
/**
|
|
243
|
-
* Unstake market coin from the specific spool and withdraw asset from the corresponding pool.
|
|
244
|
-
*
|
|
245
|
-
* @param marketCoinName - Types of mak coin.
|
|
246
|
-
* @param amount - The amount of coins would deposit.
|
|
247
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
248
|
-
* @param accountId - The stake account object.
|
|
249
|
-
* @param walletAddress - The wallet address of the owner.
|
|
250
|
-
* @return Transaction block response or transaction block.
|
|
251
|
-
*/
|
|
252
|
-
unstakeAndWithdraw(stakeMarketCoinName: SupportStakeMarketCoins, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
253
|
-
unstakeAndWithdraw<S extends boolean>(stakeMarketCoinName: SupportStakeMarketCoins, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
254
|
-
/**
|
|
255
|
-
* Claim reward coin from the specific spool.
|
|
256
|
-
*
|
|
257
|
-
* @param stakeMarketCoinName - Types of mak coin.
|
|
258
|
-
* @param amount - The amount of coins would deposit.
|
|
259
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
260
|
-
* @param accountId - The stake account object.
|
|
261
|
-
* @param walletAddress - The wallet address of the owner.
|
|
262
|
-
* @return Transaction block response or transaction block.
|
|
263
|
-
*/
|
|
264
|
-
claim(stakeMarketCoinName: SupportStakeMarketCoins): Promise<SuiTransactionBlockResponse>;
|
|
265
|
-
claim<S extends boolean>(stakeMarketCoinName: SupportStakeMarketCoins, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
266
|
-
/**
|
|
267
|
-
* stake obligaion.
|
|
268
|
-
*
|
|
269
|
-
* @param obligationId - The obligation account object.
|
|
270
|
-
* @param obligationKeyId - The obligation key account object.
|
|
271
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
272
|
-
* @param walletAddress - The wallet address of the owner.
|
|
273
|
-
* @return Transaction block response or transaction block
|
|
274
|
-
*/
|
|
275
|
-
stakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
276
|
-
/**
|
|
277
|
-
* unstake obligaion.
|
|
278
|
-
*
|
|
279
|
-
* @param obligationId - The obligation account object.
|
|
280
|
-
* @param obligationKeyId - The obligation key account object.
|
|
281
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
282
|
-
* @param walletAddress - The wallet address of the owner.
|
|
283
|
-
* @return Transaction block response or transaction block
|
|
284
|
-
*/
|
|
285
|
-
unstakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
286
|
-
/**
|
|
287
|
-
* Claim borrow incentive reward.
|
|
288
|
-
*
|
|
289
|
-
* @param poolName
|
|
290
|
-
* @param amount - The amount of coins would deposit.
|
|
291
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
292
|
-
* @param accountId - The stake account object.
|
|
293
|
-
* @param walletAddress - The wallet address of the owner.
|
|
294
|
-
* @return Transaction block response or transaction block
|
|
295
|
-
*/
|
|
296
|
-
claimBorrowIncentive<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
297
|
-
/**
|
|
298
|
-
* Function to migrate all market coin in user wallet into sCoin
|
|
299
|
-
* @returns Transaction response
|
|
300
|
-
*/
|
|
301
|
-
migrateAllMarketCoin<S extends boolean>(includeStakePool?: boolean, sign?: S): Promise<ScallopClientFnReturnType<S>>;
|
|
302
|
-
/**
|
|
303
|
-
* Claim unlocked SCA from all veSCA accounts.
|
|
304
|
-
*/
|
|
305
|
-
claimAllUnlockedSca(): Promise<SuiTransactionBlockResponse>;
|
|
306
|
-
claimAllUnlockedSca<S extends boolean>(sign?: S): Promise<ScallopClientVeScaReturnType<S>>;
|
|
307
|
-
/**
|
|
308
|
-
* Mint and get test coin.
|
|
309
|
-
*
|
|
310
|
-
* @remarks
|
|
311
|
-
* Only be used on the test network.
|
|
312
|
-
*
|
|
313
|
-
* @param assetCoinName - Specific asset coin name.
|
|
314
|
-
* @param amount - The amount of coins minted and received.
|
|
315
|
-
* @param receiveAddress - The wallet address that receives the coins.
|
|
316
|
-
* @param sign - Decide to directly sign the transaction or return the transaction block.
|
|
317
|
-
* @return Transaction block response or transaction block.
|
|
318
|
-
*/
|
|
319
|
-
mintTestCoin(assetCoinName: Exclude<SupportAssetCoins, 'sui'>, amount: number): Promise<SuiTransactionBlockResponse>;
|
|
320
|
-
mintTestCoin<S extends boolean>(assetCoinName: Exclude<SupportAssetCoins, 'sui'>, amount: number, sign?: S, receiveAddress?: string): Promise<ScallopClientFnReturnType<S>>;
|
|
321
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { Market, MarketPools, MarketPool, MarketCollaterals, MarketCollateral, Spools, Spool, BorrowIncentivePools, BorrowIncentivePool, SupportPoolCoins, SupportCollateralCoins, SupportStakeMarketCoins, SupportBorrowIncentiveCoins, TotalValueLocked, ScallopQueryParams, ScallopParams, ScallopIndexerInstanceParams } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* @description
|
|
4
|
-
* It provides methods to obtain sdk index data from mainnet.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* const scallopIndexer = new scallopIndexer(<parameters>);
|
|
10
|
-
* scallopIndexer.<indexer functions>();
|
|
11
|
-
* await scallopIndexer.<indexer async functions>();
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export declare class ScallopIndexer {
|
|
15
|
-
private readonly cache;
|
|
16
|
-
readonly params: ScallopQueryParams;
|
|
17
|
-
private readonly _requestClient;
|
|
18
|
-
constructor(params?: ScallopParams, instance?: ScallopIndexerInstanceParams);
|
|
19
|
-
/**
|
|
20
|
-
* Get market index data.
|
|
21
|
-
*
|
|
22
|
-
* @return Market data.
|
|
23
|
-
*/
|
|
24
|
-
getMarket(): Promise<Pick<Market, 'pools' | 'collaterals'>>;
|
|
25
|
-
/**
|
|
26
|
-
* Get market pools index data.
|
|
27
|
-
*
|
|
28
|
-
* @return Market pools data.
|
|
29
|
-
*/
|
|
30
|
-
getMarketPools(): Promise<Required<MarketPools>>;
|
|
31
|
-
/**
|
|
32
|
-
* Get market pool index data.
|
|
33
|
-
*
|
|
34
|
-
* @return Market pool data.
|
|
35
|
-
*/
|
|
36
|
-
getMarketPool(poolCoinName: SupportPoolCoins): Promise<MarketPool>;
|
|
37
|
-
/**
|
|
38
|
-
* Get market collaterals index data.
|
|
39
|
-
*
|
|
40
|
-
* @return Market collaterals data.
|
|
41
|
-
*/
|
|
42
|
-
getMarketCollaterals(): Promise<Required<MarketCollaterals>>;
|
|
43
|
-
/**
|
|
44
|
-
* Get market collateral index data.
|
|
45
|
-
*
|
|
46
|
-
* @return Market collateral data.
|
|
47
|
-
*/
|
|
48
|
-
getMarketCollateral(collateralCoinName: SupportCollateralCoins): Promise<MarketCollateral>;
|
|
49
|
-
/**
|
|
50
|
-
* Get spools index data.
|
|
51
|
-
*
|
|
52
|
-
* @return Spools data.
|
|
53
|
-
*/
|
|
54
|
-
getSpools(): Promise<Required<Spools>>;
|
|
55
|
-
/**
|
|
56
|
-
* Get spool index data.
|
|
57
|
-
*
|
|
58
|
-
* @return Spool data.
|
|
59
|
-
*/
|
|
60
|
-
getSpool(marketCoinName: SupportStakeMarketCoins): Promise<Spool>;
|
|
61
|
-
/**
|
|
62
|
-
* Get borrow incentive pools index data.
|
|
63
|
-
*
|
|
64
|
-
* @return Borrow incentive pools data.
|
|
65
|
-
*/
|
|
66
|
-
getBorrowIncentivePools(): Promise<Required<BorrowIncentivePools>>;
|
|
67
|
-
/**
|
|
68
|
-
* Get borrow incentive pool index data.
|
|
69
|
-
*
|
|
70
|
-
* @return Borrow incentive pool data.
|
|
71
|
-
*/
|
|
72
|
-
getBorrowIncentivePool(borrowIncentiveCoinName: SupportBorrowIncentiveCoins): Promise<BorrowIncentivePool>;
|
|
73
|
-
/**
|
|
74
|
-
* Get total value locked index data.
|
|
75
|
-
*
|
|
76
|
-
* @return Total value locked.
|
|
77
|
-
*/
|
|
78
|
-
getTotalValueLocked(): Promise<TotalValueLocked & {
|
|
79
|
-
totalValueChangeRatio: number;
|
|
80
|
-
borrowValueChangeRatio: number;
|
|
81
|
-
supplyValueChangeRatio: number;
|
|
82
|
-
}>;
|
|
83
|
-
/**
|
|
84
|
-
* Get coin price index data.
|
|
85
|
-
*
|
|
86
|
-
* @return price data.
|
|
87
|
-
*/
|
|
88
|
-
getCoinPrice(poolCoinName: SupportPoolCoins): Promise<number>;
|
|
89
|
-
getCoinPrices(): Promise<Record<string, number>>;
|
|
90
|
-
}
|
|
File without changes
|