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