@scallop-io/sui-scallop-sdk 1.3.4-isolated-asset.2 → 1.3.4
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/common.d.ts +2 -2
- package/dist/constants/enum.d.ts +1 -1
- package/dist/index.js +25 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -33
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopQuery.d.ts +1 -1
- package/dist/models/scallopUtils.d.ts +1 -1
- package/dist/queries/sCoinQuery.d.ts +1 -1
- package/package.json +1 -1
- package/src/constants/common.ts +4 -1
- package/src/constants/enum.ts +15 -31
- package/src/queries/borrowLimitQuery.ts +2 -3
- package/src/queries/isolatedAssetQuery.ts +2 -3
- package/src/queries/priceQuery.ts +6 -4
- package/src/queries/supplyLimitQuery.ts +2 -3
|
@@ -456,7 +456,7 @@ export declare class ScallopQuery {
|
|
|
456
456
|
* @param ownerAddress - The owner address.
|
|
457
457
|
* @return All market sCoin amounts.
|
|
458
458
|
*/
|
|
459
|
-
getSCoinAmounts(sCoinNames?: SupportSCoin[], ownerAddress?: string): Promise<import("../types").OptionalKeys<Record<"susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca", number>>>;
|
|
459
|
+
getSCoinAmounts(sCoinNames?: SupportSCoin[], ownerAddress?: string): Promise<import("../types").OptionalKeys<Record<"susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep", number>>>;
|
|
460
460
|
/**
|
|
461
461
|
* Get sCoin amount.
|
|
462
462
|
*
|
|
@@ -69,7 +69,7 @@ export declare class ScallopUtils {
|
|
|
69
69
|
* @param sCoinType
|
|
70
70
|
* @returns sCoin name
|
|
71
71
|
*/
|
|
72
|
-
parseSCoinNameFromType(sCoinType: string): "susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca";
|
|
72
|
+
parseSCoinNameFromType(sCoinType: string): "susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep";
|
|
73
73
|
/**
|
|
74
74
|
* Convert sCoin name into its underlying coin type
|
|
75
75
|
* @param sCoinName
|
|
@@ -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" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca", number>>>;
|
|
22
|
+
}, sCoinNames?: SupportSCoin[], ownerAddress?: string) => Promise<OptionalKeys<Record<"susdc" | "ssbeth" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep", number>>>;
|
|
23
23
|
/**
|
|
24
24
|
* Query owned sCoin amount.
|
|
25
25
|
*
|
package/package.json
CHANGED
package/src/constants/common.ts
CHANGED
|
@@ -7,7 +7,8 @@ export const USE_TEST_ADDRESS: boolean = false;
|
|
|
7
7
|
export const ADDRESSES_ID =
|
|
8
8
|
IS_VE_SCA_TEST || USE_TEST_ADDRESS
|
|
9
9
|
? ('65fb07c39c845425d71d7b18' as const)
|
|
10
|
-
: ('
|
|
10
|
+
: ('675c65cd301dd817ea262e76' as const);
|
|
11
|
+
// : ('66f8e7ed9bb9e07fdfb86bbb' as const);
|
|
11
12
|
// : ('664dfe22898c36c159e28bc8' as const);
|
|
12
13
|
|
|
13
14
|
export const PROTOCOL_OBJECT_ID = IS_VE_SCA_TEST
|
|
@@ -91,6 +92,8 @@ export const SUPPORT_SCOIN = [
|
|
|
91
92
|
'scetus',
|
|
92
93
|
'swsol',
|
|
93
94
|
'swbtc',
|
|
95
|
+
'sdeep',
|
|
96
|
+
'sfud',
|
|
94
97
|
] as const;
|
|
95
98
|
|
|
96
99
|
export const SUPPORT_SUI_BRIDGE = ['sbeth'] as const;
|
package/src/constants/enum.ts
CHANGED
|
@@ -88,6 +88,8 @@ export const sCoins: types.SCoins = {
|
|
|
88
88
|
ssca: 'ssca',
|
|
89
89
|
swsol: 'swsol',
|
|
90
90
|
swbtc: 'swbtc',
|
|
91
|
+
sfud: 'sfud',
|
|
92
|
+
sdeep: 'sdeep',
|
|
91
93
|
};
|
|
92
94
|
|
|
93
95
|
export const stakeMarketCoins: types.StakeMarketCoins = {
|
|
@@ -149,8 +151,8 @@ export const coinIds: types.AssetCoinIds = {
|
|
|
149
151
|
? '0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524'
|
|
150
152
|
: '0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6',
|
|
151
153
|
// isolated assets
|
|
152
|
-
deep: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270
|
|
153
|
-
fud: '0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1
|
|
154
|
+
deep: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270',
|
|
155
|
+
fud: '0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1',
|
|
154
156
|
};
|
|
155
157
|
|
|
156
158
|
export const wormholeCoinIds: types.WormholeCoinIds = {
|
|
@@ -172,24 +174,14 @@ export const sCoinIds: types.SCoinIds = {
|
|
|
172
174
|
'0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC',
|
|
173
175
|
ssbeth:
|
|
174
176
|
'0xb14f82d8506d139eacef109688d1b71e7236bcce9b2c0ad526abcd6aa5be7de0::scallop_sb_eth::SCALLOP_SB_ETH',
|
|
175
|
-
ssui:
|
|
176
|
-
// TODO: use prod value
|
|
177
|
-
// '0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI',
|
|
178
|
-
'0xf569919046f19a0c40b519ecfbb6ca0319698cd5908716c29b62ef56541f298b::scallop_sui::SCALLOP_SUI',
|
|
177
|
+
ssui: '0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI',
|
|
179
178
|
scetus:
|
|
180
179
|
'0xea346ce428f91ab007210443efcea5f5cdbbb3aae7e9affc0ca93f9203c31f0c::scallop_cetus::SCALLOP_CETUS',
|
|
181
|
-
ssca:
|
|
182
|
-
// TODO: use prod value
|
|
183
|
-
// '0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA',
|
|
184
|
-
'0x958428555e778e55918a59eb1c92c77f32b5c554fa3a5e56cd0815086b5072e7::scallop_sca::SCALLOP_SCA',
|
|
180
|
+
ssca: '0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA',
|
|
185
181
|
swusdc:
|
|
186
|
-
|
|
187
|
-
// '0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
188
|
-
'0xf5447c4305a486d8c8557559887c2c39449ddb5e748f15d33946d02a1663c158::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
182
|
+
'0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
189
183
|
swusdt:
|
|
190
|
-
|
|
191
|
-
// '0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
192
|
-
'0xac781d9f73058ff5e69f9bf8dde32f2e8c71c66d7fe8497fc83b2d9182254b22::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
184
|
+
'0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
193
185
|
sweth:
|
|
194
186
|
'0x67540ceb850d418679e69f1fb6b2093d6df78a2a699ffc733f7646096d552e9b::scallop_wormhole_eth::SCALLOP_WORMHOLE_ETH',
|
|
195
187
|
safsui:
|
|
@@ -202,6 +194,9 @@ export const sCoinIds: types.SCoinIds = {
|
|
|
202
194
|
'0x1392650f2eca9e3f6ffae3ff89e42a3590d7102b80e2b430f674730bc30d3259::scallop_wormhole_sol::SCALLOP_WORMHOLE_SOL',
|
|
203
195
|
swbtc:
|
|
204
196
|
'0x2cf76a9cf5d3337961d1154283234f94da2dcff18544dfe5cbdef65f319591b5::scallop_wormhole_btc::SCALLOP_WORMHOLE_BTC',
|
|
197
|
+
sdeep:
|
|
198
|
+
'0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP',
|
|
199
|
+
sfud: '0xe56d5167f427cbe597da9e8150ef5c337839aaf46891d62468dcf80bdd8e10d1::scallop_fud::SCALLOP_FUD',
|
|
205
200
|
} as const;
|
|
206
201
|
|
|
207
202
|
export const sCoinTypeToName = Object.entries(sCoinIds).reduce(
|
|
@@ -214,21 +209,10 @@ export const sCoinTypeToName = Object.entries(sCoinIds).reduce(
|
|
|
214
209
|
|
|
215
210
|
// TEST VERSION
|
|
216
211
|
// export const sCoinIds: types.SCoinIds = {
|
|
217
|
-
//
|
|
218
|
-
//
|
|
219
|
-
//
|
|
220
|
-
//
|
|
221
|
-
// swusdc:
|
|
222
|
-
// '0xaedc3ab75db8680b81a755015fa90124d217be93457b893c05bac033817defaf::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
223
|
-
// swusdt:
|
|
224
|
-
// '0xbf02fc87ddc104b342ad8414c85ceadf5b0c823c055a06fb0ed776272c01a52a::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
225
|
-
// sweth: '0x27d54f43e3eda701be56b82e5756e41c84467cd202f5cf713d5f9e45a9f1b6bc::scallop_wormhole_eth::SCALLOP_WORMHOLE_ETH',
|
|
226
|
-
// safsui:
|
|
227
|
-
// '0xb75b46d975d8d80670b53a6bee90baaa8ce2e0b7d397f079447d641eef6b44ad::scallop_af_sui::SCALLOP_AF_SUI',
|
|
228
|
-
// shasui:
|
|
229
|
-
// '0xd973a723874e2c7cde196602a79155a1343a933f8cf87d9b1bb7408bc1acbc58::scallop_ha_sui::SCALLOP_HA_SUI',
|
|
230
|
-
// svsui:
|
|
231
|
-
// '0x97023a317320c4498cc4cd239dd02fd30c28246e5e8f81325d63f2bd8d70f6b3::scallop_v_sui::SCALLOP_V_SUI',
|
|
212
|
+
// ssui: '0xf569919046f19a0c40b519ecfbb6ca0319698cd5908716c29b62ef56541f298b::scallop_sui::SCALLOP_SUI',
|
|
213
|
+
// swusdt: '0xac781d9f73058ff5e69f9bf8dde32f2e8c71c66d7fe8497fc83b2d9182254b22::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
214
|
+
// swusdc: '0xf5447c4305a486d8c8557559887c2c39449ddb5e748f15d33946d02a1663c158::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
215
|
+
// ssca: '0x958428555e778e55918a59eb1c92c77f32b5c554fa3a5e56cd0815086b5072e7::scallop_sca::SCALLOP_SCA',
|
|
232
216
|
// } as const;
|
|
233
217
|
|
|
234
218
|
// export const sCoinTreasuryCaps: types.SCoinTreasuryCaps = {
|
|
@@ -17,9 +17,8 @@ const borrowLimitZod = zod.object({
|
|
|
17
17
|
}),
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
const borrowLimitKeyType = `0xb784ea287d944e478a3ceaa071f8885072cce6b7224cf245914dc2f9963f460e::market_dynamic_keys::BorrowLimitKey`;
|
|
20
|
+
const borrowLimitKeyType = `0xe7dbb371a9595631f7964b7ece42255ad0e738cc85fe6da26c7221b220f01af6::market_dynamic_keys::BorrowLimitKey`; // prod
|
|
21
|
+
// const borrowLimitKeyType = `0xb784ea287d944e478a3ceaa071f8885072cce6b7224cf245914dc2f9963f460e::market_dynamic_keys::BorrowLimitKey`;
|
|
23
22
|
/**
|
|
24
23
|
* Return supply limit of a pool (including the decimals)
|
|
25
24
|
* @param utils
|
|
@@ -18,9 +18,8 @@ const isolatedAssetZod = zod.object({
|
|
|
18
18
|
}),
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
const isolatedAssetKeyType = `0x6c23585e940a989588432509107e98bae06dbca4e333f26d0635d401b3c7c76d::market_dynamic_keys::IsolatedAssetKey`;
|
|
21
|
+
const isolatedAssetKeyType = `0xe7dbb371a9595631f7964b7ece42255ad0e738cc85fe6da26c7221b220f01af6::market_dynamic_keys::IsolatedAssetKey`; // prod
|
|
22
|
+
// const isolatedAssetKeyType = `0x6c23585e940a989588432509107e98bae06dbca4e333f26d0635d401b3c7c76d::market_dynamic_keys::IsolatedAssetKey`;
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
* Return list of isolated assets coin types
|
|
@@ -77,10 +77,12 @@ export const getPythPrices = async (
|
|
|
77
77
|
const pythPriceFeed = address.get(
|
|
78
78
|
`core.coins.${assetCoinName}.oracle.pyth.feedObject`
|
|
79
79
|
);
|
|
80
|
-
if (
|
|
81
|
-
prev[pythPriceFeed]
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
if (pythPriceFeed) {
|
|
81
|
+
if (!prev[pythPriceFeed]) {
|
|
82
|
+
prev[pythPriceFeed] = [assetCoinName];
|
|
83
|
+
} else {
|
|
84
|
+
prev[pythPriceFeed].push(assetCoinName);
|
|
85
|
+
}
|
|
84
86
|
}
|
|
85
87
|
return prev;
|
|
86
88
|
},
|
|
@@ -17,9 +17,8 @@ const supplyLimitZod = zod.object({
|
|
|
17
17
|
}),
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
const supplyLimitKeyType = `0x6c23585e940a989588432509107e98bae06dbca4e333f26d0635d401b3c7c76d::market_dynamic_keys::SupplyLimitKey`;
|
|
20
|
+
const supplyLimitKeyType = `0x6e641f0dca8aedab3101d047e96439178f16301bf0b57fe8745086ff1195eb3e::market_dynamic_keys::SupplyLimitKey`; // prod
|
|
21
|
+
// const supplyLimitKeyType = `0x6c23585e940a989588432509107e98bae06dbca4e333f26d0635d401b3c7c76d::market_dynamic_keys::SupplyLimitKey`;
|
|
23
22
|
/**
|
|
24
23
|
* Return supply limit of a pool (including the decimals)
|
|
25
24
|
* @param utils
|