@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "1.3.5-alpha.3",
3
+ "version": "1.3.5-alpha.4",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -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(coinName: SupportCoins) {
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