lynx-client 0.0.30 → 0.0.32
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/index.js +2 -0
- package/dist/cjs/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.js +12 -6
- package/dist/cjs/lib/priceFeeds/interfaces.js +2 -0
- package/dist/cjs/lib/priceFeeds/pyth/pythFeedConstants.js +1 -5
- package/dist/cjs/lib/priceFeeds/pyth/pythFeedFunctions.js +9 -1
- package/dist/cjs/lib/priceFeeds/pyth/pythPriceData.js +51 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts +6 -6
- package/dist/esm/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.js +12 -6
- package/dist/esm/lib/contractsIntegration/common/index.d.ts +10 -0
- package/dist/esm/lib/contractsIntegration/common/index.d.ts.map +1 -1
- package/dist/esm/lib/priceFeeds/interfaces.d.ts +13 -0
- package/dist/esm/lib/priceFeeds/interfaces.d.ts.map +1 -0
- package/dist/esm/lib/priceFeeds/interfaces.js +2 -0
- package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts +0 -1
- package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +1 -1
- package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.js +1 -5
- package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.d.ts +5 -0
- package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.d.ts.map +1 -1
- package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.js +9 -1
- package/dist/esm/lib/priceFeeds/pyth/pythPriceData.d.ts +10 -0
- package/dist/esm/lib/priceFeeds/pyth/pythPriceData.d.ts.map +1 -0
- package/dist/esm/lib/priceFeeds/pyth/pythPriceData.js +51 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts +6 -6
- package/dist/types/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/common/index.d.ts +10 -0
- package/dist/types/lib/contractsIntegration/common/index.d.ts.map +1 -1
- package/dist/types/lib/priceFeeds/interfaces.d.ts +13 -0
- package/dist/types/lib/priceFeeds/interfaces.d.ts.map +1 -0
- package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts +0 -1
- package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +1 -1
- package/dist/types/lib/priceFeeds/pyth/pythFeedFunctions.d.ts +5 -0
- package/dist/types/lib/priceFeeds/pyth/pythFeedFunctions.d.ts.map +1 -1
- package/dist/types/lib/priceFeeds/pyth/pythPriceData.d.ts +10 -0
- package/dist/types/lib/priceFeeds/pyth/pythPriceData.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -36,6 +36,8 @@ __exportStar(require("./lib/constants/groupIds"), exports);
|
|
|
36
36
|
__exportStar(require("./lib/constants/feeIds"), exports);
|
|
37
37
|
__exportStar(require("./lib/priceFeeds/pyth/pythFeedConstants"), exports);
|
|
38
38
|
__exportStar(require("./lib/priceFeeds/pyth/pythFeedFunctions"), exports);
|
|
39
|
+
__exportStar(require("./lib/priceFeeds/pyth/pythPriceData"), exports);
|
|
40
|
+
__exportStar(require("./lib/priceFeeds/interfaces"), exports);
|
|
39
41
|
__exportStar(require("./lib/priceFeeds/flare/flareFeedConstants"), exports);
|
|
40
42
|
__exportStar(require("./lib/priceFeeds/flare/flareFeedFunctions"), exports);
|
|
41
43
|
__exportStar(require("./lib/addresses/lensAddresses"), exports);
|
package/dist/cjs/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.js
CHANGED
|
@@ -7,9 +7,10 @@ class TraderRequests {
|
|
|
7
7
|
constructor(tradingContract) {
|
|
8
8
|
this.tradingContract = tradingContract;
|
|
9
9
|
}
|
|
10
|
-
async openNewPosition(tradeRequestIdentifier, tradeRequestParams, orderType, referrerDomain, referrerCode, runCapTests, nativeFee) {
|
|
10
|
+
async openNewPosition(tradeRequestIdentifier, tradeRequestParams, orderType, referrerDomain, referrerCode, runCapTests, nativeFee, transactionOptions) {
|
|
11
11
|
return this.tradingContract.traderRequest_openNewPosition(tradeRequestIdentifier, tradeRequestParams, orderType, referrerDomain, referrerCode, runCapTests, {
|
|
12
12
|
value: nativeFee,
|
|
13
|
+
...transactionOptions,
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
async openNewPosition_static(tradeRequestIdentifier, tradeRequestParams, orderType, referrerDomain, referrerCode, runCapTests, nativeFee) {
|
|
@@ -18,19 +19,22 @@ class TraderRequests {
|
|
|
18
19
|
value: nativeFee,
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
async setExistingPositionToMarketClose(positionId, minPrice, maxPrice, nativeFee) {
|
|
22
|
+
async setExistingPositionToMarketClose(positionId, minPrice, maxPrice, nativeFee, transactionOptions) {
|
|
22
23
|
return this.tradingContract.traderRequest_marketClosePosition(positionId, minPrice, maxPrice, {
|
|
23
24
|
value: nativeFee,
|
|
25
|
+
...transactionOptions,
|
|
24
26
|
});
|
|
25
27
|
}
|
|
26
|
-
async updatePositionSingleField(positionId, orderType, fieldValue, nativeFee) {
|
|
28
|
+
async updatePositionSingleField(positionId, orderType, fieldValue, nativeFee, transactionOptions) {
|
|
27
29
|
return this.tradingContract.traderRequest_updatePositionSingleField(positionId, orderType, fieldValue, {
|
|
28
30
|
value: nativeFee,
|
|
31
|
+
...transactionOptions,
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
|
-
async updatePositionDoubleFieldTpAndSl(positionId, tpValue, slValue, nativeFee) {
|
|
34
|
+
async updatePositionDoubleFieldTpAndSl(positionId, tpValue, slValue, nativeFee, transactionOptions) {
|
|
32
35
|
return this.tradingContract.traderRequest_updatePositionDoubleField(positionId, contractEnums_1.UpdatePositionFieldOrderTypeEnums.UPDATE_TP_AND_SL, tpValue, slValue, {
|
|
33
36
|
value: nativeFee,
|
|
37
|
+
...transactionOptions,
|
|
34
38
|
});
|
|
35
39
|
}
|
|
36
40
|
}
|
|
@@ -50,8 +54,10 @@ class DirectActions {
|
|
|
50
54
|
async cancelPendingUpdatePositionField(positionId) {
|
|
51
55
|
return this.tradingContract.directAction_timeout_updateTradeField(positionId);
|
|
52
56
|
}
|
|
53
|
-
async updatePendingPositionLimit(positionId, minPrice, maxPrice, tp, sl) {
|
|
54
|
-
return this.tradingContract.directAction_updatePendingPosition_limit(positionId, minPrice, maxPrice, tp, sl
|
|
57
|
+
async updatePendingPositionLimit(positionId, minPrice, maxPrice, tp, sl, transactionOptions) {
|
|
58
|
+
return this.tradingContract.directAction_updatePendingPosition_limit(positionId, minPrice, maxPrice, tp, sl, {
|
|
59
|
+
...transactionOptions,
|
|
60
|
+
});
|
|
55
61
|
}
|
|
56
62
|
}
|
|
57
63
|
class ContractReferences {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PYTH_PRICE_FEED_ID_TO_PAIR = exports.PYTH_PAIRS_PRICE_FEED_IDS = exports.
|
|
3
|
+
exports.PYTH_PRICE_FEED_ID_TO_PAIR = exports.PYTH_PAIRS_PRICE_FEED_IDS = exports.PYTH_PRICE_KEYS = void 0;
|
|
4
4
|
const pairIds_1 = require("../../constants/pairIds");
|
|
5
5
|
exports.PYTH_PRICE_KEYS = {
|
|
6
6
|
[pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "Crypto.BTC/USD",
|
|
@@ -30,10 +30,6 @@ exports.PYTH_PRICE_KEYS = {
|
|
|
30
30
|
[pairIds_1.PAIR_CONFIGS_IDS.USD_JPY_CAT]: "Fx.USD/JPY",
|
|
31
31
|
[pairIds_1.PAIR_CONFIGS_IDS.USD_CHF_CAT]: "Fx.USD/CHF",
|
|
32
32
|
};
|
|
33
|
-
exports.PYTH_PRICE_ENTRIES = Object.entries(exports.PYTH_PRICE_KEYS).map(([stringPariId, stringKey]) => [
|
|
34
|
-
parseFloat(stringPariId),
|
|
35
|
-
stringKey,
|
|
36
|
-
]);
|
|
37
33
|
// You can find the ids of prices at https://pyth.network/developers/price-feed-ids
|
|
38
34
|
exports.PYTH_PAIRS_PRICE_FEED_IDS = {
|
|
39
35
|
[pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPythPriceKeyForPair = getPythPriceKeyForPair;
|
|
3
4
|
exports.getPythFeedIdForPair = getPythFeedIdForPair;
|
|
4
5
|
exports.getPairIdForPythFeedId = getPairIdForPythFeedId;
|
|
5
6
|
const pythFeedConstants_1 = require("./pythFeedConstants");
|
|
@@ -7,9 +8,16 @@ const pythFeedConstants_1 = require("./pythFeedConstants");
|
|
|
7
8
|
* Get the Pyth feed id for a pair
|
|
8
9
|
* @param pairId The pair id
|
|
9
10
|
*/
|
|
10
|
-
function
|
|
11
|
+
function getPythPriceKeyForPair(pairId) {
|
|
11
12
|
return pythFeedConstants_1.PYTH_PRICE_KEYS[pairId];
|
|
12
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Get the Pyth Feed ID for Pair ID
|
|
16
|
+
* @param feedId The Pyth feed id
|
|
17
|
+
*/
|
|
18
|
+
function getPythFeedIdForPair(pairId) {
|
|
19
|
+
return pythFeedConstants_1.PYTH_PAIRS_PRICE_FEED_IDS[pairId];
|
|
20
|
+
}
|
|
13
21
|
/**
|
|
14
22
|
* Get the Pair ID for Pyth Feed ID (reversal lookup)
|
|
15
23
|
* @param feedId The Pyth feed id
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPricesForTimestamp = getPricesForTimestamp;
|
|
4
|
+
const scales_1 = require("../../constants/scales");
|
|
5
|
+
const lynxScalesUtils_1 = require("../../lynxSystem/lynxScalesUtils");
|
|
6
|
+
const bignumbers_1 = require("../../utils/bignumbers");
|
|
7
|
+
/**
|
|
8
|
+
* Helper function to parse Pyth API response data into CombinedPriceData
|
|
9
|
+
*/
|
|
10
|
+
function parseResponse(data) {
|
|
11
|
+
const encodedPrice = data.binary?.data ? `0x${data.binary.data}` : "";
|
|
12
|
+
// Handle both response formats - direct parsed[0] and nested parsed[0].price
|
|
13
|
+
const priceData = data.parsed?.[0]?.price || data.parsed?.[0];
|
|
14
|
+
if (!priceData) {
|
|
15
|
+
throw new Error("Invalid Pyth API response: missing price data");
|
|
16
|
+
}
|
|
17
|
+
const expo = priceData.expo;
|
|
18
|
+
const price = priceData.price;
|
|
19
|
+
const conf = priceData.conf;
|
|
20
|
+
const publishTime = priceData.publish_time;
|
|
21
|
+
const priceInScale = (0, bignumbers_1.floatToUnitsBn)(Number(price), scales_1.PRICES_SCALE + expo);
|
|
22
|
+
const confInScale = (0, bignumbers_1.floatToUnitsBn)(Number(conf), scales_1.PRICES_SCALE + expo);
|
|
23
|
+
return {
|
|
24
|
+
encodedPrice,
|
|
25
|
+
priceInUnits: (0, lynxScalesUtils_1.priceBnToFloat)(priceInScale),
|
|
26
|
+
priceConfidenceInUnits: (0, lynxScalesUtils_1.priceBnToFloat)(confInScale),
|
|
27
|
+
priceTimestamp: Number(publishTime),
|
|
28
|
+
priceInScale,
|
|
29
|
+
confInScale,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Fetches historical price data from Pyth for a specific timestamp or later
|
|
34
|
+
* Only searches forward in time (timestamp >= startTimestamp), never backwards
|
|
35
|
+
* @param priceFeedId - The Pyth price feed ID
|
|
36
|
+
* @param startTimestamp - The minimum timestamp to search from
|
|
37
|
+
* @param maxTimeGap - Maximum seconds to search forward from startTimestamp
|
|
38
|
+
*/
|
|
39
|
+
async function getPricesForTimestamp(priceFeedId, startTimestamp, maxTimeGap) {
|
|
40
|
+
const hermesUrl = "https://hermes.pyth.network";
|
|
41
|
+
const buildUrl = (timestamp) => `${hermesUrl}/v2/updates/price/${timestamp}?ids[]=${priceFeedId}&encoding=hex`;
|
|
42
|
+
// Try timestamps from startTimestamp onwards, incrementing by 1 second
|
|
43
|
+
for (let offset = 0; offset <= maxTimeGap; offset++) {
|
|
44
|
+
const timestamp = startTimestamp + offset;
|
|
45
|
+
const response = await fetch(buildUrl(timestamp));
|
|
46
|
+
if (response.ok) {
|
|
47
|
+
return parseResponse(await response.json());
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
throw new Error(`No price found for asset ${priceFeedId} at or within ${maxTimeGap}s after timestamp ${startTimestamp}`);
|
|
51
|
+
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export * from "./lib/constants/groupIds";
|
|
|
19
19
|
export * from "./lib/constants/feeIds";
|
|
20
20
|
export * from "./lib/priceFeeds/pyth/pythFeedConstants";
|
|
21
21
|
export * from "./lib/priceFeeds/pyth/pythFeedFunctions";
|
|
22
|
+
export * from "./lib/priceFeeds/pyth/pythPriceData";
|
|
23
|
+
export * from "./lib/priceFeeds/interfaces";
|
|
22
24
|
export * from "./lib/priceFeeds/flare/flareFeedConstants";
|
|
23
25
|
export * from "./lib/priceFeeds/flare/flareFeedFunctions";
|
|
24
26
|
export * from "./lib/addresses/lensAddresses";
|
|
@@ -28,6 +30,7 @@ export * from "./lib/contractsIntegration/TradersPortalService";
|
|
|
28
30
|
export * from "./lib/contractsIntegration/TradingFloorService";
|
|
29
31
|
export * from "./lib/contractsIntegration/TriggersService";
|
|
30
32
|
export * from "./lib/contractsIntegration/OrderBookService";
|
|
33
|
+
export type { TransactionOptions } from "./lib/contractsIntegration/common";
|
|
31
34
|
export { ChipsIntentsVerifierService } from "./lib/contractsIntegration/ChipsIntentsVerifierService";
|
|
32
35
|
export type { IChipsIntentsVerifierService } from "./lib/contractsIntegration/ChipsIntentsVerifierService";
|
|
33
36
|
export { LiquidityIntentsVerifierService } from "./lib/contractsIntegration/LiquidityIntentsVerifierService";
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AAExC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,2CAA2C,CAAC;AAE1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAE1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAEhD,cAAc,uDAAuD,CAAC;AAEtE,cAAc,iDAAi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;AAGpG,cAAc,mFAAmF,CAAC;AAGlG,cAAc,+EAA+E,CAAC;AAC9F,cAAc,6FAA6F,CAAC;AAG5G,cAAc,aAAa,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -36,6 +36,8 @@ __exportStar(require("./lib/constants/groupIds"), exports);
|
|
|
36
36
|
__exportStar(require("./lib/constants/feeIds"), exports);
|
|
37
37
|
__exportStar(require("./lib/priceFeeds/pyth/pythFeedConstants"), exports);
|
|
38
38
|
__exportStar(require("./lib/priceFeeds/pyth/pythFeedFunctions"), exports);
|
|
39
|
+
__exportStar(require("./lib/priceFeeds/pyth/pythPriceData"), exports);
|
|
40
|
+
__exportStar(require("./lib/priceFeeds/interfaces"), exports);
|
|
39
41
|
__exportStar(require("./lib/priceFeeds/flare/flareFeedConstants"), exports);
|
|
40
42
|
__exportStar(require("./lib/priceFeeds/flare/flareFeedFunctions"), exports);
|
|
41
43
|
__exportStar(require("./lib/addresses/lensAddresses"), exports);
|
|
@@ -2,24 +2,24 @@ import { BytesLike, ContractTransactionResponse } from "ethers";
|
|
|
2
2
|
import { TOpenOrderType, TUpdatePositionFieldOrderType } from "../../constants/contractEnums";
|
|
3
3
|
import { TradingFloorStructsV1 } from "../../typechain/contracts/Lynx/TradingFloor/TradingFloorV1";
|
|
4
4
|
import { TSafeBigNumberStruct } from "../../utils/ethersTypes";
|
|
5
|
-
import { ILynxVersionedContract, IPendableAdmin, IProtocolConstants } from "../common";
|
|
5
|
+
import { ILynxVersionedContract, IPendableAdmin, IProtocolConstants, TransactionOptions } from "../common";
|
|
6
6
|
type PositionRequestIdentifierStruct = TradingFloorStructsV1.PositionRequestIdentifiersStruct;
|
|
7
7
|
type PositionRequestParamsStruct = TradingFloorStructsV1.PositionRequestParamsStruct;
|
|
8
8
|
export type TPositionRequestIdentifierStruct = TSafeBigNumberStruct<PositionRequestIdentifierStruct>;
|
|
9
9
|
export type TPositionRequestParamsStruct = TSafeBigNumberStruct<PositionRequestParamsStruct>;
|
|
10
10
|
export interface ITradersPortalFunctionsGroup_TraderRequests {
|
|
11
|
-
openNewPosition(tradeRequestIdentifier: TPositionRequestIdentifierStruct, tradeRequestParams: TPositionRequestParamsStruct, orderType: TOpenOrderType, referrerDomain: BytesLike, referrerCode: BytesLike, runCapTests: boolean, nativeFee: bigint): Promise<ContractTransactionResponse>;
|
|
11
|
+
openNewPosition(tradeRequestIdentifier: TPositionRequestIdentifierStruct, tradeRequestParams: TPositionRequestParamsStruct, orderType: TOpenOrderType, referrerDomain: BytesLike, referrerCode: BytesLike, runCapTests: boolean, nativeFee: bigint, transactionOptions?: TransactionOptions): Promise<ContractTransactionResponse>;
|
|
12
12
|
openNewPosition_static(tradeRequestIdentifier: TPositionRequestIdentifierStruct, tradeRequestParams: TPositionRequestParamsStruct, orderType: TOpenOrderType, referrerDomain: BytesLike, referrerCode: BytesLike, runCapTests: boolean, nativeFee: bigint): Promise<any>;
|
|
13
|
-
setExistingPositionToMarketClose(positionId: BytesLike, minPrice: bigint, maxPrice: bigint, nativeFee: bigint): Promise<ContractTransactionResponse>;
|
|
14
|
-
updatePositionSingleField(positionId: BytesLike, orderType: TUpdatePositionFieldOrderType, fieldValue: bigint, nativeFee: bigint): Promise<ContractTransactionResponse>;
|
|
15
|
-
updatePositionDoubleFieldTpAndSl(positionId: BytesLike, tpValue: bigint, slValue: bigint, nativeFee: bigint): Promise<ContractTransactionResponse>;
|
|
13
|
+
setExistingPositionToMarketClose(positionId: BytesLike, minPrice: bigint, maxPrice: bigint, nativeFee: bigint, transactionOptions?: TransactionOptions): Promise<ContractTransactionResponse>;
|
|
14
|
+
updatePositionSingleField(positionId: BytesLike, orderType: TUpdatePositionFieldOrderType, fieldValue: bigint, nativeFee: bigint, transactionOptions?: TransactionOptions): Promise<ContractTransactionResponse>;
|
|
15
|
+
updatePositionDoubleFieldTpAndSl(positionId: BytesLike, tpValue: bigint, slValue: bigint, nativeFee: bigint, transactionOptions?: TransactionOptions): Promise<ContractTransactionResponse>;
|
|
16
16
|
}
|
|
17
17
|
export interface ITradersPortalFunctionsGroup_DirectActions {
|
|
18
18
|
timeoutOpenMarket(positionId: BytesLike): Promise<ContractTransactionResponse>;
|
|
19
19
|
timeoutCloseMarket(positionId: BytesLike): Promise<ContractTransactionResponse>;
|
|
20
20
|
cancelPendingPositionLimit(positionId: BytesLike): Promise<ContractTransactionResponse>;
|
|
21
21
|
cancelPendingUpdatePositionField(positionId: BytesLike): Promise<ContractTransactionResponse>;
|
|
22
|
-
updatePendingPositionLimit(positionId: BytesLike, minPrice: bigint, maxPrice: bigint, tp: bigint, sl: bigint): Promise<ContractTransactionResponse>;
|
|
22
|
+
updatePendingPositionLimit(positionId: BytesLike, minPrice: bigint, maxPrice: bigint, tp: bigint, sl: bigint, transactionOptions?: TransactionOptions): Promise<ContractTransactionResponse>;
|
|
23
23
|
}
|
|
24
24
|
export interface ITradersPortalFunctionsGroup_ContractReferences {
|
|
25
25
|
getOrderBook(): Promise<string>;
|
package/dist/esm/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ITradersPortalService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradersPortalService/ITradersPortalService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAE7E,OAAO,EACL,cAAc,EAEd,6BAA6B,EAC9B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ITradersPortalService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradersPortalService/ITradersPortalService.ts"],"names":[],"mappings":"AAAA,OAAO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Q,EAAE,qCAAqC,CAAC;IAChD,SAAS,EAAE,sCAAsC,CAAC;IAClD,QAAQ,EAAE,qCAAqC,CAAC;CACjD"}
|
package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TradersPortalServiceService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EACN,QAAQ,EAET,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAC;AAC/F,OAAO,EACL,qBAAqB,EACrB,2CAA2C,EAC3C,0CAA0C,EAC1C,+CAA+C,EAC/C,mCAAmC,EACnC,qCAAqC,EACrC,sCAAsC,EACtC,qCAAqC,EAGtC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"TradersPortalServiceService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EACN,QAAQ,EAET,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAC;AAC/F,OAAO,EACL,qBAAqB,EACrB,2CAA2C,EAC3C,0CAA0C,EAC1C,+CAA+C,EAC/C,mCAAmC,EACnC,qCAAqC,EACrC,sCAAsC,EACtC,qCAAqC,EAGtC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAsB,MAAM,WAAW,CAAC;AAmTvF,qBAAa,2BAA4B,YAAW,qBAAqB;IAcrE,OAAO,CAAC,gBAAgB;IAb1B,OAAO,CAAC,eAAe,CAAkB;IACzC,SAAgB,cAAc,EAAE,2CAA2C,CAAC;IAC5E,SAAgB,aAAa,EAAE,0CAA0C,CAAC;IAC1E,SAAgB,kBAAkB,EAAE,+CAA+C,CAAC;IACpF,SAAgB,aAAa,EAAE,cAAc,CAAC;IAC9C,SAAgB,qBAAqB,EAAE,sBAAsB,CAAC;IAC9D,SAAgB,MAAM,EAAE,mCAAmC,CAAC;IAC5D,SAAgB,QAAQ,EAAE,qCAAqC,CAAC;IAChE,SAAgB,SAAS,EAAE,sCAAsC,CAAC;IAClE,SAAgB,QAAQ,EAAE,qCAAqC,CAAC;gBAG9D,OAAO,EAAE,MAAM,EACP,gBAAgB,EAAE,MAAM,GAAG,QAAQ;IAkB7C,WAAW,IAAI,eAAe;CAG/B"}
|
package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.js
CHANGED
|
@@ -7,9 +7,10 @@ class TraderRequests {
|
|
|
7
7
|
constructor(tradingContract) {
|
|
8
8
|
this.tradingContract = tradingContract;
|
|
9
9
|
}
|
|
10
|
-
async openNewPosition(tradeRequestIdentifier, tradeRequestParams, orderType, referrerDomain, referrerCode, runCapTests, nativeFee) {
|
|
10
|
+
async openNewPosition(tradeRequestIdentifier, tradeRequestParams, orderType, referrerDomain, referrerCode, runCapTests, nativeFee, transactionOptions) {
|
|
11
11
|
return this.tradingContract.traderRequest_openNewPosition(tradeRequestIdentifier, tradeRequestParams, orderType, referrerDomain, referrerCode, runCapTests, {
|
|
12
12
|
value: nativeFee,
|
|
13
|
+
...transactionOptions,
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
async openNewPosition_static(tradeRequestIdentifier, tradeRequestParams, orderType, referrerDomain, referrerCode, runCapTests, nativeFee) {
|
|
@@ -18,19 +19,22 @@ class TraderRequests {
|
|
|
18
19
|
value: nativeFee,
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
async setExistingPositionToMarketClose(positionId, minPrice, maxPrice, nativeFee) {
|
|
22
|
+
async setExistingPositionToMarketClose(positionId, minPrice, maxPrice, nativeFee, transactionOptions) {
|
|
22
23
|
return this.tradingContract.traderRequest_marketClosePosition(positionId, minPrice, maxPrice, {
|
|
23
24
|
value: nativeFee,
|
|
25
|
+
...transactionOptions,
|
|
24
26
|
});
|
|
25
27
|
}
|
|
26
|
-
async updatePositionSingleField(positionId, orderType, fieldValue, nativeFee) {
|
|
28
|
+
async updatePositionSingleField(positionId, orderType, fieldValue, nativeFee, transactionOptions) {
|
|
27
29
|
return this.tradingContract.traderRequest_updatePositionSingleField(positionId, orderType, fieldValue, {
|
|
28
30
|
value: nativeFee,
|
|
31
|
+
...transactionOptions,
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
|
-
async updatePositionDoubleFieldTpAndSl(positionId, tpValue, slValue, nativeFee) {
|
|
34
|
+
async updatePositionDoubleFieldTpAndSl(positionId, tpValue, slValue, nativeFee, transactionOptions) {
|
|
32
35
|
return this.tradingContract.traderRequest_updatePositionDoubleField(positionId, contractEnums_1.UpdatePositionFieldOrderTypeEnums.UPDATE_TP_AND_SL, tpValue, slValue, {
|
|
33
36
|
value: nativeFee,
|
|
37
|
+
...transactionOptions,
|
|
34
38
|
});
|
|
35
39
|
}
|
|
36
40
|
}
|
|
@@ -50,8 +54,10 @@ class DirectActions {
|
|
|
50
54
|
async cancelPendingUpdatePositionField(positionId) {
|
|
51
55
|
return this.tradingContract.directAction_timeout_updateTradeField(positionId);
|
|
52
56
|
}
|
|
53
|
-
async updatePendingPositionLimit(positionId, minPrice, maxPrice, tp, sl) {
|
|
54
|
-
return this.tradingContract.directAction_updatePendingPosition_limit(positionId, minPrice, maxPrice, tp, sl
|
|
57
|
+
async updatePendingPositionLimit(positionId, minPrice, maxPrice, tp, sl, transactionOptions) {
|
|
58
|
+
return this.tradingContract.directAction_updatePendingPosition_limit(positionId, minPrice, maxPrice, tp, sl, {
|
|
59
|
+
...transactionOptions,
|
|
60
|
+
});
|
|
55
61
|
}
|
|
56
62
|
}
|
|
57
63
|
class ContractReferences {
|
|
@@ -2,4 +2,14 @@ export type { ILynxVersionedContract } from "./ILynxVersionedContract";
|
|
|
2
2
|
export type { IPendableAdmin } from "./IPendableAdmin";
|
|
3
3
|
export type { IPendableImplementation } from "./IPendableImplementation";
|
|
4
4
|
export type { IProtocolConstants } from "./IProtocolConstants";
|
|
5
|
+
/**
|
|
6
|
+
* Optional transaction overrides for gas settings.
|
|
7
|
+
* Compatible with ethers v6 transaction options.
|
|
8
|
+
*/
|
|
9
|
+
export interface TransactionOptions {
|
|
10
|
+
gasLimit?: bigint;
|
|
11
|
+
gasPrice?: bigint;
|
|
12
|
+
maxFeePerGas?: bigint;
|
|
13
|
+
maxPriorityFeePerGas?: bigint;
|
|
14
|
+
}
|
|
5
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/common/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACtE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,YAAY,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACxE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/common/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACtE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,YAAY,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACxE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAE9D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PriceData {
|
|
2
|
+
encodedPrice: string;
|
|
3
|
+
priceInUnits: number;
|
|
4
|
+
priceTimestamp: number;
|
|
5
|
+
priceConfidenceInUnits: number;
|
|
6
|
+
fee?: bigint;
|
|
7
|
+
}
|
|
8
|
+
export interface RawPriceData {
|
|
9
|
+
priceInScale: bigint;
|
|
10
|
+
confInScale: bigint;
|
|
11
|
+
}
|
|
12
|
+
export type CombinedPriceData = RawPriceData & PriceData;
|
|
13
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../lib/priceFeeds/interfaces.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,SAAS,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TPairIds } from "../../constants/pairIds";
|
|
2
2
|
export declare const PYTH_PRICE_KEYS: Record<TPairIds, string>;
|
|
3
|
-
export declare const PYTH_PRICE_ENTRIES: [TPairIds, string][];
|
|
4
3
|
export declare const PYTH_PAIRS_PRICE_FEED_IDS: Record<TPairIds, string>;
|
|
5
4
|
export declare const PYTH_PRICE_FEED_ID_TO_PAIR: Record<string, TPairIds>;
|
|
6
5
|
//# sourceMappingURL=pythFeedConstants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythFeedConstants.d.ts","sourceRoot":"","sources":["../../../../../lib/priceFeeds/pyth/pythFeedConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAErE,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAgCpD,CAAC;
|
|
1
|
+
{"version":3,"file":"pythFeedConstants.d.ts","sourceRoot":"","sources":["../../../../../lib/priceFeeds/pyth/pythFeedConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAErE,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAgCpD,CAAC;AAGF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAyC9D,CAAC;AAGF,eAAO,MAAM,0BAA0B,0BAKjC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PYTH_PRICE_FEED_ID_TO_PAIR = exports.PYTH_PAIRS_PRICE_FEED_IDS = exports.
|
|
3
|
+
exports.PYTH_PRICE_FEED_ID_TO_PAIR = exports.PYTH_PAIRS_PRICE_FEED_IDS = exports.PYTH_PRICE_KEYS = void 0;
|
|
4
4
|
const pairIds_1 = require("../../constants/pairIds");
|
|
5
5
|
exports.PYTH_PRICE_KEYS = {
|
|
6
6
|
[pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "Crypto.BTC/USD",
|
|
@@ -30,10 +30,6 @@ exports.PYTH_PRICE_KEYS = {
|
|
|
30
30
|
[pairIds_1.PAIR_CONFIGS_IDS.USD_JPY_CAT]: "Fx.USD/JPY",
|
|
31
31
|
[pairIds_1.PAIR_CONFIGS_IDS.USD_CHF_CAT]: "Fx.USD/CHF",
|
|
32
32
|
};
|
|
33
|
-
exports.PYTH_PRICE_ENTRIES = Object.entries(exports.PYTH_PRICE_KEYS).map(([stringPariId, stringKey]) => [
|
|
34
|
-
parseFloat(stringPariId),
|
|
35
|
-
stringKey,
|
|
36
|
-
]);
|
|
37
33
|
// You can find the ids of prices at https://pyth.network/developers/price-feed-ids
|
|
38
34
|
exports.PYTH_PAIRS_PRICE_FEED_IDS = {
|
|
39
35
|
[pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
|
|
@@ -3,6 +3,11 @@ import { TPairIds } from "../../constants/pairIds";
|
|
|
3
3
|
* Get the Pyth feed id for a pair
|
|
4
4
|
* @param pairId The pair id
|
|
5
5
|
*/
|
|
6
|
+
export declare function getPythPriceKeyForPair(pairId: TPairIds): string;
|
|
7
|
+
/**
|
|
8
|
+
* Get the Pyth Feed ID for Pair ID
|
|
9
|
+
* @param feedId The Pyth feed id
|
|
10
|
+
*/
|
|
6
11
|
export declare function getPythFeedIdForPair(pairId: TPairIds): string;
|
|
7
12
|
/**
|
|
8
13
|
* Get the Pair ID for Pyth Feed ID (reversal lookup)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythFeedFunctions.d.ts","sourceRoot":"","sources":["../../../../../lib/priceFeeds/pyth/pythFeedFunctions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pythFeedFunctions.d.ts","sourceRoot":"","sources":["../../../../../lib/priceFeeds/pyth/pythFeedFunctions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAE/D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAE7D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAE/D"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPythPriceKeyForPair = getPythPriceKeyForPair;
|
|
3
4
|
exports.getPythFeedIdForPair = getPythFeedIdForPair;
|
|
4
5
|
exports.getPairIdForPythFeedId = getPairIdForPythFeedId;
|
|
5
6
|
const pythFeedConstants_1 = require("./pythFeedConstants");
|
|
@@ -7,9 +8,16 @@ const pythFeedConstants_1 = require("./pythFeedConstants");
|
|
|
7
8
|
* Get the Pyth feed id for a pair
|
|
8
9
|
* @param pairId The pair id
|
|
9
10
|
*/
|
|
10
|
-
function
|
|
11
|
+
function getPythPriceKeyForPair(pairId) {
|
|
11
12
|
return pythFeedConstants_1.PYTH_PRICE_KEYS[pairId];
|
|
12
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Get the Pyth Feed ID for Pair ID
|
|
16
|
+
* @param feedId The Pyth feed id
|
|
17
|
+
*/
|
|
18
|
+
function getPythFeedIdForPair(pairId) {
|
|
19
|
+
return pythFeedConstants_1.PYTH_PAIRS_PRICE_FEED_IDS[pairId];
|
|
20
|
+
}
|
|
13
21
|
/**
|
|
14
22
|
* Get the Pair ID for Pyth Feed ID (reversal lookup)
|
|
15
23
|
* @param feedId The Pyth feed id
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CombinedPriceData } from "../interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Fetches historical price data from Pyth for a specific timestamp or later
|
|
4
|
+
* Only searches forward in time (timestamp >= startTimestamp), never backwards
|
|
5
|
+
* @param priceFeedId - The Pyth price feed ID
|
|
6
|
+
* @param startTimestamp - The minimum timestamp to search from
|
|
7
|
+
* @param maxTimeGap - Maximum seconds to search forward from startTimestamp
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPricesForTimestamp(priceFeedId: string, startTimestamp: number, maxTimeGap: number): Promise<CombinedPriceData>;
|
|
10
|
+
//# sourceMappingURL=pythPriceData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pythPriceData.d.ts","sourceRoot":"","sources":["../../../../../lib/priceFeeds/pyth/pythPriceData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAgClD;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAiB5B"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPricesForTimestamp = getPricesForTimestamp;
|
|
4
|
+
const scales_1 = require("../../constants/scales");
|
|
5
|
+
const lynxScalesUtils_1 = require("../../lynxSystem/lynxScalesUtils");
|
|
6
|
+
const bignumbers_1 = require("../../utils/bignumbers");
|
|
7
|
+
/**
|
|
8
|
+
* Helper function to parse Pyth API response data into CombinedPriceData
|
|
9
|
+
*/
|
|
10
|
+
function parseResponse(data) {
|
|
11
|
+
const encodedPrice = data.binary?.data ? `0x${data.binary.data}` : "";
|
|
12
|
+
// Handle both response formats - direct parsed[0] and nested parsed[0].price
|
|
13
|
+
const priceData = data.parsed?.[0]?.price || data.parsed?.[0];
|
|
14
|
+
if (!priceData) {
|
|
15
|
+
throw new Error("Invalid Pyth API response: missing price data");
|
|
16
|
+
}
|
|
17
|
+
const expo = priceData.expo;
|
|
18
|
+
const price = priceData.price;
|
|
19
|
+
const conf = priceData.conf;
|
|
20
|
+
const publishTime = priceData.publish_time;
|
|
21
|
+
const priceInScale = (0, bignumbers_1.floatToUnitsBn)(Number(price), scales_1.PRICES_SCALE + expo);
|
|
22
|
+
const confInScale = (0, bignumbers_1.floatToUnitsBn)(Number(conf), scales_1.PRICES_SCALE + expo);
|
|
23
|
+
return {
|
|
24
|
+
encodedPrice,
|
|
25
|
+
priceInUnits: (0, lynxScalesUtils_1.priceBnToFloat)(priceInScale),
|
|
26
|
+
priceConfidenceInUnits: (0, lynxScalesUtils_1.priceBnToFloat)(confInScale),
|
|
27
|
+
priceTimestamp: Number(publishTime),
|
|
28
|
+
priceInScale,
|
|
29
|
+
confInScale,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Fetches historical price data from Pyth for a specific timestamp or later
|
|
34
|
+
* Only searches forward in time (timestamp >= startTimestamp), never backwards
|
|
35
|
+
* @param priceFeedId - The Pyth price feed ID
|
|
36
|
+
* @param startTimestamp - The minimum timestamp to search from
|
|
37
|
+
* @param maxTimeGap - Maximum seconds to search forward from startTimestamp
|
|
38
|
+
*/
|
|
39
|
+
async function getPricesForTimestamp(priceFeedId, startTimestamp, maxTimeGap) {
|
|
40
|
+
const hermesUrl = "https://hermes.pyth.network";
|
|
41
|
+
const buildUrl = (timestamp) => `${hermesUrl}/v2/updates/price/${timestamp}?ids[]=${priceFeedId}&encoding=hex`;
|
|
42
|
+
// Try timestamps from startTimestamp onwards, incrementing by 1 second
|
|
43
|
+
for (let offset = 0; offset <= maxTimeGap; offset++) {
|
|
44
|
+
const timestamp = startTimestamp + offset;
|
|
45
|
+
const response = await fetch(buildUrl(timestamp));
|
|
46
|
+
if (response.ok) {
|
|
47
|
+
return parseResponse(await response.json());
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
throw new Error(`No price found for asset ${priceFeedId} at or within ${maxTimeGap}s after timestamp ${startTimestamp}`);
|
|
51
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export * from "./lib/constants/groupIds";
|
|
|
19
19
|
export * from "./lib/constants/feeIds";
|
|
20
20
|
export * from "./lib/priceFeeds/pyth/pythFeedConstants";
|
|
21
21
|
export * from "./lib/priceFeeds/pyth/pythFeedFunctions";
|
|
22
|
+
export * from "./lib/priceFeeds/pyth/pythPriceData";
|
|
23
|
+
export * from "./lib/priceFeeds/interfaces";
|
|
22
24
|
export * from "./lib/priceFeeds/flare/flareFeedConstants";
|
|
23
25
|
export * from "./lib/priceFeeds/flare/flareFeedFunctions";
|
|
24
26
|
export * from "./lib/addresses/lensAddresses";
|
|
@@ -28,6 +30,7 @@ export * from "./lib/contractsIntegration/TradersPortalService";
|
|
|
28
30
|
export * from "./lib/contractsIntegration/TradingFloorService";
|
|
29
31
|
export * from "./lib/contractsIntegration/TriggersService";
|
|
30
32
|
export * from "./lib/contractsIntegration/OrderBookService";
|
|
33
|
+
export type { TransactionOptions } from "./lib/contractsIntegration/common";
|
|
31
34
|
export { ChipsIntentsVerifierService } from "./lib/contractsIntegration/ChipsIntentsVerifierService";
|
|
32
35
|
export type { IChipsIntentsVerifierService } from "./lib/contractsIntegration/ChipsIntentsVerifierService";
|
|
33
36
|
export { LiquidityIntentsVerifierService } from "./lib/contractsIntegration/LiquidityIntentsVerifierService";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AAExC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,2CAA2C,CAAC;AAE1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAA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9F,cAAc,4EAA4E,CAAC;AAG3F,cAAc,0FAA0F,CAAC;AACzG,cAAc,8FAA8F,CAAC;AAC7G,cAAc,0FAA0F,CAAC;AAGzG,cAAc,qFAAqF,CAAC;AAGpG,cAAc,mFAAmF,CAAC;AAGlG,cAAc,+EAA+E,CAAC;AAC9F,cAAc,6FAA6F,CAAC;AAG5G,cAAc,aAAa,CAAC"}
|
|
@@ -2,24 +2,24 @@ import { BytesLike, ContractTransactionResponse } from "ethers";
|
|
|
2
2
|
import { TOpenOrderType, TUpdatePositionFieldOrderType } from "../../constants/contractEnums";
|
|
3
3
|
import { TradingFloorStructsV1 } from "../../typechain/contracts/Lynx/TradingFloor/TradingFloorV1";
|
|
4
4
|
import { TSafeBigNumberStruct } from "../../utils/ethersTypes";
|
|
5
|
-
import { ILynxVersionedContract, IPendableAdmin, IProtocolConstants } from "../common";
|
|
5
|
+
import { ILynxVersionedContract, IPendableAdmin, IProtocolConstants, TransactionOptions } from "../common";
|
|
6
6
|
type PositionRequestIdentifierStruct = TradingFloorStructsV1.PositionRequestIdentifiersStruct;
|
|
7
7
|
type PositionRequestParamsStruct = TradingFloorStructsV1.PositionRequestParamsStruct;
|
|
8
8
|
export type TPositionRequestIdentifierStruct = TSafeBigNumberStruct<PositionRequestIdentifierStruct>;
|
|
9
9
|
export type TPositionRequestParamsStruct = TSafeBigNumberStruct<PositionRequestParamsStruct>;
|
|
10
10
|
export interface ITradersPortalFunctionsGroup_TraderRequests {
|
|
11
|
-
openNewPosition(tradeRequestIdentifier: TPositionRequestIdentifierStruct, tradeRequestParams: TPositionRequestParamsStruct, orderType: TOpenOrderType, referrerDomain: BytesLike, referrerCode: BytesLike, runCapTests: boolean, nativeFee: bigint): Promise<ContractTransactionResponse>;
|
|
11
|
+
openNewPosition(tradeRequestIdentifier: TPositionRequestIdentifierStruct, tradeRequestParams: TPositionRequestParamsStruct, orderType: TOpenOrderType, referrerDomain: BytesLike, referrerCode: BytesLike, runCapTests: boolean, nativeFee: bigint, transactionOptions?: TransactionOptions): Promise<ContractTransactionResponse>;
|
|
12
12
|
openNewPosition_static(tradeRequestIdentifier: TPositionRequestIdentifierStruct, tradeRequestParams: TPositionRequestParamsStruct, orderType: TOpenOrderType, referrerDomain: BytesLike, referrerCode: BytesLike, runCapTests: boolean, nativeFee: bigint): Promise<any>;
|
|
13
|
-
setExistingPositionToMarketClose(positionId: BytesLike, minPrice: bigint, maxPrice: bigint, nativeFee: bigint): Promise<ContractTransactionResponse>;
|
|
14
|
-
updatePositionSingleField(positionId: BytesLike, orderType: TUpdatePositionFieldOrderType, fieldValue: bigint, nativeFee: bigint): Promise<ContractTransactionResponse>;
|
|
15
|
-
updatePositionDoubleFieldTpAndSl(positionId: BytesLike, tpValue: bigint, slValue: bigint, nativeFee: bigint): Promise<ContractTransactionResponse>;
|
|
13
|
+
setExistingPositionToMarketClose(positionId: BytesLike, minPrice: bigint, maxPrice: bigint, nativeFee: bigint, transactionOptions?: TransactionOptions): Promise<ContractTransactionResponse>;
|
|
14
|
+
updatePositionSingleField(positionId: BytesLike, orderType: TUpdatePositionFieldOrderType, fieldValue: bigint, nativeFee: bigint, transactionOptions?: TransactionOptions): Promise<ContractTransactionResponse>;
|
|
15
|
+
updatePositionDoubleFieldTpAndSl(positionId: BytesLike, tpValue: bigint, slValue: bigint, nativeFee: bigint, transactionOptions?: TransactionOptions): Promise<ContractTransactionResponse>;
|
|
16
16
|
}
|
|
17
17
|
export interface ITradersPortalFunctionsGroup_DirectActions {
|
|
18
18
|
timeoutOpenMarket(positionId: BytesLike): Promise<ContractTransactionResponse>;
|
|
19
19
|
timeoutCloseMarket(positionId: BytesLike): Promise<ContractTransactionResponse>;
|
|
20
20
|
cancelPendingPositionLimit(positionId: BytesLike): Promise<ContractTransactionResponse>;
|
|
21
21
|
cancelPendingUpdatePositionField(positionId: BytesLike): Promise<ContractTransactionResponse>;
|
|
22
|
-
updatePendingPositionLimit(positionId: BytesLike, minPrice: bigint, maxPrice: bigint, tp: bigint, sl: bigint): Promise<ContractTransactionResponse>;
|
|
22
|
+
updatePendingPositionLimit(positionId: BytesLike, minPrice: bigint, maxPrice: bigint, tp: bigint, sl: bigint, transactionOptions?: TransactionOptions): Promise<ContractTransactionResponse>;
|
|
23
23
|
}
|
|
24
24
|
export interface ITradersPortalFunctionsGroup_ContractReferences {
|
|
25
25
|
getOrderBook(): Promise<string>;
|
package/dist/types/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ITradersPortalService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradersPortalService/ITradersPortalService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAE7E,OAAO,EACL,cAAc,EAEd,6BAA6B,EAC9B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ITradersPortalService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradersPortalService/ITradersPortalService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAE7E,OAAO,EACL,cAAc,EAEd,6BAA6B,EAC9B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE3G,KAAK,+BAA+B,GAClC,qBAAqB,CAAC,gC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AAC,CAAC;IACvC,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACvC,yBAAyB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7C,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,uBAAuB,CAAC,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;CAC7F;AAED,MAAM,WAAW,sCAAuC,SAAQ,kBAAkB;IAEhF,yBAAyB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAG7C,0BAA0B,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,qCAAqC;IACpD,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,2CAA2C,CAAC;IAC5D,aAAa,EAAE,0CAA0C,CAAC;IAC1D,kBAAkB,EAAE,+CAA+C,CAAC;IACpE,aAAa,EAAE,cAAc,CAAC;IAC9B,qBAAqB,EAAE,sBAAsB,CAAC;IAC9C,MAAM,EAAE,mCAAmC,CAAC;IAC5C,QAAQ,EAAE,qCAAqC,CAAC;IAChD,SAAS,EAAE,sCAAsC,CAAC;IAClD,QAAQ,EAAE,qCAAqC,CAAC;CACjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TradersPortalServiceService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EACN,QAAQ,EAET,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAC;AAC/F,OAAO,EACL,qBAAqB,EACrB,2CAA2C,EAC3C,0CAA0C,EAC1C,+CAA+C,EAC/C,mCAAmC,EACnC,qCAAqC,EACrC,sCAAsC,EACtC,qCAAqC,EAGtC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"TradersPortalServiceService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EACN,QAAQ,EAET,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAC;AAC/F,OAAO,EACL,qBAAqB,EACrB,2CAA2C,EAC3C,0CAA0C,EAC1C,+CAA+C,EAC/C,mCAAmC,EACnC,qCAAqC,EACrC,sCAAsC,EACtC,qCAAqC,EAGtC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAsB,MAAM,WAAW,CAAC;AAmTvF,qBAAa,2BAA4B,YAAW,qBAAqB;IAcrE,OAAO,CAAC,gBAAgB;IAb1B,OAAO,CAAC,eAAe,CAAkB;IACzC,SAAgB,cAAc,EAAE,2CAA2C,CAAC;IAC5E,SAAgB,aAAa,EAAE,0CAA0C,CAAC;IAC1E,SAAgB,kBAAkB,EAAE,+CAA+C,CAAC;IACpF,SAAgB,aAAa,EAAE,cAAc,CAAC;IAC9C,SAAgB,qBAAqB,EAAE,sBAAsB,CAAC;IAC9D,SAAgB,MAAM,EAAE,mCAAmC,CAAC;IAC5D,SAAgB,QAAQ,EAAE,qCAAqC,CAAC;IAChE,SAAgB,SAAS,EAAE,sCAAsC,CAAC;IAClE,SAAgB,QAAQ,EAAE,qCAAqC,CAAC;gBAG9D,OAAO,EAAE,MAAM,EACP,gBAAgB,EAAE,MAAM,GAAG,QAAQ;IAkB7C,WAAW,IAAI,eAAe;CAG/B"}
|
|
@@ -2,4 +2,14 @@ export type { ILynxVersionedContract } from "./ILynxVersionedContract";
|
|
|
2
2
|
export type { IPendableAdmin } from "./IPendableAdmin";
|
|
3
3
|
export type { IPendableImplementation } from "./IPendableImplementation";
|
|
4
4
|
export type { IProtocolConstants } from "./IProtocolConstants";
|
|
5
|
+
/**
|
|
6
|
+
* Optional transaction overrides for gas settings.
|
|
7
|
+
* Compatible with ethers v6 transaction options.
|
|
8
|
+
*/
|
|
9
|
+
export interface TransactionOptions {
|
|
10
|
+
gasLimit?: bigint;
|
|
11
|
+
gasPrice?: bigint;
|
|
12
|
+
maxFeePerGas?: bigint;
|
|
13
|
+
maxPriorityFeePerGas?: bigint;
|
|
14
|
+
}
|
|
5
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/common/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACtE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,YAAY,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACxE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/common/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACtE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,YAAY,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACxE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAE9D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PriceData {
|
|
2
|
+
encodedPrice: string;
|
|
3
|
+
priceInUnits: number;
|
|
4
|
+
priceTimestamp: number;
|
|
5
|
+
priceConfidenceInUnits: number;
|
|
6
|
+
fee?: bigint;
|
|
7
|
+
}
|
|
8
|
+
export interface RawPriceData {
|
|
9
|
+
priceInScale: bigint;
|
|
10
|
+
confInScale: bigint;
|
|
11
|
+
}
|
|
12
|
+
export type CombinedPriceData = RawPriceData & PriceData;
|
|
13
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../lib/priceFeeds/interfaces.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,SAAS,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TPairIds } from "../../constants/pairIds";
|
|
2
2
|
export declare const PYTH_PRICE_KEYS: Record<TPairIds, string>;
|
|
3
|
-
export declare const PYTH_PRICE_ENTRIES: [TPairIds, string][];
|
|
4
3
|
export declare const PYTH_PAIRS_PRICE_FEED_IDS: Record<TPairIds, string>;
|
|
5
4
|
export declare const PYTH_PRICE_FEED_ID_TO_PAIR: Record<string, TPairIds>;
|
|
6
5
|
//# sourceMappingURL=pythFeedConstants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythFeedConstants.d.ts","sourceRoot":"","sources":["../../../../../lib/priceFeeds/pyth/pythFeedConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAErE,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAgCpD,CAAC;
|
|
1
|
+
{"version":3,"file":"pythFeedConstants.d.ts","sourceRoot":"","sources":["../../../../../lib/priceFeeds/pyth/pythFeedConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAErE,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAgCpD,CAAC;AAGF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAyC9D,CAAC;AAGF,eAAO,MAAM,0BAA0B,0BAKjC,CAAC"}
|
|
@@ -3,6 +3,11 @@ import { TPairIds } from "../../constants/pairIds";
|
|
|
3
3
|
* Get the Pyth feed id for a pair
|
|
4
4
|
* @param pairId The pair id
|
|
5
5
|
*/
|
|
6
|
+
export declare function getPythPriceKeyForPair(pairId: TPairIds): string;
|
|
7
|
+
/**
|
|
8
|
+
* Get the Pyth Feed ID for Pair ID
|
|
9
|
+
* @param feedId The Pyth feed id
|
|
10
|
+
*/
|
|
6
11
|
export declare function getPythFeedIdForPair(pairId: TPairIds): string;
|
|
7
12
|
/**
|
|
8
13
|
* Get the Pair ID for Pyth Feed ID (reversal lookup)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythFeedFunctions.d.ts","sourceRoot":"","sources":["../../../../../lib/priceFeeds/pyth/pythFeedFunctions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pythFeedFunctions.d.ts","sourceRoot":"","sources":["../../../../../lib/priceFeeds/pyth/pythFeedFunctions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAE/D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAE7D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAE/D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CombinedPriceData } from "../interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Fetches historical price data from Pyth for a specific timestamp or later
|
|
4
|
+
* Only searches forward in time (timestamp >= startTimestamp), never backwards
|
|
5
|
+
* @param priceFeedId - The Pyth price feed ID
|
|
6
|
+
* @param startTimestamp - The minimum timestamp to search from
|
|
7
|
+
* @param maxTimeGap - Maximum seconds to search forward from startTimestamp
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPricesForTimestamp(priceFeedId: string, startTimestamp: number, maxTimeGap: number): Promise<CombinedPriceData>;
|
|
10
|
+
//# sourceMappingURL=pythPriceData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pythPriceData.d.ts","sourceRoot":"","sources":["../../../../../lib/priceFeeds/pyth/pythPriceData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAgClD;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAiB5B"}
|