lynx-client 0.0.35 → 0.0.37
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/cjs/lib/addresses/lensAddresses.js +6 -6
- package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +3 -0
- package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +1 -0
- package/dist/cjs/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.js +38 -1
- package/dist/cjs/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.js +84 -0
- package/dist/cjs/lib/typechain/contracts/Lynx/Incentives/SkewIncentive.js +2 -0
- package/dist/cjs/lib/typechain/contracts/Lynx/interfaces/ISkewIncentive.js +2 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Incentives/SkewIncentive__factory.js +1118 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/PNLR/PNLR__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +21 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +222 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/interfaces/IPriceValidatorV1__factory.js +5 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/interfaces/ISkewIncentive__factory.js +538 -0
- package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +46 -1
- package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +452 -1
- package/dist/esm/lib/addresses/lensAddresses.d.ts +6 -6
- package/dist/esm/lib/addresses/lensAddresses.js +6 -6
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +2 -1
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +3 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +1 -0
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts +38 -1
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.js +38 -1
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts +9 -2
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.js +84 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Incentives/SkewIncentive.d.ts +745 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Incentives/SkewIncentive.d.ts.map +1 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Incentives/SkewIncentive.js +2 -0
- package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +18 -6
- package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -1
- package/dist/esm/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts +36 -2
- package/dist/esm/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts.map +1 -1
- package/dist/esm/lib/typechain/contracts/Lynx/interfaces/IPriceValidatorV1.d.ts +9 -3
- package/dist/esm/lib/typechain/contracts/Lynx/interfaces/IPriceValidatorV1.d.ts.map +1 -1
- package/dist/esm/lib/typechain/contracts/Lynx/interfaces/ISkewIncentive.d.ts +408 -0
- package/dist/esm/lib/typechain/contracts/Lynx/interfaces/ISkewIncentive.d.ts.map +1 -0
- package/dist/esm/lib/typechain/contracts/Lynx/interfaces/ISkewIncentive.js +2 -0
- package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +10 -1
- package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
- package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.d.ts +205 -1
- package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Incentives/SkewIncentive__factory.d.ts +861 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Incentives/SkewIncentive__factory.d.ts.map +1 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Incentives/SkewIncentive__factory.js +1118 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PNLR/PNLR__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PNLR/PNLR__factory.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PNLR/PNLR__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +17 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +21 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +177 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +222 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/interfaces/IPriceValidatorV1__factory.d.ts +4 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/interfaces/IPriceValidatorV1__factory.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/interfaces/IPriceValidatorV1__factory.js +5 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/interfaces/ISkewIncentive__factory.d.ts +415 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/interfaces/ISkewIncentive__factory.d.ts.map +1 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/interfaces/ISkewIncentive__factory.js +538 -0
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +37 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +46 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +348 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +452 -1
- package/dist/types/lib/addresses/lensAddresses.d.ts +6 -6
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +2 -1
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts +38 -1
- package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts +9 -2
- package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts.map +1 -1
- package/dist/types/lib/typechain/contracts/Lynx/Incentives/SkewIncentive.d.ts +745 -0
- package/dist/types/lib/typechain/contracts/Lynx/Incentives/SkewIncentive.d.ts.map +1 -0
- package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +18 -6
- package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -1
- package/dist/types/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts +36 -2
- package/dist/types/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts.map +1 -1
- package/dist/types/lib/typechain/contracts/Lynx/interfaces/IPriceValidatorV1.d.ts +9 -3
- package/dist/types/lib/typechain/contracts/Lynx/interfaces/IPriceValidatorV1.d.ts.map +1 -1
- package/dist/types/lib/typechain/contracts/Lynx/interfaces/ISkewIncentive.d.ts +408 -0
- package/dist/types/lib/typechain/contracts/Lynx/interfaces/ISkewIncentive.d.ts.map +1 -0
- package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +10 -1
- package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
- package/dist/types/lib/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.d.ts +205 -1
- package/dist/types/lib/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Incentives/SkewIncentive__factory.d.ts +861 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/Incentives/SkewIncentive__factory.d.ts.map +1 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/PNLR/PNLR__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/PNLR/PNLR__factory.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +17 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +177 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/interfaces/IPriceValidatorV1__factory.d.ts +4 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/interfaces/IPriceValidatorV1__factory.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/interfaces/ISkewIncentive__factory.d.ts +415 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/interfaces/ISkewIncentive__factory.d.ts.map +1 -0
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +37 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +348 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -5,15 +5,15 @@ exports.LensAddresses = {
|
|
|
5
5
|
boba: {
|
|
6
6
|
intentsVerifierLens: "0x7DfA2F609573AB8eD8cA231498FF4E8f1e7d31Fa",
|
|
7
7
|
lexLens: "0xacd54792eB1844eEB2285C29dE267aA65a7A4fB0",
|
|
8
|
-
tradingFloorLensLens: "
|
|
9
|
-
triggersAndPortalLens: "
|
|
8
|
+
tradingFloorLensLens: "0x3fBE188f4C52683B910A2a0CBD914613f08CBC19",
|
|
9
|
+
triggersAndPortalLens: "0xd8E6E20A03b6f3Dc02880ac6595678dc28ae2E8A",
|
|
10
10
|
rateModelLens: "0xee6354F34892C5388FC69ea1CEc0f3050aF84fB9",
|
|
11
11
|
},
|
|
12
12
|
sonic: {
|
|
13
13
|
intentsVerifierLens: "0x0C1Fcd85856b5564a87ae378336b7CC0c139C5f7",
|
|
14
14
|
lexLens: "0x175b535ED0383e96Cc5f436464AF88768242E8d8",
|
|
15
|
-
tradingFloorLensLens: "
|
|
16
|
-
triggersAndPortalLens: "
|
|
15
|
+
tradingFloorLensLens: "0x60E7D645e8Bd03A5865D787206Ab97c78dB234C1",
|
|
16
|
+
triggersAndPortalLens: "0xF791EB99654411487d9AC8334c6090716001E451",
|
|
17
17
|
rateModelLens: "0x771176a09E84365552504437e3A026ea049CBa41",
|
|
18
18
|
},
|
|
19
19
|
fantom: {
|
|
@@ -26,8 +26,8 @@ exports.LensAddresses = {
|
|
|
26
26
|
flare: {
|
|
27
27
|
intentsVerifierLens: "0x8fBb98F9BbBBB455A86371D4B2E8ECc7b1b9C6F6",
|
|
28
28
|
lexLens: "0x731C1CECb65ab3056BDbBBF3037FBf85A8C888c8",
|
|
29
|
-
tradingFloorLensLens: "
|
|
30
|
-
triggersAndPortalLens: "
|
|
29
|
+
tradingFloorLensLens: "0xa23D17478ef3f35AE0D540Cdfe6f48ae37Ae9423",
|
|
30
|
+
triggersAndPortalLens: "0x1D618cb0543827d0Db1063AEaa61cFCF54b33834",
|
|
31
31
|
rateModelLens: "0x7D1893Da64A559C5F23C0f565F62C8480ff6A295",
|
|
32
32
|
},
|
|
33
33
|
};
|
package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js
CHANGED
|
@@ -30,6 +30,9 @@ exports.EMPTY_COMPLETE_POSITION_DATA = {
|
|
|
30
30
|
funding: 0n,
|
|
31
31
|
borrowInterest: 0n,
|
|
32
32
|
liquidationPrice: 0n,
|
|
33
|
+
skewIncentiveRate: 0n,
|
|
34
|
+
skewIncentiveDisabled: false,
|
|
35
|
+
skewIncentiveOpenTimestamp: 0,
|
|
33
36
|
};
|
|
34
37
|
exports.EMPTY_POSITIONS_RESULT = {
|
|
35
38
|
positions: [],
|
package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js
CHANGED
|
@@ -25,6 +25,7 @@ function convertPositionData(pos) {
|
|
|
25
25
|
pendingUpdateOrderType: Number(baseStruct.pendingUpdateOrderType),
|
|
26
26
|
pendingUpdateOrderTimestamp: Number(baseStruct.pendingUpdateOrderTimestamp),
|
|
27
27
|
liquidationPrice: baseStruct.liquidationPrice,
|
|
28
|
+
skewIncentiveOpenTimestamp: Number(baseStruct.skewIncentiveOpenTimestamp),
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
31
|
function convertLiquidationInfo(pos) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EMPTY_TRADERS_PORTAL_PER_PAIR_PARAMETERS = exports.EMPTY_ON_BEHALF_TRADING_CONFIGURATIONS = exports.EMPTY_ON_BEHALF_TRADING_TOKEN_CONFIG = exports.EMPTY_COMPLETE_TRIGGER_CONFIGURATIONS = exports.EMPTY_COMPLETE_TRADERS_PORTAL_CONFIGURATIONS = exports.EMPTY_PAIR_CONFIGS_IN_TRIGGERS = void 0;
|
|
3
|
+
exports.EMPTY_SKEW_INCENTIVE_FULL_CONFIG = exports.EMPTY_SKEW_INCENTIVE_PAIR_CONFIG = exports.EMPTY_SKEW_INCENTIVE_GLOBAL_CONFIG = exports.EMPTY_SKEW_INCENTIVE_ASSET_CONFIG = exports.EMPTY_POSITION_SKEW_STATUS = exports.EMPTY_TRADERS_PORTAL_PER_PAIR_PARAMETERS = exports.EMPTY_ON_BEHALF_TRADING_CONFIGURATIONS = exports.EMPTY_ON_BEHALF_TRADING_TOKEN_CONFIG = exports.EMPTY_COMPLETE_TRIGGER_CONFIGURATIONS = exports.EMPTY_COMPLETE_TRADERS_PORTAL_CONFIGURATIONS = exports.EMPTY_PAIR_CONFIGS_IN_TRIGGERS = void 0;
|
|
4
4
|
exports.EMPTY_PAIR_CONFIGS_IN_TRIGGERS = {
|
|
5
5
|
pairId: 0,
|
|
6
6
|
maxConfidenceFraction: 0,
|
|
@@ -54,3 +54,40 @@ exports.EMPTY_TRADERS_PORTAL_PER_PAIR_PARAMETERS = {
|
|
|
54
54
|
minLiveTimeForMarketClose: 0,
|
|
55
55
|
limitsMarginFraction: 0,
|
|
56
56
|
};
|
|
57
|
+
exports.EMPTY_POSITION_SKEW_STATUS = {
|
|
58
|
+
positionId: "",
|
|
59
|
+
isEligible: false,
|
|
60
|
+
incentiveRate: 0,
|
|
61
|
+
disabled: false,
|
|
62
|
+
openTimestamp: 0,
|
|
63
|
+
};
|
|
64
|
+
exports.EMPTY_SKEW_INCENTIVE_ASSET_CONFIG = {
|
|
65
|
+
settlementAsset: "",
|
|
66
|
+
enabled: false,
|
|
67
|
+
skewThreshold: 0,
|
|
68
|
+
incentiveRate: 0,
|
|
69
|
+
minPositionSize: 0n,
|
|
70
|
+
minHoldingTime: 0,
|
|
71
|
+
};
|
|
72
|
+
exports.EMPTY_SKEW_INCENTIVE_GLOBAL_CONFIG = {
|
|
73
|
+
contractAddress: "",
|
|
74
|
+
globalEnabled: false,
|
|
75
|
+
activePositionCount: 0,
|
|
76
|
+
configuredSettlementAssetCount: 0,
|
|
77
|
+
};
|
|
78
|
+
exports.EMPTY_SKEW_INCENTIVE_PAIR_CONFIG = {
|
|
79
|
+
settlementAsset: "",
|
|
80
|
+
pairId: 0,
|
|
81
|
+
enabled: false,
|
|
82
|
+
skewThreshold: 0,
|
|
83
|
+
incentiveRate: 0,
|
|
84
|
+
minPositionSize: 0n,
|
|
85
|
+
minHoldingTime: 0,
|
|
86
|
+
};
|
|
87
|
+
exports.EMPTY_SKEW_INCENTIVE_FULL_CONFIG = {
|
|
88
|
+
contractAddress: "",
|
|
89
|
+
globalEnabled: false,
|
|
90
|
+
activePositionCount: 0,
|
|
91
|
+
assetConfigs: [],
|
|
92
|
+
pairConfigs: [],
|
|
93
|
+
};
|
|
@@ -98,6 +98,90 @@ class TriggersAndPortalLensService {
|
|
|
98
98
|
const result = await this.contract.getOnBehalfTradingTokenConfigs(onBehalfTrading, tokens, { ...callOptions });
|
|
99
99
|
return (0, ethersTypes_1.ethersStructResponseToArray)(result, ITriggersAndPortalLensService_1.EMPTY_ON_BEHALF_TRADING_TOKEN_CONFIG);
|
|
100
100
|
}
|
|
101
|
+
async getPositionSkewStatuses(skewIncentive, positionIds, callOptions) {
|
|
102
|
+
const result = await this.contract.getPositionSkewStatuses(skewIncentive, positionIds, { ...callOptions });
|
|
103
|
+
const baseArray = (0, ethersTypes_1.ethersStructResponseToArray)(result, ITriggersAndPortalLensService_1.EMPTY_POSITION_SKEW_STATUS);
|
|
104
|
+
return baseArray.map(item => ({
|
|
105
|
+
...item,
|
|
106
|
+
incentiveRate: Number(item.incentiveRate),
|
|
107
|
+
openTimestamp: Number(item.openTimestamp),
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
async getSkewIncentiveAssetConfig(skewIncentive, settlementAsset, callOptions) {
|
|
111
|
+
const result = await this.contract.getSkewIncentiveAssetConfig(skewIncentive, settlementAsset, { ...callOptions });
|
|
112
|
+
const baseStruct = (0, ethersTypes_1.ethersStructResponseToObject)(result, ITriggersAndPortalLensService_1.EMPTY_SKEW_INCENTIVE_ASSET_CONFIG);
|
|
113
|
+
return {
|
|
114
|
+
...baseStruct,
|
|
115
|
+
skewThreshold: Number(baseStruct.skewThreshold),
|
|
116
|
+
incentiveRate: Number(baseStruct.incentiveRate),
|
|
117
|
+
minHoldingTime: Number(baseStruct.minHoldingTime),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
async getSkewIncentiveAssetConfigs(skewIncentive, settlementAssets, callOptions) {
|
|
121
|
+
const result = await this.contract.getSkewIncentiveAssetConfigs(skewIncentive, settlementAssets, { ...callOptions });
|
|
122
|
+
const baseArray = (0, ethersTypes_1.ethersStructResponseToArray)(result, ITriggersAndPortalLensService_1.EMPTY_SKEW_INCENTIVE_ASSET_CONFIG);
|
|
123
|
+
return baseArray.map(item => ({
|
|
124
|
+
...item,
|
|
125
|
+
skewThreshold: Number(item.skewThreshold),
|
|
126
|
+
incentiveRate: Number(item.incentiveRate),
|
|
127
|
+
minHoldingTime: Number(item.minHoldingTime),
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
130
|
+
async getSkewIncentiveGlobalConfig(skewIncentive, callOptions) {
|
|
131
|
+
const result = await this.contract.getSkewIncentiveGlobalConfig(skewIncentive, { ...callOptions });
|
|
132
|
+
const baseStruct = (0, ethersTypes_1.ethersStructResponseToObject)(result, ITriggersAndPortalLensService_1.EMPTY_SKEW_INCENTIVE_GLOBAL_CONFIG);
|
|
133
|
+
return {
|
|
134
|
+
...baseStruct,
|
|
135
|
+
activePositionCount: Number(baseStruct.activePositionCount),
|
|
136
|
+
configuredSettlementAssetCount: Number(baseStruct.configuredSettlementAssetCount),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
async getSkewIncentivePairConfig(skewIncentive, settlementAsset, pairId, callOptions) {
|
|
140
|
+
const result = await this.contract.getSkewIncentivePairConfig(skewIncentive, settlementAsset, BigInt(pairId), { ...callOptions });
|
|
141
|
+
const baseStruct = (0, ethersTypes_1.ethersStructResponseToObject)(result, ITriggersAndPortalLensService_1.EMPTY_SKEW_INCENTIVE_PAIR_CONFIG);
|
|
142
|
+
return {
|
|
143
|
+
...baseStruct,
|
|
144
|
+
pairId: Number(baseStruct.pairId),
|
|
145
|
+
skewThreshold: Number(baseStruct.skewThreshold),
|
|
146
|
+
incentiveRate: Number(baseStruct.incentiveRate),
|
|
147
|
+
minHoldingTime: Number(baseStruct.minHoldingTime),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
async getSkewIncentivePairConfigs(skewIncentive, settlementAsset, pairIds, callOptions) {
|
|
151
|
+
const result = await this.contract.getSkewIncentivePairConfigs(skewIncentive, settlementAsset, pairIds.map(id => BigInt(id)), { ...callOptions });
|
|
152
|
+
const baseArray = (0, ethersTypes_1.ethersStructResponseToArray)(result, ITriggersAndPortalLensService_1.EMPTY_SKEW_INCENTIVE_PAIR_CONFIG);
|
|
153
|
+
return baseArray.map(item => ({
|
|
154
|
+
...item,
|
|
155
|
+
pairId: Number(item.pairId),
|
|
156
|
+
skewThreshold: Number(item.skewThreshold),
|
|
157
|
+
incentiveRate: Number(item.incentiveRate),
|
|
158
|
+
minHoldingTime: Number(item.minHoldingTime),
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
async getSkewIncentiveFullConfig(skewIncentive, callOptions) {
|
|
162
|
+
const result = await this.contract.getSkewIncentiveFullConfig(skewIncentive, { ...callOptions });
|
|
163
|
+
const baseStruct = (0, ethersTypes_1.ethersStructResponseToObject)(result, ITriggersAndPortalLensService_1.EMPTY_SKEW_INCENTIVE_FULL_CONFIG, {
|
|
164
|
+
assetConfigs: ITriggersAndPortalLensService_1.EMPTY_SKEW_INCENTIVE_ASSET_CONFIG,
|
|
165
|
+
pairConfigs: ITriggersAndPortalLensService_1.EMPTY_SKEW_INCENTIVE_PAIR_CONFIG,
|
|
166
|
+
});
|
|
167
|
+
return {
|
|
168
|
+
...baseStruct,
|
|
169
|
+
activePositionCount: Number(baseStruct.activePositionCount),
|
|
170
|
+
assetConfigs: baseStruct.assetConfigs.map(item => ({
|
|
171
|
+
...item,
|
|
172
|
+
skewThreshold: Number(item.skewThreshold),
|
|
173
|
+
incentiveRate: Number(item.incentiveRate),
|
|
174
|
+
minHoldingTime: Number(item.minHoldingTime),
|
|
175
|
+
})),
|
|
176
|
+
pairConfigs: baseStruct.pairConfigs.map(item => ({
|
|
177
|
+
...item,
|
|
178
|
+
pairId: Number(item.pairId),
|
|
179
|
+
skewThreshold: Number(item.skewThreshold),
|
|
180
|
+
incentiveRate: Number(item.incentiveRate),
|
|
181
|
+
minHoldingTime: Number(item.minHoldingTime),
|
|
182
|
+
})),
|
|
183
|
+
};
|
|
184
|
+
}
|
|
101
185
|
getContract() {
|
|
102
186
|
return this.contract;
|
|
103
187
|
}
|