@scallop-io/sui-scallop-sdk 0.44.11 → 0.44.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "0.44.11",
3
+ "version": "0.44.13",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -253,12 +253,12 @@ export class ScallopClient {
253
253
  txBlock.setSender(sender);
254
254
 
255
255
  const obligations = await this.query.getObligations(sender);
256
- const tarketObligationId = obligationId || obligations[0].id;
257
- if (tarketObligationId) {
256
+ const specificObligationId = obligationId || obligations?.[0]?.id;
257
+ if (specificObligationId) {
258
258
  await txBlock.addCollateralQuick(
259
259
  amount,
260
260
  collateralCoinName,
261
- tarketObligationId
261
+ specificObligationId
262
262
  );
263
263
  } else {
264
264
  const [obligation, obligationKey, hotPotato] = txBlock.openObligation();
@@ -154,7 +154,7 @@ export const queryMarket = async (
154
154
  const parsedMarketCollateralData = parseOriginMarketCollateralData({
155
155
  type: collateral.type,
156
156
  collateralFactor: collateral.collateralFactor,
157
- liquidationFactor: collateral.collateralFactor,
157
+ liquidationFactor: collateral.liquidationFactor,
158
158
  liquidationDiscount: collateral.liquidationDiscount,
159
159
  liquidationPanelty: collateral.liquidationPanelty,
160
160
  liquidationReserveFactor: collateral.liquidationReserveFactor,