@scallop-io/sui-scallop-sdk 1.3.3 → 1.3.4-alpha.1
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/constants/coinGecko.d.ts +2 -0
- package/dist/constants/index.d.ts +7 -0
- package/dist/constants/poolAddress.d.ts +5 -0
- package/dist/constants/pyth.d.ts +2 -0
- package/dist/constants/queryKeys.d.ts +2 -1
- package/dist/index.js +1471 -1311
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1463 -1311
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopQuery.d.ts +4 -4
- package/dist/models/scallopUtils.d.ts +6 -1
- package/dist/queries/sCoinQuery.d.ts +1 -1
- package/dist/queries/spoolQuery.d.ts +1 -1
- package/dist/types/query/core.d.ts +1 -0
- package/dist/types/utils.d.ts +12 -0
- package/dist/utils/util.d.ts +2 -2
- package/package.json +1 -1
- package/src/constants/coinGecko.ts +18 -0
- package/src/constants/enum.ts +11 -4
- package/src/constants/index.ts +7 -0
- package/src/constants/poolAddress.ts +94 -0
- package/src/constants/pyth.ts +19 -0
- package/src/constants/queryKeys.ts +2 -2
- package/src/constants/testAddress.ts +76 -35
- package/src/models/scallopBuilder.ts +2 -3
- package/src/models/scallopQuery.ts +4 -3
- package/src/models/scallopUtils.ts +64 -29
- package/src/queries/coreQuery.ts +222 -216
- package/src/queries/isolatedAsset.ts +4 -4
- package/src/queries/portfolioQuery.ts +6 -9
- package/src/queries/referralQuery.ts +0 -1
- package/src/queries/spoolQuery.ts +1 -1
- package/src/types/query/core.ts +1 -0
- package/src/types/utils.ts +13 -0
- package/src/utils/util.ts +2 -1
- package/dist/models/scallopPrice.d.ts +0 -0
- package/src/models/scallopPrice.ts +0 -0
|
@@ -179,9 +179,9 @@ export declare class ScallopQuery {
|
|
|
179
179
|
getSpools(stakeMarketCoinNames?: SupportStakeMarketCoins[], indexer?: boolean): Promise<{
|
|
180
180
|
susdc?: import("../types").Spool | undefined;
|
|
181
181
|
sweth?: import("../types").Spool | undefined;
|
|
182
|
-
ssui?: import("../types").Spool | undefined;
|
|
183
182
|
swusdc?: import("../types").Spool | undefined;
|
|
184
183
|
swusdt?: import("../types").Spool | undefined;
|
|
184
|
+
ssui?: import("../types").Spool | undefined;
|
|
185
185
|
scetus?: import("../types").Spool | undefined;
|
|
186
186
|
safsui?: import("../types").Spool | undefined;
|
|
187
187
|
shasui?: import("../types").Spool | undefined;
|
|
@@ -223,9 +223,9 @@ export declare class ScallopQuery {
|
|
|
223
223
|
getStakePools(stakeMarketCoinNames?: SupportStakeMarketCoins[]): Promise<{
|
|
224
224
|
susdc?: import("../types").StakePool | undefined;
|
|
225
225
|
sweth?: import("../types").StakePool | undefined;
|
|
226
|
-
ssui?: import("../types").StakePool | undefined;
|
|
227
226
|
swusdc?: import("../types").StakePool | undefined;
|
|
228
227
|
swusdt?: import("../types").StakePool | undefined;
|
|
228
|
+
ssui?: import("../types").StakePool | undefined;
|
|
229
229
|
scetus?: import("../types").StakePool | undefined;
|
|
230
230
|
safsui?: import("../types").StakePool | undefined;
|
|
231
231
|
shasui?: import("../types").StakePool | undefined;
|
|
@@ -255,9 +255,9 @@ export declare class ScallopQuery {
|
|
|
255
255
|
getStakeRewardPools(stakeMarketCoinNames?: SupportStakeMarketCoins[]): Promise<{
|
|
256
256
|
susdc?: import("../types").StakeRewardPool | undefined;
|
|
257
257
|
sweth?: import("../types").StakeRewardPool | undefined;
|
|
258
|
-
ssui?: import("../types").StakeRewardPool | undefined;
|
|
259
258
|
swusdc?: import("../types").StakeRewardPool | undefined;
|
|
260
259
|
swusdt?: import("../types").StakeRewardPool | undefined;
|
|
260
|
+
ssui?: import("../types").StakeRewardPool | undefined;
|
|
261
261
|
scetus?: import("../types").StakeRewardPool | undefined;
|
|
262
262
|
safsui?: import("../types").StakeRewardPool | undefined;
|
|
263
263
|
shasui?: import("../types").StakeRewardPool | undefined;
|
|
@@ -437,7 +437,7 @@ export declare class ScallopQuery {
|
|
|
437
437
|
* @param ownerAddress - The owner address.
|
|
438
438
|
* @return All market sCoin amounts.
|
|
439
439
|
*/
|
|
440
|
-
getSCoinAmounts(sCoinNames?: SupportSCoin[], ownerAddress?: string): Promise<import("../types").OptionalKeys<Record<"susdc" | "
|
|
440
|
+
getSCoinAmounts(sCoinNames?: SupportSCoin[], ownerAddress?: string): Promise<import("../types").OptionalKeys<Record<"susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca", number>>>;
|
|
441
441
|
/**
|
|
442
442
|
* Get sCoin amount.
|
|
443
443
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SuiKit } from '@scallop-io/sui-kit';
|
|
2
2
|
import { ScallopAddress } from './scallopAddress';
|
|
3
3
|
import { ScallopCache } from './scallopCache';
|
|
4
|
-
import type { ScallopUtilsParams, SupportCoins, SupportAssetCoins, SupportMarketCoins, SupportStakeMarketCoins, SupportBorrowIncentiveCoins, CoinWrappedType, SupportSCoin, ScallopUtilsInstanceParams, SupportSuiBridgeCoins, SupportWormholeCoins } from '../types';
|
|
4
|
+
import type { ScallopUtilsParams, SupportCoins, SupportAssetCoins, SupportMarketCoins, SupportStakeMarketCoins, SupportBorrowIncentiveCoins, CoinWrappedType, SupportSCoin, ScallopUtilsInstanceParams, SupportSuiBridgeCoins, SupportWormholeCoins, PoolAddressInfo } from '../types';
|
|
5
5
|
import type { SuiObjectArg, SuiTxArg, SuiTxBlock } from '@scallop-io/sui-kit';
|
|
6
6
|
/**
|
|
7
7
|
* @description
|
|
@@ -214,4 +214,9 @@ export declare class ScallopUtils {
|
|
|
214
214
|
* @return New unlock at in seconds timestamp.
|
|
215
215
|
*/
|
|
216
216
|
getUnlockAt(extendLockPeriodInDay?: number, unlockAtInMillisTimestamp?: number): number;
|
|
217
|
+
/**
|
|
218
|
+
* Get detailed contract address and price id information for supported pool in Scallop
|
|
219
|
+
* @returns Supported pool informations
|
|
220
|
+
*/
|
|
221
|
+
getSupportedPoolAddresses(): PoolAddressInfo[];
|
|
217
222
|
}
|
|
@@ -19,7 +19,7 @@ export declare const getSCoinTotalSupply: ({ utils, }: {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const getSCoinAmounts: ({ utils, }: {
|
|
21
21
|
utils: ScallopUtils;
|
|
22
|
-
}, sCoinNames?: SupportSCoin[], ownerAddress?: string) => Promise<OptionalKeys<Record<"susdc" | "
|
|
22
|
+
}, sCoinNames?: SupportSCoin[], ownerAddress?: string) => Promise<OptionalKeys<Record<"susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca", number>>>;
|
|
23
23
|
/**
|
|
24
24
|
* Query owned sCoin amount.
|
|
25
25
|
*
|
|
@@ -11,9 +11,9 @@ import type { MarketPool, Spool, StakePool, StakeRewardPool, StakeAccounts, Supp
|
|
|
11
11
|
export declare const getSpools: (query: ScallopQuery, stakeMarketCoinNames?: SupportStakeMarketCoins[], indexer?: boolean) => Promise<{
|
|
12
12
|
susdc?: Spool | undefined;
|
|
13
13
|
sweth?: Spool | undefined;
|
|
14
|
-
ssui?: Spool | undefined;
|
|
15
14
|
swusdc?: Spool | undefined;
|
|
16
15
|
swusdt?: Spool | undefined;
|
|
16
|
+
ssui?: Spool | undefined;
|
|
17
17
|
scetus?: Spool | undefined;
|
|
18
18
|
safsui?: Spool | undefined;
|
|
19
19
|
shasui?: Spool | undefined;
|
|
@@ -133,6 +133,7 @@ export type MarketCollateral = {
|
|
|
133
133
|
coinWrappedType: CoinWrappedType;
|
|
134
134
|
coinDecimal: number;
|
|
135
135
|
coinPrice: number;
|
|
136
|
+
isIsolated: boolean;
|
|
136
137
|
} & Required<Pick<ParsedMarketCollateralData, 'collateralFactor' | 'liquidationFactor' | 'liquidationDiscount' | 'liquidationPanelty' | 'liquidationReserveFactor'>> & CalculatedMarketCollateralData;
|
|
137
138
|
export type OriginMarketPoolData = {
|
|
138
139
|
type: {
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -7,3 +7,15 @@ export type PriceMap = Map<SupportAssetCoins, {
|
|
|
7
7
|
price: number;
|
|
8
8
|
publishTime: number;
|
|
9
9
|
}>;
|
|
10
|
+
export type PoolAddressInfo = {
|
|
11
|
+
name: string;
|
|
12
|
+
coingeckoId: string;
|
|
13
|
+
decimal: number;
|
|
14
|
+
pythFeedId: string;
|
|
15
|
+
lendingPoolAddress: string;
|
|
16
|
+
collateralPoolAddress: string;
|
|
17
|
+
sCoinAddress: string | undefined;
|
|
18
|
+
marketCoinAddress: string;
|
|
19
|
+
coinAddress: string;
|
|
20
|
+
sCoinName: string | undefined;
|
|
21
|
+
};
|
package/dist/utils/util.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PriceFeed } from '@pythnetwork/pyth-sui-js';
|
|
2
2
|
import type { ScallopAddress } from '../models';
|
|
3
|
-
import type { SupportAssetCoins, SupportCoins, SupportMarketCoins, SupportSuiBridgeCoins, SupportWormholeCoins } from '../types';
|
|
4
|
-
export declare const isMarketCoin: (coinName: SupportCoins) => coinName is SupportMarketCoins;
|
|
3
|
+
import type { SupportAssetCoins, SupportCoins, SupportMarketCoins, SupportSCoin, SupportSuiBridgeCoins, SupportWormholeCoins } from '../types';
|
|
4
|
+
export declare const isMarketCoin: (coinName: SupportCoins) => coinName is SupportMarketCoins | SupportSCoin;
|
|
5
5
|
export declare const isSuiBridgeAsset: (coinName: any) => coinName is SupportSuiBridgeCoins;
|
|
6
6
|
export declare const isWormholeAsset: (coinName: any) => coinName is SupportWormholeCoins;
|
|
7
7
|
export declare const parseAssetSymbol: (coinName: SupportCoins) => string;
|
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SupportPoolCoins } from 'src/types/constant/common';
|
|
2
|
+
|
|
3
|
+
export const COIN_GECKGO_IDS: Record<SupportPoolCoins, string> = {
|
|
4
|
+
usdc: 'usdc-coin',
|
|
5
|
+
sbeth: 'ethereum',
|
|
6
|
+
weth: 'ethereum',
|
|
7
|
+
wbtc: 'bitcoin',
|
|
8
|
+
wusdc: 'usdc-coin',
|
|
9
|
+
wusdt: 'tether',
|
|
10
|
+
sui: 'sui',
|
|
11
|
+
wapt: 'aptos',
|
|
12
|
+
wsol: 'solana',
|
|
13
|
+
cetus: 'cetus-protocol',
|
|
14
|
+
afsui: 'sui',
|
|
15
|
+
hasui: 'sui',
|
|
16
|
+
vsui: 'sui',
|
|
17
|
+
sca: 'scallop-2',
|
|
18
|
+
};
|
package/src/constants/enum.ts
CHANGED
|
@@ -161,14 +161,21 @@ export const sCoinIds: types.SCoinIds = {
|
|
|
161
161
|
'0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC',
|
|
162
162
|
ssbeth:
|
|
163
163
|
'0xb14f82d8506d139eacef109688d1b71e7236bcce9b2c0ad526abcd6aa5be7de0::scallop_sb_eth::SCALLOP_SB_ETH',
|
|
164
|
-
|
|
164
|
+
// TODO: Change this to the correct value on production release
|
|
165
|
+
ssui: '0xf569919046f19a0c40b519ecfbb6ca0319698cd5908716c29b62ef56541f298b::scallop_sui::SCALLOP_SUI',
|
|
166
|
+
// ssui: '0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI',
|
|
165
167
|
scetus:
|
|
166
168
|
'0xea346ce428f91ab007210443efcea5f5cdbbb3aae7e9affc0ca93f9203c31f0c::scallop_cetus::SCALLOP_CETUS',
|
|
167
|
-
|
|
169
|
+
// TODO: Change this to the correct value on production release
|
|
170
|
+
ssca: '0x958428555e778e55918a59eb1c92c77f32b5c554fa3a5e56cd0815086b5072e7::scallop_sca::SCALLOP_SCA',
|
|
171
|
+
// '0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA',
|
|
172
|
+
// TODO: Change this to the correct value on production release
|
|
168
173
|
swusdc:
|
|
169
|
-
'
|
|
174
|
+
'0xf5447c4305a486d8c8557559887c2c39449ddb5e748f15d33946d02a1663c158::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
175
|
+
// '0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
170
176
|
swusdt:
|
|
171
|
-
'0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
177
|
+
// '0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
178
|
+
'0xac781d9f73058ff5e69f9bf8dde32f2e8c71c66d7fe8497fc83b2d9182254b22::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
172
179
|
sweth:
|
|
173
180
|
'0x67540ceb850d418679e69f1fb6b2093d6df78a2a699ffc733f7646096d552e9b::scallop_wormhole_eth::SCALLOP_WORMHOLE_ETH',
|
|
174
181
|
safsui:
|
package/src/constants/index.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
export * from './cache';
|
|
2
|
+
export * from './coinGecko';
|
|
1
3
|
export * from './common';
|
|
2
4
|
export * from './enum';
|
|
3
5
|
export * from './flashloan';
|
|
6
|
+
export * from './poolAddress';
|
|
7
|
+
export * from './pyth';
|
|
4
8
|
export * from './queryKeys';
|
|
9
|
+
export * from './testAddress';
|
|
10
|
+
export * from './tokenBucket';
|
|
5
11
|
export * from './vesca';
|
|
12
|
+
export * from './testAddress';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { SupportPoolCoins } from 'src/types';
|
|
2
|
+
|
|
3
|
+
export const POOL_ADDRESSES: Record<
|
|
4
|
+
SupportPoolCoins,
|
|
5
|
+
{
|
|
6
|
+
lendingPoolAddress: string;
|
|
7
|
+
collateralPoolAddress: string;
|
|
8
|
+
}
|
|
9
|
+
> = {
|
|
10
|
+
usdc: {
|
|
11
|
+
lendingPoolAddress:
|
|
12
|
+
'0xd3be98bf540f7603eeb550c0c0a19dbfc78822f25158b5fa84ebd9609def415f',
|
|
13
|
+
collateralPoolAddress:
|
|
14
|
+
'0x8f0d529ba179c5b3d508213003eab813aaae31f78226099639b9a69d1aec17af',
|
|
15
|
+
},
|
|
16
|
+
sbeth: {
|
|
17
|
+
lendingPoolAddress:
|
|
18
|
+
'0x5f08c4f71d56dd3342c452cc70ffc47f2f4180146d821941b0b9c04761bb42e7',
|
|
19
|
+
collateralPoolAddress:
|
|
20
|
+
'0xce0549a1cbe952e734f56646988e6b02bbae14667889a60e24d0d03540a6119f',
|
|
21
|
+
},
|
|
22
|
+
weth: {
|
|
23
|
+
lendingPoolAddress:
|
|
24
|
+
'0xc8fcdff48efc265740ae0b74aae3faccae9ec00034039a113f3339798035108c',
|
|
25
|
+
collateralPoolAddress:
|
|
26
|
+
'0xad7ced91ed6e7f2b81805561eee27fa6f3e72fdae561077334c7248583db4dbf',
|
|
27
|
+
},
|
|
28
|
+
wbtc: {
|
|
29
|
+
lendingPoolAddress:
|
|
30
|
+
'0x65cc08a5aca0a0b8d72e1993ded8d145f06dd102fd0d8f285b92934faed564ab',
|
|
31
|
+
collateralPoolAddress:
|
|
32
|
+
'0x1aa4e5cf743cd797b4eb8bf1e614f80ae2cf556ced426cddaaf190ffcd0e59c3',
|
|
33
|
+
},
|
|
34
|
+
wusdc: {
|
|
35
|
+
lendingPoolAddress:
|
|
36
|
+
'0x9c9077abf7a29eebce41e33addbcd6f5246a5221dd733e56ea0f00ae1b25c9e8',
|
|
37
|
+
collateralPoolAddress:
|
|
38
|
+
'0x75aacfb7dcbf92ee0111fc1bf975b12569e4ba632e81ed7ae5ac090d40cd3acb',
|
|
39
|
+
},
|
|
40
|
+
wusdt: {
|
|
41
|
+
lendingPoolAddress:
|
|
42
|
+
'0xfbc056f126dd35adc1f8fe985e2cedc8010e687e8e851e1c5b99fdf63cd1c879',
|
|
43
|
+
collateralPoolAddress:
|
|
44
|
+
'0x2260cb5b24929dd20a1742f37a61ff3ce4fde5cdb023e2d3ce2e0ce2d90719e3',
|
|
45
|
+
},
|
|
46
|
+
sui: {
|
|
47
|
+
lendingPoolAddress:
|
|
48
|
+
'0x9c9077abf7a29eebce41e33addbcd6f5246a5221dd733e56ea0f00ae1b25c9e8',
|
|
49
|
+
collateralPoolAddress:
|
|
50
|
+
'0x75aacfb7dcbf92ee0111fc1bf975b12569e4ba632e81ed7ae5ac090d40cd3acb',
|
|
51
|
+
},
|
|
52
|
+
wapt: {
|
|
53
|
+
lendingPoolAddress:
|
|
54
|
+
'0xca8c14a24e0c32b198eaf479a3317461e3cc339097ce88eaf296a15df8dcfdf5',
|
|
55
|
+
collateralPoolAddress:
|
|
56
|
+
'0xde33f9ac5bb0ed34598da4e64b4983832716ced65f172fbf267bcfe859c4ad9c',
|
|
57
|
+
},
|
|
58
|
+
wsol: {
|
|
59
|
+
lendingPoolAddress:
|
|
60
|
+
'0x985682c42984cdfb03f9ff7d8923344c2fe096b1ae4b82ea17721af19d22a21f',
|
|
61
|
+
collateralPoolAddress:
|
|
62
|
+
'0xdc1cc2c371a043ae8e3c3fe2d013c35f1346960b7dbb4c072982c5b794ed144f',
|
|
63
|
+
},
|
|
64
|
+
cetus: {
|
|
65
|
+
lendingPoolAddress:
|
|
66
|
+
'0xc09858f60e74a1b671635bec4e8a2c84a0ff313eb87f525fba3258e88c6b6282',
|
|
67
|
+
collateralPoolAddress:
|
|
68
|
+
'0xe363967e29b7b9c1245d6d46d63e719de8f90b37e3358c545b55d945ea0b676a',
|
|
69
|
+
},
|
|
70
|
+
afsui: {
|
|
71
|
+
lendingPoolAddress:
|
|
72
|
+
'0x9b942a24ce390b7f5016d34a0217057bf9487b92aa6d7cc9894271dbbe62471a',
|
|
73
|
+
collateralPoolAddress:
|
|
74
|
+
'0xe5e56f5c0e3072760b21f9d49a5cc793f37d736c412a9065c16e1265c74e6341',
|
|
75
|
+
},
|
|
76
|
+
hasui: {
|
|
77
|
+
lendingPoolAddress:
|
|
78
|
+
'0x7ebc607f6bdeb659fb6506cb91c5cc1d47bb365cfd5d2e637ea765346ec84ed4',
|
|
79
|
+
collateralPoolAddress:
|
|
80
|
+
'0xad9ed40d6486e4c26cec7370dffce8dc4821eb79178250b5938a34ccafd61e6d',
|
|
81
|
+
},
|
|
82
|
+
vsui: {
|
|
83
|
+
lendingPoolAddress:
|
|
84
|
+
'0xda9257c0731d8822e8a438ebced13415850d705b779c79958dcf2aeb21fcb43d',
|
|
85
|
+
collateralPoolAddress:
|
|
86
|
+
'0x4435e8b8ec2a04094d863aa52deb6ab6f8f47ed8778f4d9f1b27afc4a6e85f1e',
|
|
87
|
+
},
|
|
88
|
+
sca: {
|
|
89
|
+
lendingPoolAddress:
|
|
90
|
+
'0x6fc7d4211fc7018b6c75e7b908b88f2e0536443239804a3d32af547637bd28d7',
|
|
91
|
+
collateralPoolAddress:
|
|
92
|
+
'0xff677a5d9e9dc8f08f0a8681ebfc7481d1c7d57bc441f2881974adcdd7b13c31',
|
|
93
|
+
},
|
|
94
|
+
};
|
package/src/constants/pyth.ts
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
import { SupportPoolCoins } from 'src/types';
|
|
2
|
+
|
|
1
3
|
export const PYTH_ENDPOINTS: {
|
|
2
4
|
[k in 'mainnet' | 'testnet']: string[];
|
|
3
5
|
} = {
|
|
4
6
|
testnet: ['https://hermes-beta.pyth.network'],
|
|
5
7
|
mainnet: ['https://hermes.pyth.network', 'https://scallop.rpc.p2p.world'],
|
|
6
8
|
};
|
|
9
|
+
|
|
10
|
+
export const PYTH_FEED_IDS: Record<SupportPoolCoins, string> = {
|
|
11
|
+
usdc: 'eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
|
|
12
|
+
sbeth: 'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
|
|
13
|
+
weth: 'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
|
|
14
|
+
wbtc: 'e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
|
|
15
|
+
wusdc: 'eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
|
|
16
|
+
wusdt: '2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b',
|
|
17
|
+
sui: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
|
|
18
|
+
wapt: '03ae4db29ed4ae33d323568895aa00337e658e348b37509f5372ae51f0af00d5',
|
|
19
|
+
wsol: 'ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d',
|
|
20
|
+
cetus: 'e5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef',
|
|
21
|
+
afsui: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
|
|
22
|
+
hasui: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
|
|
23
|
+
vsui: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
|
|
24
|
+
sca: '7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc',
|
|
25
|
+
};
|
|
@@ -99,10 +99,10 @@ export const queryKeys = {
|
|
|
99
99
|
],
|
|
100
100
|
},
|
|
101
101
|
oracle: {
|
|
102
|
-
getPythLatestPriceFeed: (pythPriceId?: string) => [
|
|
102
|
+
getPythLatestPriceFeed: (pythPriceId?: string, endpoint?: string) => [
|
|
103
103
|
'oracle',
|
|
104
104
|
'getPythPriceId',
|
|
105
|
-
{ pythPriceId },
|
|
105
|
+
{ pythPriceId, endpoint },
|
|
106
106
|
],
|
|
107
107
|
},
|
|
108
108
|
};
|
|
@@ -5,17 +5,17 @@ export const TEST_ADDRESSES: AddressesInterface = {
|
|
|
5
5
|
// version:
|
|
6
6
|
// '0x07871c4b3c847a0f674510d4978d5cf6f960452795e8ff6f189fd2088a3f6ac7',
|
|
7
7
|
version:
|
|
8
|
-
'
|
|
8
|
+
'0xd318de9b0f6873879a82cbfcc2daa1d1591a8b54e7cea9f4b567da63c692a52b',
|
|
9
9
|
versionCap:
|
|
10
10
|
'0x590a4011cb649b3878f3ea14b3a78674642a9548d79b7e091ef679574b158a07',
|
|
11
11
|
// object:
|
|
12
12
|
// '0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf',
|
|
13
13
|
object:
|
|
14
|
-
'
|
|
14
|
+
'0x6c23585e940a989588432509107e98bae06dbca4e333f26d0635d401b3c7c76d',
|
|
15
15
|
// market:
|
|
16
16
|
// '0xa757975255146dc9686aa823b7838b507f315d704f428cbadad2f4ea061939d9',
|
|
17
17
|
market:
|
|
18
|
-
'
|
|
18
|
+
'0x9d6434e97f3f98fd9b0c0e1dca22632073985abcd22541feae7ee1e34cbe3af2',
|
|
19
19
|
adminCap:
|
|
20
20
|
'0x09689d018e71c337d9db6d67cbca06b74ed92196103624028ccc3ecea411777c',
|
|
21
21
|
coinDecimalsRegistry:
|
|
@@ -23,8 +23,23 @@ export const TEST_ADDRESSES: AddressesInterface = {
|
|
|
23
23
|
// obligationAccessStore:
|
|
24
24
|
// '0x733e30b7c94d619d78cb8f5bc4bfbb759ced9a531239028caabb2474e5be59c9',
|
|
25
25
|
obligationAccessStore:
|
|
26
|
-
'
|
|
26
|
+
'0x46e9b44a77ee9c9d33cc2689ecdfbb8f681935cbc6bdf6ac3df048e396c36c82',
|
|
27
27
|
coins: {
|
|
28
|
+
usdc: {
|
|
29
|
+
id: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7',
|
|
30
|
+
metaData:
|
|
31
|
+
'0x69b7a7c3c200439c1b5f3b19d7d495d5966d5f08de66c69276152f8db3992ec6',
|
|
32
|
+
treasury: '',
|
|
33
|
+
oracle: {
|
|
34
|
+
supra: '',
|
|
35
|
+
switchboard: '',
|
|
36
|
+
pyth: {
|
|
37
|
+
feed: 'eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
|
|
38
|
+
feedObject:
|
|
39
|
+
'0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
28
43
|
cetus: {
|
|
29
44
|
id: '0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b',
|
|
30
45
|
metaData:
|
|
@@ -206,6 +221,21 @@ export const TEST_ADDRESSES: AddressesInterface = {
|
|
|
206
221
|
},
|
|
207
222
|
},
|
|
208
223
|
},
|
|
224
|
+
sbeth: {
|
|
225
|
+
id: '0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29',
|
|
226
|
+
metaData:
|
|
227
|
+
'0x89b04ba87f8832d4d76e17a1c9dce72eb3e64d372cf02012b8d2de5384faeef0',
|
|
228
|
+
treasury: '',
|
|
229
|
+
oracle: {
|
|
230
|
+
supra: '',
|
|
231
|
+
switchboard: '',
|
|
232
|
+
pyth: {
|
|
233
|
+
feed: 'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
|
|
234
|
+
feedObject:
|
|
235
|
+
'0x9193fd47f9a0ab99b6e365a464c8a9ae30e6150fc37ed2a89c1586631f6fc4ab',
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
},
|
|
209
239
|
},
|
|
210
240
|
oracles: {
|
|
211
241
|
xOracle:
|
|
@@ -249,7 +279,7 @@ export const TEST_ADDRESSES: AddressesInterface = {
|
|
|
249
279
|
'0x3f203f6fff6a69d151e4f1cd931f22b68c489ef2759765662fc7baf673943c9e',
|
|
250
280
|
},
|
|
251
281
|
protocol: {
|
|
252
|
-
id: '
|
|
282
|
+
id: '0x6c23585e940a989588432509107e98bae06dbca4e333f26d0635d401b3c7c76d',
|
|
253
283
|
upgradeCap:
|
|
254
284
|
'0x38527d154618d1fd5a644b90717fe07cf0e9f26b46b63e9568e611a3f86d5c1a',
|
|
255
285
|
},
|
|
@@ -269,7 +299,7 @@ export const TEST_ADDRESSES: AddressesInterface = {
|
|
|
269
299
|
// '0x0d535c35f608b9b01b7ccce11acf43b1dd80c1b72bf8b541744a6e28e8d2745f',
|
|
270
300
|
// },
|
|
271
301
|
query: {
|
|
272
|
-
id: '
|
|
302
|
+
id: '0x89706958f43fb170de134579e3fbc53972b946ee78bd2442d8e1adc36074fbdc',
|
|
273
303
|
upgradeCap:
|
|
274
304
|
'0x0d535c35f608b9b01b7ccce11acf43b1dd80c1b72bf8b541744a6e28e8d2745f',
|
|
275
305
|
},
|
|
@@ -310,6 +340,11 @@ export const TEST_ADDRESSES: AddressesInterface = {
|
|
|
310
340
|
// '0x162250ef72393a4ad3d46294c4e1bdfcb03f04c869d390e7efbfc995353a7ee9',
|
|
311
341
|
'0xc3206071a8d43212efb6e3b5504f2321f8df97ab122b466c0bc7cfdf398dc13a',
|
|
312
342
|
},
|
|
343
|
+
susdc: {
|
|
344
|
+
id: '0x0b5f5f413bd3799e4052c37311966c77f3a4545eb125d2e93e67a68478021918',
|
|
345
|
+
rewardPoolId:
|
|
346
|
+
'0x85ed6ed72ea97c35dbf0cdc7ed6fbc48d8ec15de9b17c74bf4512df8a6d7f166',
|
|
347
|
+
},
|
|
313
348
|
swusdc: {
|
|
314
349
|
// id: '0x4ace6648ddc64e646ba47a957c562c32c9599b3bba8f5ac1aadb2ae23a2f8ca0',
|
|
315
350
|
id: '0xf1b383b9cf2e9f515fc69567df1053098f273849d09cd84b0278a773429bd2b2',
|
|
@@ -354,35 +389,35 @@ export const TEST_ADDRESSES: AddressesInterface = {
|
|
|
354
389
|
config: '',
|
|
355
390
|
},
|
|
356
391
|
borrowIncentive: {
|
|
357
|
-
id: '
|
|
392
|
+
id: '0x85769d63565ce99c7622f8e336ca1460926ddf29738ad2a39407b5cac29f61fe',
|
|
358
393
|
adminCap:
|
|
359
|
-
'
|
|
394
|
+
'0x56ac8e6f2b360b2b35c0168d72cc6cd17d9592afb83709865cb87af24bb2025b',
|
|
360
395
|
object:
|
|
361
|
-
'
|
|
362
|
-
query: '
|
|
396
|
+
'0x85769d63565ce99c7622f8e336ca1460926ddf29738ad2a39407b5cac29f61fe',
|
|
397
|
+
query: '0x8e0d00f8ff1199d7c5fe56cea0e901a525daeefff0445a1635ace8282ae3302c',
|
|
363
398
|
incentivePools:
|
|
364
|
-
'
|
|
399
|
+
'0x9d564c93128c6ab0c0d3e050a47f11df0b91494f3bb779bdc1301c1c637f15eb',
|
|
365
400
|
incentiveAccounts:
|
|
366
|
-
'
|
|
401
|
+
'0x09e6040e798246de04941bc79a3ba62d3eca6d7a218cc30f21fb07f478fa2926',
|
|
367
402
|
config:
|
|
368
|
-
'
|
|
403
|
+
'0x43d4ca1dfc90b161c4240facd119e74e4b850cca2957f88c2ec289c9380da064',
|
|
369
404
|
},
|
|
370
405
|
referral: {
|
|
371
|
-
id: '
|
|
406
|
+
id: '0x1bf5a8ce77050d8052549d743e16b469f15aa6b81b752b78b6ebb65179665f5a',
|
|
372
407
|
object:
|
|
373
408
|
'0x5658d4bf5ddcba27e4337b4262108b3ad1716643cac8c2054ac341538adc72ec',
|
|
374
409
|
adminCap:
|
|
375
410
|
'0xc5dc06b9074291259f2cac460c940012c781c4430e42125c541cc43101c3bcbd',
|
|
376
411
|
referralBindings:
|
|
377
|
-
'
|
|
412
|
+
'0xcf184487782bed962bf678001efe775d31fb94b9992333a57594cf15d79d5ced',
|
|
378
413
|
bindingTableId:
|
|
379
|
-
'
|
|
414
|
+
'0x41a50e258c0a266ce84e0e1a618dbf70b878cc943909e613089a50afcceb2bc0',
|
|
380
415
|
referralRevenuePool:
|
|
381
|
-
'
|
|
416
|
+
'0xc24e3e5e37032f29a3dd91a9a1f057af8821b7e6c148e9683900ac8b6d30f0c6',
|
|
382
417
|
revenueTableId:
|
|
383
418
|
'0x595baa3654c297bff84ab7786a2d250f019cefc66e8df8e89fd9d41e02bd30dd',
|
|
384
419
|
referralTiers:
|
|
385
|
-
'
|
|
420
|
+
'0x144350f3db9b46d11b140084cd54e6de0b9c3b8d265ce8059b51d0ef58ea464b',
|
|
386
421
|
tiersTableId:
|
|
387
422
|
'0xeac755a7a8b7798530905ac79e8c114f19d0f130f6eab012954f08faac29c75d',
|
|
388
423
|
// authorizedWitnessList:
|
|
@@ -390,21 +425,21 @@ export const TEST_ADDRESSES: AddressesInterface = {
|
|
|
390
425
|
authorizedWitnessList:
|
|
391
426
|
'0x9d6223dc52015b8a3986a573590ef2af8f1b8f3e4685513888c052f001b87e7f',
|
|
392
427
|
version:
|
|
393
|
-
'
|
|
428
|
+
'0x3545849eb97723e676a476ec9d4fe5f2eb0eb2c6b78972851114fd4c7ed4639f',
|
|
394
429
|
},
|
|
395
430
|
vesca: {
|
|
396
|
-
id: '
|
|
431
|
+
id: '0x1158813b32962c2d22888fae257d5f2365b03631f0cd5d5b912ccdf51ff4e2f2',
|
|
397
432
|
object:
|
|
398
|
-
'
|
|
433
|
+
'0x1158813b32962c2d22888fae257d5f2365b03631f0cd5d5b912ccdf51ff4e2f2',
|
|
399
434
|
adminCap:
|
|
400
435
|
'0x8ffa76135c5b85c5fbd73a6448a4a733d826cb63a267ab817656acb77c72d4a5',
|
|
401
436
|
tableId:
|
|
402
|
-
'
|
|
403
|
-
table: '
|
|
437
|
+
'0x0a0b7f749baeb61e3dfee2b42245e32d0e6b484063f0a536b33e771d573d7246',
|
|
438
|
+
table: '0xd3a4632b1080f7d96e1c2487d4dabf2c1196916937c505a69954ac9f393be8d0',
|
|
404
439
|
treasury:
|
|
405
|
-
'
|
|
440
|
+
'0xafa4b6231e49c15a22d641ce33fda761baaf650fa21899dfa2eb1716146e7306',
|
|
406
441
|
config:
|
|
407
|
-
'
|
|
442
|
+
'0x7cbcb0a342179577a117dfdff974cf1ab765d3b571067bf22ddf5f9e3a667922',
|
|
408
443
|
},
|
|
409
444
|
loyaltyProgram: {
|
|
410
445
|
id: '0xd17bcf8b5a59652c36225d478564a8593ae0ed7d650bcacdda1d6fe179127907',
|
|
@@ -416,13 +451,13 @@ export const TEST_ADDRESSES: AddressesInterface = {
|
|
|
416
451
|
'0x748a80395849ed37db1b0e14f2ab5d1d96458d2359ab3a84eb079d0f4ac7cf2e',
|
|
417
452
|
},
|
|
418
453
|
scoin: {
|
|
419
|
-
id: '
|
|
454
|
+
id: '0x773dab39c90fe05439b06a2d061795e52a974ff92c2aef90b2ee467acf7f33c8',
|
|
420
455
|
coins: {
|
|
421
456
|
ssui: {
|
|
422
457
|
coinType:
|
|
423
|
-
'
|
|
458
|
+
'0xf569919046f19a0c40b519ecfbb6ca0319698cd5908716c29b62ef56541f298b::scallop_sui::SCALLOP_SUI',
|
|
424
459
|
treasury:
|
|
425
|
-
'
|
|
460
|
+
'0x0e499640a12c38dd9cc44532f5bc5fd1b6da86d2f9a8810357250f4b26e9e5c7',
|
|
426
461
|
},
|
|
427
462
|
scetus: {
|
|
428
463
|
coinType:
|
|
@@ -432,21 +467,21 @@ export const TEST_ADDRESSES: AddressesInterface = {
|
|
|
432
467
|
},
|
|
433
468
|
ssca: {
|
|
434
469
|
coinType:
|
|
435
|
-
'
|
|
470
|
+
'0x958428555e778e55918a59eb1c92c77f32b5c554fa3a5e56cd0815086b5072e7::scallop_sca::SCALLOP_SCA',
|
|
436
471
|
treasury:
|
|
437
|
-
'
|
|
472
|
+
'0x5f1c5de1df7341075d119570269b7b452af50afe8363080638f1ae29a554c038',
|
|
438
473
|
},
|
|
439
474
|
swusdc: {
|
|
440
475
|
coinType:
|
|
441
|
-
'
|
|
476
|
+
'0xf5447c4305a486d8c8557559887c2c39449ddb5e748f15d33946d02a1663c158::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
442
477
|
treasury:
|
|
443
|
-
'
|
|
478
|
+
'0x471fbab72578bab577263006fe32543b6e76153fffa2bef69affe4bc4934258f',
|
|
444
479
|
},
|
|
445
480
|
swusdt: {
|
|
446
481
|
coinType:
|
|
447
|
-
'
|
|
482
|
+
'0xac781d9f73058ff5e69f9bf8dde32f2e8c71c66d7fe8497fc83b2d9182254b22::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
448
483
|
treasury:
|
|
449
|
-
'
|
|
484
|
+
'0x921a4ed4bb4b4f11f51a462c83f4c0f6b60a90e441d1bc0d26d6fd893146bf4d',
|
|
450
485
|
},
|
|
451
486
|
sweth: {
|
|
452
487
|
coinType:
|
|
@@ -470,7 +505,13 @@ export const TEST_ADDRESSES: AddressesInterface = {
|
|
|
470
505
|
coinType:
|
|
471
506
|
'0x97023a317320c4498cc4cd239dd02fd30c28246e5e8f81325d63f2bd8d70f6b3::scallop_v_sui::SCALLOP_V_SUI',
|
|
472
507
|
treasury:
|
|
473
|
-
'0x327114f0bf3559d7e2de10282147ed76a236c7c6775029165c4db09a6062ead6
|
|
508
|
+
'0x327114f0bf3559d7e2de10282147ed76a236c7c6775029165c4db09a6062ead6',
|
|
509
|
+
},
|
|
510
|
+
ssbeth: {
|
|
511
|
+
coinType:
|
|
512
|
+
'0xb14f82d8506d139eacef109688d1b71e7236bcce9b2c0ad526abcd6aa5be7de0::scallop_sb_eth::SCALLOP_SB_ETH',
|
|
513
|
+
treasury:
|
|
514
|
+
'0xfd0f02def6358a1f266acfa1493d4707ee8387460d434fb667d63d755ff907ed',
|
|
474
515
|
},
|
|
475
516
|
},
|
|
476
517
|
},
|
|
@@ -98,10 +98,9 @@ export class ScallopBuilder {
|
|
|
98
98
|
* @param address - ScallopAddress instance.
|
|
99
99
|
*/
|
|
100
100
|
public async init(force: boolean = false, address?: ScallopAddress) {
|
|
101
|
-
if (
|
|
101
|
+
if (address && !this.address) this.address = address;
|
|
102
|
+
if (force || !this.address.getAddresses()) {
|
|
102
103
|
await this.address.read();
|
|
103
|
-
} else {
|
|
104
|
-
this.address = address;
|
|
105
104
|
}
|
|
106
105
|
await this.query.init(force, this.address);
|
|
107
106
|
await this.utils.init(force, this.address);
|
|
@@ -167,11 +167,12 @@ export class ScallopQuery {
|
|
|
167
167
|
* @param address - ScallopAddress instance.
|
|
168
168
|
*/
|
|
169
169
|
public async init(force: boolean = false, address?: ScallopAddress) {
|
|
170
|
-
if (
|
|
171
|
-
await this.address.read();
|
|
172
|
-
} else {
|
|
170
|
+
if (address && !this.address) {
|
|
173
171
|
this.address = address;
|
|
174
172
|
}
|
|
173
|
+
if (force || !this.address.getAddresses()) {
|
|
174
|
+
await this.address.read();
|
|
175
|
+
}
|
|
175
176
|
|
|
176
177
|
await this.utils.init(force, this.address);
|
|
177
178
|
}
|