@gainsnetwork/sdk 0.2.12-rc4 → 0.2.12-rc6
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/lib/contracts/types/generated/GNSMultiCollatDiamond.d.ts +346 -175
- package/lib/contracts/types/generated/factories/GNSMultiCollatDiamond__factory.d.ts +63 -22
- package/lib/contracts/types/generated/factories/GNSMultiCollatDiamond__factory.js +775 -321
- package/lib/contracts/utils/openTrades.js +3 -3
- package/lib/contracts/utils/pairs.d.ts +0 -1
- package/lib/contracts/utils/pairs.js +1 -18
- package/package.json +1 -1
|
@@ -110,9 +110,9 @@ const _prepareTradeContainer = (trade, tradeInfo, tradeLiquidationParams, tradeI
|
|
|
110
110
|
collateralPriceUsd: parseFloat(tradeInfo.collateralPriceUsd.toString()) / 1e8,
|
|
111
111
|
},
|
|
112
112
|
liquidationParams: {
|
|
113
|
-
maxLiqSpreadP: parseFloat(tradeLiquidationParams.maxLiqSpreadP.toString()) /
|
|
114
|
-
startLiqThresholdP: parseFloat(tradeLiquidationParams.startLiqThresholdP.toString()) /
|
|
115
|
-
endLiqThresholdP: parseFloat(tradeLiquidationParams.endLiqThresholdP.toString()) /
|
|
113
|
+
maxLiqSpreadP: parseFloat(tradeLiquidationParams.maxLiqSpreadP.toString()) / 1e12,
|
|
114
|
+
startLiqThresholdP: parseFloat(tradeLiquidationParams.startLiqThresholdP.toString()) / 1e12,
|
|
115
|
+
endLiqThresholdP: parseFloat(tradeLiquidationParams.endLiqThresholdP.toString()) / 1e12,
|
|
116
116
|
startLeverage: parseFloat(tradeLiquidationParams.startLeverage.toString()) / 1e3,
|
|
117
117
|
endLeverage: parseFloat(tradeLiquidationParams.endLeverage.toString()) / 1e3,
|
|
118
118
|
},
|
|
@@ -2,7 +2,6 @@ import { Pair, Fee, OpenInterest, PairDepth, PairIndex } from "../../trade/types
|
|
|
2
2
|
import { Contracts } from "../../contracts/types";
|
|
3
3
|
export declare const fetchPairs: (contracts: Contracts, pairIxs: PairIndex[]) => Promise<Pair[]>;
|
|
4
4
|
export declare const fetchPairDepths: (contracts: Contracts, pairIxs: number[]) => Promise<PairDepth[]>;
|
|
5
|
-
export declare const fetchProtectionCloseFactors: (contracts: Contracts, pairIxs: number[]) => Promise<number[]>;
|
|
6
5
|
export declare const fetchFees: (contracts: Contracts, feeIxs: PairIndex[]) => Promise<Fee[]>;
|
|
7
6
|
export declare const fetchOpenInterest: (contracts: Contracts, collateralIndex: number, pairIxs: number[]) => Promise<OpenInterest[]>;
|
|
8
7
|
export declare const getPairDescription: (pairIndex: PairIndex) => string;
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getPairDescription = exports.fetchOpenInterest = exports.fetchFees = exports.
|
|
12
|
+
exports.getPairDescription = exports.fetchOpenInterest = exports.fetchFees = exports.fetchPairDepths = exports.fetchPairs = void 0;
|
|
13
13
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
14
14
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
15
15
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
@@ -60,23 +60,6 @@ const fetchPairDepths = (contracts, pairIxs) => __awaiter(void 0, void 0, void 0
|
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
exports.fetchPairDepths = fetchPairDepths;
|
|
63
|
-
const fetchProtectionCloseFactors = (contracts, pairIxs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
-
if (!contracts) {
|
|
65
|
-
return [];
|
|
66
|
-
}
|
|
67
|
-
const { gnsMultiCollatDiamond: multiCollatContract } = contracts;
|
|
68
|
-
try {
|
|
69
|
-
const protectionCloseFactors = yield multiCollatContract.getProtectionCloseFactors(pairIxs);
|
|
70
|
-
return protectionCloseFactors.map(protectionCloseFactor => {
|
|
71
|
-
return protectionCloseFactor.toNumber();
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
console.error(`Unexpected error while fetching pairs!`);
|
|
76
|
-
throw error;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
exports.fetchProtectionCloseFactors = fetchProtectionCloseFactors;
|
|
80
63
|
const fetchFees = (contracts, feeIxs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
64
|
if (!contracts) {
|
|
82
65
|
return [];
|