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