@scallop-io/sui-scallop-sdk 1.3.5-alpha.3 → 1.3.5-alpha.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/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopUtils.d.ts +1 -1
- package/package.json +1 -1
- package/src/models/scallopUtils.ts +6 -3
|
@@ -50,7 +50,7 @@ export declare class ScallopUtils {
|
|
|
50
50
|
* @param coinName - Specific support coin name.
|
|
51
51
|
* @return Coin type.
|
|
52
52
|
*/
|
|
53
|
-
parseCoinType(coinName: SupportCoins): string;
|
|
53
|
+
parseCoinType(coinName: SupportCoins, useOldMarketCoin?: boolean): string;
|
|
54
54
|
/**
|
|
55
55
|
* Convert coin name to sCoin name.
|
|
56
56
|
*
|
package/package.json
CHANGED
|
@@ -156,9 +156,12 @@ export class ScallopUtils {
|
|
|
156
156
|
* @param coinName - Specific support coin name.
|
|
157
157
|
* @return Coin type.
|
|
158
158
|
*/
|
|
159
|
-
public parseCoinType(
|
|
159
|
+
public parseCoinType(
|
|
160
|
+
coinName: SupportCoins,
|
|
161
|
+
useOldMarketCoin: boolean = false
|
|
162
|
+
) {
|
|
160
163
|
// try parse scoin first
|
|
161
|
-
if (sCoinIds[coinName as SupportSCoin]) {
|
|
164
|
+
if (sCoinIds[coinName as SupportSCoin] && !useOldMarketCoin) {
|
|
162
165
|
return sCoinIds[coinName as SupportSCoin];
|
|
163
166
|
}
|
|
164
167
|
coinName = isMarketCoin(coinName) ? this.parseCoinName(coinName) : coinName;
|
|
@@ -285,7 +288,7 @@ export class ScallopUtils {
|
|
|
285
288
|
public parseMarketCoinType(coinName: SupportCoins) {
|
|
286
289
|
const protocolObjectId =
|
|
287
290
|
this.address.get('core.object') ?? PROTOCOL_OBJECT_ID;
|
|
288
|
-
const coinType = this.parseCoinType(coinName);
|
|
291
|
+
const coinType = this.parseCoinType(coinName, true);
|
|
289
292
|
return `${protocolObjectId}::reserve::MarketCoin<${coinType}>`;
|
|
290
293
|
}
|
|
291
294
|
|