lynx-client 0.0.1-beta.1
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/README.md +4 -0
- package/dist/cjs/addresses/lensAddresses.js +29 -0
- package/dist/cjs/common/constants/contractEnums.js +138 -0
- package/dist/cjs/common/constants/feeIds.js +27 -0
- package/dist/cjs/common/constants/generalConstants.js +4 -0
- package/dist/cjs/common/constants/groupIds.js +27 -0
- package/dist/cjs/common/constants/pairIds.js +91 -0
- package/dist/cjs/common/constants/scales.js +24 -0
- package/dist/cjs/common/contractsIntegration/deployedContractsConnector.js +16 -0
- package/dist/cjs/common/priceFeeds/pyth/pythFeedConstants.js +63 -0
- package/dist/cjs/common/priceFeeds/pyth/pythFeedFunctions.js +11 -0
- package/dist/cjs/common/typechain/common.js +2 -0
- package/dist/cjs/common/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.js +2 -0
- package/dist/cjs/common/typechain/contracts/Peripheral/Lens/LexLens.js +2 -0
- package/dist/cjs/common/typechain/contracts/Peripheral/Lens/TradingFloorLens.js +2 -0
- package/dist/cjs/common/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.js +2 -0
- package/dist/cjs/common/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.js +201 -0
- package/dist/cjs/common/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +2269 -0
- package/dist/cjs/common/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +1339 -0
- package/dist/cjs/common/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +253 -0
- package/dist/cjs/index.js +46 -0
- package/dist/cjs/utils/addresses.js +14 -0
- package/dist/cjs/utils/bignumbers.js +35 -0
- package/dist/cjs/utils/chainTypes.js +20 -0
- package/dist/cjs/utils/chipsCalculationsUtils.js +12 -0
- package/dist/cjs/utils/cloning.js +17 -0
- package/dist/cjs/utils/enumTypes.js +2 -0
- package/dist/cjs/utils/ethersTypes.js +51 -0
- package/dist/cjs/utils/hashes.js +8 -0
- package/dist/cjs/utils/leverageCalculationsUtils.js +25 -0
- package/dist/cjs/utils/lynxScalesUtils.js +20 -0
- package/dist/cjs/utils/types.js +3 -0
- package/dist/esm/addresses/lensAddresses.d.ts +27 -0
- package/dist/esm/addresses/lensAddresses.d.ts.map +1 -0
- package/dist/esm/addresses/lensAddresses.js +29 -0
- package/dist/esm/common/constants/contractEnums.d.ts +148 -0
- package/dist/esm/common/constants/contractEnums.d.ts.map +1 -0
- package/dist/esm/common/constants/contractEnums.js +138 -0
- package/dist/esm/common/constants/feeIds.d.ts +13 -0
- package/dist/esm/common/constants/feeIds.d.ts.map +1 -0
- package/dist/esm/common/constants/feeIds.js +27 -0
- package/dist/esm/common/constants/generalConstants.d.ts +2 -0
- package/dist/esm/common/constants/generalConstants.d.ts.map +1 -0
- package/dist/esm/common/constants/generalConstants.js +4 -0
- package/dist/esm/common/constants/groupIds.d.ts +15 -0
- package/dist/esm/common/constants/groupIds.d.ts.map +1 -0
- package/dist/esm/common/constants/groupIds.js +27 -0
- package/dist/esm/common/constants/pairIds.d.ts +40 -0
- package/dist/esm/common/constants/pairIds.d.ts.map +1 -0
- package/dist/esm/common/constants/pairIds.js +91 -0
- package/dist/esm/common/constants/scales.d.ts +16 -0
- package/dist/esm/common/constants/scales.d.ts.map +1 -0
- package/dist/esm/common/constants/scales.js +24 -0
- package/dist/esm/common/contractsIntegration/deployedContractsConnector.d.ts +7 -0
- package/dist/esm/common/contractsIntegration/deployedContractsConnector.d.ts.map +1 -0
- package/dist/esm/common/contractsIntegration/deployedContractsConnector.js +16 -0
- package/dist/esm/common/priceFeeds/pyth/pythFeedConstants.d.ts +5 -0
- package/dist/esm/common/priceFeeds/pyth/pythFeedConstants.d.ts.map +1 -0
- package/dist/esm/common/priceFeeds/pyth/pythFeedConstants.js +63 -0
- package/dist/esm/common/priceFeeds/pyth/pythFeedFunctions.d.ts +7 -0
- package/dist/esm/common/priceFeeds/pyth/pythFeedFunctions.d.ts.map +1 -0
- package/dist/esm/common/priceFeeds/pyth/pythFeedFunctions.js +11 -0
- package/dist/esm/common/typechain/common.d.ts +51 -0
- package/dist/esm/common/typechain/common.d.ts.map +1 -0
- package/dist/esm/common/typechain/common.js +2 -0
- package/dist/esm/common/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts +102 -0
- package/dist/esm/common/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts.map +1 -0
- package/dist/esm/common/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.js +2 -0
- package/dist/esm/common/typechain/contracts/Peripheral/Lens/LexLens.d.ts +740 -0
- package/dist/esm/common/typechain/contracts/Peripheral/Lens/LexLens.d.ts.map +1 -0
- package/dist/esm/common/typechain/contracts/Peripheral/Lens/LexLens.js +2 -0
- package/dist/esm/common/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +390 -0
- package/dist/esm/common/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -0
- package/dist/esm/common/typechain/contracts/Peripheral/Lens/TradingFloorLens.js +2 -0
- package/dist/esm/common/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.d.ts +152 -0
- package/dist/esm/common/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.d.ts.map +1 -0
- package/dist/esm/common/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.js +2 -0
- package/dist/esm/common/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts +146 -0
- package/dist/esm/common/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts.map +1 -0
- package/dist/esm/common/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.js +201 -0
- package/dist/esm/common/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1747 -0
- package/dist/esm/common/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts.map +1 -0
- package/dist/esm/common/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +2269 -0
- package/dist/esm/common/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +1042 -0
- package/dist/esm/common/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -0
- package/dist/esm/common/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +1339 -0
- package/dist/esm/common/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +187 -0
- package/dist/esm/common/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts.map +1 -0
- package/dist/esm/common/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +253 -0
- package/dist/esm/index.d.ts +30 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +46 -0
- package/dist/esm/utils/addresses.d.ts +4 -0
- package/dist/esm/utils/addresses.d.ts.map +1 -0
- package/dist/esm/utils/addresses.js +14 -0
- package/dist/esm/utils/bignumbers.d.ts +6 -0
- package/dist/esm/utils/bignumbers.d.ts.map +1 -0
- package/dist/esm/utils/bignumbers.js +35 -0
- package/dist/esm/utils/chainTypes.d.ts +137 -0
- package/dist/esm/utils/chainTypes.d.ts.map +1 -0
- package/dist/esm/utils/chainTypes.js +20 -0
- package/dist/esm/utils/chipsCalculationsUtils.d.ts +3 -0
- package/dist/esm/utils/chipsCalculationsUtils.d.ts.map +1 -0
- package/dist/esm/utils/chipsCalculationsUtils.js +12 -0
- package/dist/esm/utils/cloning.d.ts +6 -0
- package/dist/esm/utils/cloning.d.ts.map +1 -0
- package/dist/esm/utils/cloning.js +17 -0
- package/dist/esm/utils/enumTypes.d.ts +2 -0
- package/dist/esm/utils/enumTypes.d.ts.map +1 -0
- package/dist/esm/utils/enumTypes.js +2 -0
- package/dist/esm/utils/ethersTypes.d.ts +14 -0
- package/dist/esm/utils/ethersTypes.d.ts.map +1 -0
- package/dist/esm/utils/ethersTypes.js +51 -0
- package/dist/esm/utils/hashes.d.ts +2 -0
- package/dist/esm/utils/hashes.d.ts.map +1 -0
- package/dist/esm/utils/hashes.js +8 -0
- package/dist/esm/utils/leverageCalculationsUtils.d.ts +6 -0
- package/dist/esm/utils/leverageCalculationsUtils.d.ts.map +1 -0
- package/dist/esm/utils/leverageCalculationsUtils.js +25 -0
- package/dist/esm/utils/lynxScalesUtils.d.ts +5 -0
- package/dist/esm/utils/lynxScalesUtils.d.ts.map +1 -0
- package/dist/esm/utils/lynxScalesUtils.js +20 -0
- package/dist/esm/utils/types.d.ts +7 -0
- package/dist/esm/utils/types.d.ts.map +1 -0
- package/dist/esm/utils/types.js +3 -0
- package/dist/types/addresses/lensAddresses.d.ts +27 -0
- package/dist/types/addresses/lensAddresses.d.ts.map +1 -0
- package/dist/types/common/constants/contractEnums.d.ts +148 -0
- package/dist/types/common/constants/contractEnums.d.ts.map +1 -0
- package/dist/types/common/constants/feeIds.d.ts +13 -0
- package/dist/types/common/constants/feeIds.d.ts.map +1 -0
- package/dist/types/common/constants/generalConstants.d.ts +2 -0
- package/dist/types/common/constants/generalConstants.d.ts.map +1 -0
- package/dist/types/common/constants/groupIds.d.ts +15 -0
- package/dist/types/common/constants/groupIds.d.ts.map +1 -0
- package/dist/types/common/constants/pairIds.d.ts +40 -0
- package/dist/types/common/constants/pairIds.d.ts.map +1 -0
- package/dist/types/common/constants/scales.d.ts +16 -0
- package/dist/types/common/constants/scales.d.ts.map +1 -0
- package/dist/types/common/contractsIntegration/deployedContractsConnector.d.ts +7 -0
- package/dist/types/common/contractsIntegration/deployedContractsConnector.d.ts.map +1 -0
- package/dist/types/common/priceFeeds/pyth/pythFeedConstants.d.ts +5 -0
- package/dist/types/common/priceFeeds/pyth/pythFeedConstants.d.ts.map +1 -0
- package/dist/types/common/priceFeeds/pyth/pythFeedFunctions.d.ts +7 -0
- package/dist/types/common/priceFeeds/pyth/pythFeedFunctions.d.ts.map +1 -0
- package/dist/types/common/typechain/common.d.ts +51 -0
- package/dist/types/common/typechain/common.d.ts.map +1 -0
- package/dist/types/common/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts +102 -0
- package/dist/types/common/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts.map +1 -0
- package/dist/types/common/typechain/contracts/Peripheral/Lens/LexLens.d.ts +740 -0
- package/dist/types/common/typechain/contracts/Peripheral/Lens/LexLens.d.ts.map +1 -0
- package/dist/types/common/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +390 -0
- package/dist/types/common/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -0
- package/dist/types/common/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.d.ts +152 -0
- package/dist/types/common/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.d.ts.map +1 -0
- package/dist/types/common/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts +146 -0
- package/dist/types/common/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts.map +1 -0
- package/dist/types/common/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1747 -0
- package/dist/types/common/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts.map +1 -0
- package/dist/types/common/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +1042 -0
- package/dist/types/common/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -0
- package/dist/types/common/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +187 -0
- package/dist/types/common/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts.map +1 -0
- package/dist/types/index.d.ts +30 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/utils/addresses.d.ts +4 -0
- package/dist/types/utils/addresses.d.ts.map +1 -0
- package/dist/types/utils/bignumbers.d.ts +6 -0
- package/dist/types/utils/bignumbers.d.ts.map +1 -0
- package/dist/types/utils/chainTypes.d.ts +137 -0
- package/dist/types/utils/chainTypes.d.ts.map +1 -0
- package/dist/types/utils/chipsCalculationsUtils.d.ts +3 -0
- package/dist/types/utils/chipsCalculationsUtils.d.ts.map +1 -0
- package/dist/types/utils/cloning.d.ts +6 -0
- package/dist/types/utils/cloning.d.ts.map +1 -0
- package/dist/types/utils/enumTypes.d.ts +2 -0
- package/dist/types/utils/enumTypes.d.ts.map +1 -0
- package/dist/types/utils/ethersTypes.d.ts +14 -0
- package/dist/types/utils/ethersTypes.d.ts.map +1 -0
- package/dist/types/utils/hashes.d.ts +2 -0
- package/dist/types/utils/hashes.d.ts.map +1 -0
- package/dist/types/utils/leverageCalculationsUtils.d.ts +6 -0
- package/dist/types/utils/leverageCalculationsUtils.d.ts.map +1 -0
- package/dist/types/utils/lynxScalesUtils.d.ts +5 -0
- package/dist/types/utils/lynxScalesUtils.d.ts.map +1 -0
- package/dist/types/utils/types.d.ts +7 -0
- package/dist/types/utils/types.d.ts.map +1 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LensAddresses = void 0;
|
|
4
|
+
exports.LensAddresses = {
|
|
5
|
+
boba: {
|
|
6
|
+
lexLens: "0xCcFaDF4E72d5b2D382555E0eb72a1BF6F7f0EF7F",
|
|
7
|
+
tradingFloorLensLens: "0xed9D263917921cb5f0B9a59c5083beA4075F33e7",
|
|
8
|
+
intentsVerifierLens: "0x8F33670B7a076793D178D340AD70Cc097DD03739",
|
|
9
|
+
triggersAndPortalLens: "0xA03312361D07dfAe0C517a441C69BFA9E84e38bf",
|
|
10
|
+
},
|
|
11
|
+
sonic: {
|
|
12
|
+
lexLens: "0xBcb1D4ACbc844ba5FC0aA411b98aebD4A508B65F",
|
|
13
|
+
tradingFloorLensLens: "0xa5802951D972372f1385e9Ac83df738b3323d0A8",
|
|
14
|
+
intentsVerifierLens: "0xDBe9130AAe593Ec73a838ce286fa84c193bceFA1",
|
|
15
|
+
triggersAndPortalLens: "0xaA96df0a4F01212169c2347dc23D5AEb89924839",
|
|
16
|
+
},
|
|
17
|
+
fantom: {
|
|
18
|
+
lexLens: "0xB5A5041654391a720953D346367D3A3BE9c3d47B",
|
|
19
|
+
tradingFloorLensLens: "0x30377D42736Bf4b40A67C18e5dFC7f45496e8569",
|
|
20
|
+
intentsVerifierLens: "0xD9E77b2A3E9B1a21aC256802bB86Cba3e21627E7",
|
|
21
|
+
triggersAndPortalLens: "0x9544C73C97BD292a1F09ef671A5f8CcDf9Ff5429",
|
|
22
|
+
},
|
|
23
|
+
flare: {
|
|
24
|
+
lexLens: "0x812Ea46a0618f923ae473eb239a89A8169b34B85",
|
|
25
|
+
tradingFloorLensLens: "0x13d878F3C3f32400A727662af7dfAdBc8b389637",
|
|
26
|
+
intentsVerifierLens: "0x33576dFbA7Ed5E3F8F744132D6885cE106178161",
|
|
27
|
+
triggersAndPortalLens: "0x625D49B0258BB8277516C07494910d420FA31B06",
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GeneralTokenDispenserPusherLevelEnums = exports.ChipsIntentsVerifierActionsEnums = exports.LiquidityIntentsVerifierActionsEnums = exports.TradeIntentsVerifierActionsEnums = exports.ChipSpenderRolesEnums = exports.ChipModeEnums = exports.TradersPortalActionEnums = exports.UpdatePositionFieldOrderTypeEnums = exports.LexPoolNumberEnums = exports.LexPoolAddressesEnums = exports.PoolAccountantNumberEnums = exports.PoolAccountantAddressesEnums = exports.AdminNumericParam = exports.PositionCloseTypeEnums = exports.PositionFieldEnums = exports.FeeTypeEnums = exports.LimitTriggerEnums = exports.CloseOrderTypeEnums = exports.OpenOrderTypeEnums = exports.PositionPhaseEnums = void 0;
|
|
4
|
+
// ****** Trading Floor ******
|
|
5
|
+
exports.PositionPhaseEnums = {
|
|
6
|
+
NONE: 0n,
|
|
7
|
+
OPEN_MARKET: 1n,
|
|
8
|
+
OPEN_LIMIT: 2n,
|
|
9
|
+
OPENED: 3n,
|
|
10
|
+
CLOSE_MARKET: 4n,
|
|
11
|
+
CLOSED: 5n,
|
|
12
|
+
};
|
|
13
|
+
exports.OpenOrderTypeEnums = {
|
|
14
|
+
NONE: 0,
|
|
15
|
+
MARKET: 1,
|
|
16
|
+
LIMIT: 2,
|
|
17
|
+
};
|
|
18
|
+
exports.CloseOrderTypeEnums = {
|
|
19
|
+
NONE: 0,
|
|
20
|
+
MARKET: 1,
|
|
21
|
+
};
|
|
22
|
+
exports.LimitTriggerEnums = {
|
|
23
|
+
NONE: 0,
|
|
24
|
+
TP: 1,
|
|
25
|
+
SL: 2,
|
|
26
|
+
LIQ: 3,
|
|
27
|
+
};
|
|
28
|
+
exports.FeeTypeEnums = {
|
|
29
|
+
NOTE: 0,
|
|
30
|
+
OPEN_FEE: 1,
|
|
31
|
+
CLOSE_FEE: 2,
|
|
32
|
+
TRIGGER_FEE: 3,
|
|
33
|
+
};
|
|
34
|
+
exports.PositionFieldEnums = {
|
|
35
|
+
NONE: 0n,
|
|
36
|
+
TP: 1n,
|
|
37
|
+
SL: 2n,
|
|
38
|
+
};
|
|
39
|
+
exports.PositionCloseTypeEnums = {
|
|
40
|
+
NONE: 0n,
|
|
41
|
+
TP: 1n,
|
|
42
|
+
SL: 2n,
|
|
43
|
+
LIQ: 3n,
|
|
44
|
+
MARKET: 4n,
|
|
45
|
+
};
|
|
46
|
+
exports.AdminNumericParam = {
|
|
47
|
+
NONE: 0n,
|
|
48
|
+
MAX_TRADES_PER_PAIR: 1n,
|
|
49
|
+
MAX_SL_F: 2n,
|
|
50
|
+
MAX_SANITY_PROFIT_F: 3n,
|
|
51
|
+
};
|
|
52
|
+
// ****** Lex ******
|
|
53
|
+
exports.PoolAccountantAddressesEnums = {
|
|
54
|
+
none: 0,
|
|
55
|
+
irm: 1,
|
|
56
|
+
frm: 2,
|
|
57
|
+
incentivizer: 3,
|
|
58
|
+
};
|
|
59
|
+
exports.PoolAccountantNumberEnums = {
|
|
60
|
+
none: 1,
|
|
61
|
+
minOpenFee: 1,
|
|
62
|
+
lexPartF: 2,
|
|
63
|
+
maxGainF: 3,
|
|
64
|
+
liquidationThresholdF: 4,
|
|
65
|
+
liquidationFeeF: 5,
|
|
66
|
+
fundingRateMax: 6,
|
|
67
|
+
interestShareFactor: 7,
|
|
68
|
+
borrowRateMax: 8,
|
|
69
|
+
maxTotalBorrows: 9,
|
|
70
|
+
maxVirtualUtilization: 10,
|
|
71
|
+
};
|
|
72
|
+
exports.LexPoolAddressesEnums = {
|
|
73
|
+
none: 0,
|
|
74
|
+
poolAccountant: 1,
|
|
75
|
+
pnlRole: 2,
|
|
76
|
+
};
|
|
77
|
+
exports.LexPoolNumberEnums = {
|
|
78
|
+
none: 0,
|
|
79
|
+
maxExtraWithdrawalAmountF: 1,
|
|
80
|
+
epochsDelayDeposit: 2,
|
|
81
|
+
epochsDelayRedeem: 3,
|
|
82
|
+
epochDuration: 4,
|
|
83
|
+
minDepositAmount: 5,
|
|
84
|
+
};
|
|
85
|
+
// ****** Order Book ******
|
|
86
|
+
exports.UpdatePositionFieldOrderTypeEnums = {
|
|
87
|
+
NONE: 0n,
|
|
88
|
+
UPDATE_TP: 1n,
|
|
89
|
+
UPDATE_SL: 2n,
|
|
90
|
+
UPDATE_TP_AND_SL: 3n,
|
|
91
|
+
};
|
|
92
|
+
// ****** Traders Portal ******
|
|
93
|
+
exports.TradersPortalActionEnums = {
|
|
94
|
+
NONE: 0,
|
|
95
|
+
REQUEST_POSITION_OPEN: 1,
|
|
96
|
+
REQUEST_POSITION_MARKET_CLOSE: 2,
|
|
97
|
+
REQUEST_POSITION_SINGLE_FIELD_UPDATE: 3,
|
|
98
|
+
REQUEST_POSITION_DOUBLE_FIELD_UPDATE: 4,
|
|
99
|
+
};
|
|
100
|
+
// ****** Base Chip ******
|
|
101
|
+
exports.ChipModeEnums = {
|
|
102
|
+
NONE: 0n,
|
|
103
|
+
LOCAL: 1n,
|
|
104
|
+
REMOTE: 2n,
|
|
105
|
+
HYBRID: 3n,
|
|
106
|
+
};
|
|
107
|
+
exports.ChipSpenderRolesEnums = {
|
|
108
|
+
TradingFloor: "TradingFloor",
|
|
109
|
+
LexPool: "LexPool",
|
|
110
|
+
ChipsIntentsVerifier: "ChipsIntentsVerifier",
|
|
111
|
+
ChipsIntentsVerifierAdmin: "ChipsIntentsVerifierAdmin",
|
|
112
|
+
};
|
|
113
|
+
// ****** Trade Intents Verifier ******
|
|
114
|
+
exports.TradeIntentsVerifierActionsEnums = {
|
|
115
|
+
NONE: 0n,
|
|
116
|
+
REQUEST_POSITION_OPEN: 1n,
|
|
117
|
+
REQUEST_POSITION_MARKET_CLOSE: 2n,
|
|
118
|
+
REQUEST_POSITION_SINGLE_FIELD_UPDATE: 3n,
|
|
119
|
+
REQUEST_POSITION_DOUBLE_FIELD_UPDATE: 4n,
|
|
120
|
+
DIRECT_UPDATE_PENDING_LIMIT_POSITION: 5n,
|
|
121
|
+
DIRECT_CANCEL_PENDING_LIMIT_POSITION: 6n,
|
|
122
|
+
};
|
|
123
|
+
// ****** Liquidity Intents Verifier ******
|
|
124
|
+
exports.LiquidityIntentsVerifierActionsEnums = {
|
|
125
|
+
NONE: 0n,
|
|
126
|
+
REQUEST_EPOCH_DEPOSIT: 1n,
|
|
127
|
+
REQUEST_EPOCH_REDEEM: 2n,
|
|
128
|
+
};
|
|
129
|
+
// ****** Chips Intents Verifier ******
|
|
130
|
+
exports.ChipsIntentsVerifierActionsEnums = {
|
|
131
|
+
NONE: 0n,
|
|
132
|
+
CHIP_OUT_LZ: 1n,
|
|
133
|
+
};
|
|
134
|
+
// ****** General Token Dispenser ******
|
|
135
|
+
exports.GeneralTokenDispenserPusherLevelEnums = {
|
|
136
|
+
NONE: 0,
|
|
137
|
+
BASE: 1,
|
|
138
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FEE_CONFIGS_IDENTIFIERS = exports.FEE_CONFIGS_IDS = void 0;
|
|
4
|
+
exports.FEE_CONFIGS_IDS = {
|
|
5
|
+
basicCryptoPair: 1,
|
|
6
|
+
catCryptoPair: 2,
|
|
7
|
+
forexPair: 3,
|
|
8
|
+
catForexPair: 4,
|
|
9
|
+
};
|
|
10
|
+
exports.FEE_CONFIGS_IDENTIFIERS = {
|
|
11
|
+
CRYPTO_COMMON: {
|
|
12
|
+
name: "crypto",
|
|
13
|
+
id: exports.FEE_CONFIGS_IDS.basicCryptoPair,
|
|
14
|
+
},
|
|
15
|
+
CRYPTO_CAT: {
|
|
16
|
+
name: "crypto_cat",
|
|
17
|
+
id: exports.FEE_CONFIGS_IDS.catCryptoPair,
|
|
18
|
+
},
|
|
19
|
+
FOREX: {
|
|
20
|
+
name: "forex",
|
|
21
|
+
id: exports.FEE_CONFIGS_IDS.forexPair,
|
|
22
|
+
},
|
|
23
|
+
FOREX_CAT: {
|
|
24
|
+
name: "forex_cat",
|
|
25
|
+
id: exports.FEE_CONFIGS_IDS.catForexPair,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GROUP_CONFIGS_IDENTIFIERS = exports.GROUP_CONFIGS_IDS = void 0;
|
|
4
|
+
exports.GROUP_CONFIGS_IDS = {
|
|
5
|
+
basicCryptoGroup: 1,
|
|
6
|
+
catCryptoGroup: 2,
|
|
7
|
+
forexGroup: 3,
|
|
8
|
+
catForexGroup: 4,
|
|
9
|
+
};
|
|
10
|
+
exports.GROUP_CONFIGS_IDENTIFIERS = {
|
|
11
|
+
crypto: {
|
|
12
|
+
name: "crypto",
|
|
13
|
+
id: exports.GROUP_CONFIGS_IDS.basicCryptoGroup,
|
|
14
|
+
},
|
|
15
|
+
crypto_cat: {
|
|
16
|
+
name: "crypto_cat",
|
|
17
|
+
id: exports.GROUP_CONFIGS_IDS.catCryptoGroup,
|
|
18
|
+
},
|
|
19
|
+
forex: {
|
|
20
|
+
name: "forex",
|
|
21
|
+
id: exports.GROUP_CONFIGS_IDS.forexGroup,
|
|
22
|
+
},
|
|
23
|
+
forex_cat: {
|
|
24
|
+
name: "forex_cat",
|
|
25
|
+
id: exports.GROUP_CONFIGS_IDS.catForexGroup,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PAIRS_FROM_TO = exports.PAIR_CONFIGS_IDENTIFIERS = exports.PAIR_CONFIGS_IDS = void 0;
|
|
4
|
+
exports.getPairConfigsIdentifierFromPairId = getPairConfigsIdentifierFromPairId;
|
|
5
|
+
const groupIds_1 = require("./groupIds");
|
|
6
|
+
exports.PAIR_CONFIGS_IDS = {
|
|
7
|
+
// NONE: 0,
|
|
8
|
+
// CRYPTO
|
|
9
|
+
BTC_USD: 1,
|
|
10
|
+
ETH_USD: 2,
|
|
11
|
+
BNB_USD: 3,
|
|
12
|
+
FTM_USD: 4,
|
|
13
|
+
SOL_USD: 5,
|
|
14
|
+
// CRYPTO -- Specific cases
|
|
15
|
+
FLR_USD: 1001,
|
|
16
|
+
// CRYPTO -- new version of previous pair
|
|
17
|
+
S_USD: 2004,
|
|
18
|
+
// FOREX
|
|
19
|
+
EUR_USD: 8001,
|
|
20
|
+
GBP_USD: 8002,
|
|
21
|
+
AUD_USD: 8003,
|
|
22
|
+
NZD_USD: 8004,
|
|
23
|
+
// REVERSE FOREX
|
|
24
|
+
USD_JPY: 8101,
|
|
25
|
+
USD_CHF: 8102,
|
|
26
|
+
// STOCKS
|
|
27
|
+
// TSLA_USD: 9001,
|
|
28
|
+
// CAT MODE -- CRYPTO
|
|
29
|
+
BTC_USD_CAT: 10001,
|
|
30
|
+
ETH_USD_CAT: 10002,
|
|
31
|
+
// CAT MODE -- FOREX
|
|
32
|
+
EUR_USD_CAT: 18001,
|
|
33
|
+
GBP_USD_CAT: 18002,
|
|
34
|
+
AUD_USD_CAT: 18003,
|
|
35
|
+
NZD_USD_CAT: 18004,
|
|
36
|
+
// CAT MODE -- REVERSE FOREX
|
|
37
|
+
USD_JPY_CAT: 18101,
|
|
38
|
+
USD_CHF_CAT: 18102,
|
|
39
|
+
};
|
|
40
|
+
exports.PAIR_CONFIGS_IDENTIFIERS = {
|
|
41
|
+
// CRYPTO
|
|
42
|
+
BTC_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.BTC_USD, "BTC", "USD"),
|
|
43
|
+
ETH_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.ETH_USD, "ETH", "USD"),
|
|
44
|
+
BNB_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.BNB_USD, "BNB", "USD"),
|
|
45
|
+
FTM_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.FTM_USD, "FTM", "USD"),
|
|
46
|
+
SOL_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.SOL_USD, "SOL", "USD"),
|
|
47
|
+
// CRYPTO -- Specific cases
|
|
48
|
+
FLR_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.FLR_USD, "FLR", "USD"),
|
|
49
|
+
// CRYPTO -- new version of previous pair
|
|
50
|
+
S_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.S_USD, "S", "USD"),
|
|
51
|
+
// FOREX
|
|
52
|
+
EUR_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.forexGroup, exports.PAIR_CONFIGS_IDS.EUR_USD, "EUR", "USD"),
|
|
53
|
+
GBP_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.forexGroup, exports.PAIR_CONFIGS_IDS.GBP_USD, "GBP", "USD"),
|
|
54
|
+
AUD_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.forexGroup, exports.PAIR_CONFIGS_IDS.AUD_USD, "AUD", "USD"),
|
|
55
|
+
NZD_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.forexGroup, exports.PAIR_CONFIGS_IDS.NZD_USD, "NZD", "USD"),
|
|
56
|
+
// Reverse Forex
|
|
57
|
+
USD_JPY: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.forexGroup, exports.PAIR_CONFIGS_IDS.USD_JPY, "USD", "JPY"),
|
|
58
|
+
USD_CHF: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.forexGroup, exports.PAIR_CONFIGS_IDS.USD_CHF, "USD", "CHF"),
|
|
59
|
+
// CRYPTO CAT MODE
|
|
60
|
+
BTC_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catCryptoGroup, exports.PAIR_CONFIGS_IDS.BTC_USD_CAT, "BTC", "USD"),
|
|
61
|
+
ETH_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catCryptoGroup, exports.PAIR_CONFIGS_IDS.ETH_USD_CAT, "ETH", "USD"),
|
|
62
|
+
// FOREX CAT MODE
|
|
63
|
+
// FOREX
|
|
64
|
+
EUR_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catForexGroup, exports.PAIR_CONFIGS_IDS.EUR_USD_CAT, "EUR", "USD"),
|
|
65
|
+
GBP_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catForexGroup, exports.PAIR_CONFIGS_IDS.GBP_USD_CAT, "GBP", "USD"),
|
|
66
|
+
AUD_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catForexGroup, exports.PAIR_CONFIGS_IDS.AUD_USD_CAT, "AUD", "USD"),
|
|
67
|
+
NZD_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catForexGroup, exports.PAIR_CONFIGS_IDS.NZD_USD_CAT, "NZD", "USD"),
|
|
68
|
+
// Reverse Cat Forex
|
|
69
|
+
USD_JPY_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catForexGroup, exports.PAIR_CONFIGS_IDS.USD_JPY_CAT, "USD", "JPY"),
|
|
70
|
+
USD_CHF_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catForexGroup, exports.PAIR_CONFIGS_IDS.USD_CHF_CAT, "USD", "CHF"),
|
|
71
|
+
};
|
|
72
|
+
const PAIR_ID_TO_NAME = Object.fromEntries(Object.entries(exports.PAIR_CONFIGS_IDENTIFIERS).map(([pairName, value]) => [
|
|
73
|
+
value.id,
|
|
74
|
+
pairName,
|
|
75
|
+
]));
|
|
76
|
+
function buildCryptoPairConfigsIdentifier(groupId, id, from, to) {
|
|
77
|
+
return {
|
|
78
|
+
groupId,
|
|
79
|
+
id,
|
|
80
|
+
from,
|
|
81
|
+
to,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function getPairConfigsIdentifierFromPairId(pairId) {
|
|
85
|
+
const pairName = PAIR_ID_TO_NAME[pairId];
|
|
86
|
+
return exports.PAIR_CONFIGS_IDENTIFIERS[pairName];
|
|
87
|
+
}
|
|
88
|
+
exports.PAIRS_FROM_TO = Object.fromEntries(Object.entries(exports.PAIR_CONFIGS_IDENTIFIERS).map(([pairName, value]) => [
|
|
89
|
+
value.id,
|
|
90
|
+
{ from: value.from, to: value.to },
|
|
91
|
+
]));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONTRACT_VERSION_SCALE = exports.PROXY_VERSION_SCALE = exports.LEX_TOKEN_INITIAL_EXCHANGE_RATE_UNITS = exports.LEX_TOKEN_UNIT = exports.LEX_TOKEN_SCALE = exports.ACCURACY_IMPROVEMENT_UNIT = exports.ACCURACY_IMPROVEMENT_SCALE = exports.FRACTION_UNIT = exports.FRACTION_MULTIPLIER_SCALE = exports.LEVERAGE_UNIT = exports.LEVERAGE_MULTIPLIER_SCALE = exports.PRICES_SCALE = exports.PRECISION_UNIT = exports.PRECISION_SCALE = exports.CHIP_DECIMALS = void 0;
|
|
4
|
+
exports.CHIP_DECIMALS = 18;
|
|
5
|
+
exports.PRECISION_SCALE = 18n;
|
|
6
|
+
exports.PRECISION_UNIT = 10n ** exports.PRECISION_SCALE;
|
|
7
|
+
exports.PRICES_SCALE = 8;
|
|
8
|
+
// NOTE : multiplier, not power
|
|
9
|
+
exports.LEVERAGE_MULTIPLIER_SCALE = 100;
|
|
10
|
+
exports.LEVERAGE_UNIT = BigInt(exports.LEVERAGE_MULTIPLIER_SCALE);
|
|
11
|
+
// NOTE : multiplier, not power
|
|
12
|
+
exports.FRACTION_MULTIPLIER_SCALE = 100000n; // allows 5 decimal points
|
|
13
|
+
exports.FRACTION_UNIT = exports.FRACTION_MULTIPLIER_SCALE;
|
|
14
|
+
exports.ACCURACY_IMPROVEMENT_SCALE = 9n;
|
|
15
|
+
exports.ACCURACY_IMPROVEMENT_UNIT = 10n ** exports.ACCURACY_IMPROVEMENT_SCALE;
|
|
16
|
+
exports.LEX_TOKEN_SCALE = 18n;
|
|
17
|
+
exports.LEX_TOKEN_UNIT = 10n ** exports.LEX_TOKEN_SCALE;
|
|
18
|
+
exports.LEX_TOKEN_INITIAL_EXCHANGE_RATE_UNITS = 1;
|
|
19
|
+
// export const LEX_TOKEN_INITIAL_EXCHANGE_RATE = floatToUnitsBn(
|
|
20
|
+
// 0.02,
|
|
21
|
+
// LEX_TOKEN_SCALE
|
|
22
|
+
// );
|
|
23
|
+
exports.PROXY_VERSION_SCALE = 1000; // 1,000 = 1.00, 1,120 = 1.12
|
|
24
|
+
exports.CONTRACT_VERSION_SCALE = 1000; // 1,000 = 1.00, 1,120 = 1.12
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.connectToTradingFloorLens = connectToTradingFloorLens;
|
|
4
|
+
exports.connectToLeXLensForSigner = connectToLeXLensForSigner;
|
|
5
|
+
exports.connectToLeXLens = connectToLeXLens;
|
|
6
|
+
const TradingFloorLens__factory_1 = require("../typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory");
|
|
7
|
+
const LexLens__factory_1 = require("../typechain/factories/contracts/Peripheral/Lens/LexLens__factory");
|
|
8
|
+
function connectToTradingFloorLens(provider, address) {
|
|
9
|
+
return TradingFloorLens__factory_1.TradingFloorLens__factory.connect(address, provider);
|
|
10
|
+
}
|
|
11
|
+
function connectToLeXLensForSigner(signer, address) {
|
|
12
|
+
return LexLens__factory_1.LexLens__factory.connect(address, signer);
|
|
13
|
+
}
|
|
14
|
+
function connectToLeXLens(provider, address) {
|
|
15
|
+
return LexLens__factory_1.LexLens__factory.connect(address, provider);
|
|
16
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PYTH_PAIRS_PRICE_FEED_IDS = exports.PYTH_PRICE_ENTRIES = exports.PYTH_PRICE_KEYS = void 0;
|
|
4
|
+
const pairIds_1 = require("../../constants/pairIds");
|
|
5
|
+
exports.PYTH_PRICE_KEYS = {
|
|
6
|
+
[pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "Crypto.BTC/USD",
|
|
7
|
+
[pairIds_1.PAIR_CONFIGS_IDS.ETH_USD]: "Crypto.ETH/USD",
|
|
8
|
+
[pairIds_1.PAIR_CONFIGS_IDS.BNB_USD]: "Crypto.BNB/USD",
|
|
9
|
+
[pairIds_1.PAIR_CONFIGS_IDS.FTM_USD]: "Crypto.FTM/USD",
|
|
10
|
+
[pairIds_1.PAIR_CONFIGS_IDS.SOL_USD]: "Crypto.SOL/USD",
|
|
11
|
+
[pairIds_1.PAIR_CONFIGS_IDS.FLR_USD]: "Crypto.FLR/USD",
|
|
12
|
+
[pairIds_1.PAIR_CONFIGS_IDS.S_USD]: "Crypto.S/USD",
|
|
13
|
+
// Forex
|
|
14
|
+
[pairIds_1.PAIR_CONFIGS_IDS.EUR_USD]: "Fx.EUR/USD",
|
|
15
|
+
[pairIds_1.PAIR_CONFIGS_IDS.GBP_USD]: "Fx.GBP/USD",
|
|
16
|
+
[pairIds_1.PAIR_CONFIGS_IDS.AUD_USD]: "Fx.AUD/USD",
|
|
17
|
+
[pairIds_1.PAIR_CONFIGS_IDS.NZD_USD]: "Fx.NZD/USD",
|
|
18
|
+
// Reverse Forex
|
|
19
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USD_JPY]: "Fx.USD/JPY",
|
|
20
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USD_CHF]: "Fx.USD/CHF",
|
|
21
|
+
// CAT Mode
|
|
22
|
+
[pairIds_1.PAIR_CONFIGS_IDS.BTC_USD_CAT]: "Crypto.BTC/USD",
|
|
23
|
+
[pairIds_1.PAIR_CONFIGS_IDS.ETH_USD_CAT]: "Crypto.ETH/USD",
|
|
24
|
+
// CAT Mode Forex
|
|
25
|
+
[pairIds_1.PAIR_CONFIGS_IDS.EUR_USD_CAT]: "Fx.EUR/USD",
|
|
26
|
+
[pairIds_1.PAIR_CONFIGS_IDS.GBP_USD_CAT]: "Fx.GBP/USD",
|
|
27
|
+
[pairIds_1.PAIR_CONFIGS_IDS.AUD_USD_CAT]: "Fx.AUD/USD",
|
|
28
|
+
[pairIds_1.PAIR_CONFIGS_IDS.NZD_USD_CAT]: "Fx.NZD/USD",
|
|
29
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USD_JPY_CAT]: "Fx.USD/JPY",
|
|
30
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USD_CHF_CAT]: "Fx.USD/CHF",
|
|
31
|
+
};
|
|
32
|
+
exports.PYTH_PRICE_ENTRIES = Object.entries(exports.PYTH_PRICE_KEYS).map(([stringPariId, stringKey]) => [
|
|
33
|
+
parseFloat(stringPariId),
|
|
34
|
+
stringKey,
|
|
35
|
+
]);
|
|
36
|
+
// You can find the ids of prices at https://pyth.network/developers/price-feed-ids
|
|
37
|
+
exports.PYTH_PAIRS_PRICE_FEED_IDS = {
|
|
38
|
+
[pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
|
|
39
|
+
[pairIds_1.PAIR_CONFIGS_IDS.ETH_USD]: "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
|
|
40
|
+
[pairIds_1.PAIR_CONFIGS_IDS.BNB_USD]: "0x2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1101c4f",
|
|
41
|
+
// [PAIR_CONFIGS_IDS.FTM_USD]: "5c6c0d2386e3352356c3ab84434fafb5ea067ac2678a38a338c4a69ddc4bdb0c",
|
|
42
|
+
// NOTE : Using S instead of deprecated FTM
|
|
43
|
+
[pairIds_1.PAIR_CONFIGS_IDS.FTM_USD]: "0xf490b178d0c85683b7a0f2388b40af2e6f7c90cbe0f96b31f315f08d0e5a2d6d",
|
|
44
|
+
[pairIds_1.PAIR_CONFIGS_IDS.SOL_USD]: "0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d",
|
|
45
|
+
[pairIds_1.PAIR_CONFIGS_IDS.S_USD]: "0xf490b178d0c85683b7a0f2388b40af2e6f7c90cbe0f96b31f315f08d0e5a2d6d",
|
|
46
|
+
[pairIds_1.PAIR_CONFIGS_IDS.EUR_USD]: "0xa995d00bb36a63cef7fd2c287dc105fc8f3d93779f062f09551b0af3e81ec30b",
|
|
47
|
+
[pairIds_1.PAIR_CONFIGS_IDS.GBP_USD]: "0x84c2dde9633d93d1bcad84e7dc41c9d56578b7ec52fabedc1f335d673df0a7c1",
|
|
48
|
+
[pairIds_1.PAIR_CONFIGS_IDS.AUD_USD]: "0x67a6f93030420c1c9e3fe37c1ab6b77966af82f995944a9fefce357a22854a80",
|
|
49
|
+
[pairIds_1.PAIR_CONFIGS_IDS.NZD_USD]: "0x92eea8ba1b00078cdc2ef6f64f091f262e8c7d0576ee4677572f314ebfafa4c7",
|
|
50
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USD_JPY]: "0xef2c98c804ba503c6a707e38be4dfbb16683775f195b091252bf24693042fd52",
|
|
51
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USD_CHF]: "0x0b1e3297e69f162877b577b0d6a47a0d63b2392bc8499e6540da4187a63e28f8",
|
|
52
|
+
// NOTE : CAT pair will have the same price feed id as the non-CAT pair
|
|
53
|
+
[pairIds_1.PAIR_CONFIGS_IDS.BTC_USD_CAT]: "",
|
|
54
|
+
[pairIds_1.PAIR_CONFIGS_IDS.ETH_USD_CAT]: "",
|
|
55
|
+
[pairIds_1.PAIR_CONFIGS_IDS.EUR_USD_CAT]: "",
|
|
56
|
+
[pairIds_1.PAIR_CONFIGS_IDS.GBP_USD_CAT]: "",
|
|
57
|
+
[pairIds_1.PAIR_CONFIGS_IDS.AUD_USD_CAT]: "",
|
|
58
|
+
[pairIds_1.PAIR_CONFIGS_IDS.NZD_USD_CAT]: "",
|
|
59
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USD_JPY_CAT]: "",
|
|
60
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USD_CHF_CAT]: "",
|
|
61
|
+
// Pairs Unsupported by pyth
|
|
62
|
+
[pairIds_1.PAIR_CONFIGS_IDS.FLR_USD]: "",
|
|
63
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPythFeedIdForPair = getPythFeedIdForPair;
|
|
4
|
+
const pythFeedConstants_1 = require("./pythFeedConstants");
|
|
5
|
+
/**
|
|
6
|
+
* Get the Pyth feed id for a pair
|
|
7
|
+
* @param pairId The pair id
|
|
8
|
+
*/
|
|
9
|
+
function getPythFeedIdForPair(pairId) {
|
|
10
|
+
return pythFeedConstants_1.PYTH_PRICE_KEYS[pairId];
|
|
11
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntentsVerifierLens__factory = void 0;
|
|
4
|
+
/* Autogenerated file. Do not edit manually. */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const _abi = [
|
|
9
|
+
{
|
|
10
|
+
inputs: [
|
|
11
|
+
{
|
|
12
|
+
internalType: "contract IRegistryV1",
|
|
13
|
+
name: "_registry",
|
|
14
|
+
type: "address",
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
stateMutability: "nonpayable",
|
|
18
|
+
type: "constructor",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
inputs: [
|
|
22
|
+
{
|
|
23
|
+
internalType: "address",
|
|
24
|
+
name: "_account",
|
|
25
|
+
type: "address",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
internalType: "uint8",
|
|
29
|
+
name: "_actionType",
|
|
30
|
+
type: "uint8",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
name: "getRequestBuildingInfoForChipsIntentsVerifier",
|
|
34
|
+
outputs: [
|
|
35
|
+
{
|
|
36
|
+
components: [
|
|
37
|
+
{
|
|
38
|
+
internalType: "address",
|
|
39
|
+
name: "verifier",
|
|
40
|
+
type: "address",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
internalType: "address",
|
|
44
|
+
name: "account",
|
|
45
|
+
type: "address",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
internalType: "uint8",
|
|
49
|
+
name: "actionType",
|
|
50
|
+
type: "uint8",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
internalType: "uint256",
|
|
54
|
+
name: "currentNonce",
|
|
55
|
+
type: "uint256",
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
internalType: "struct AccountBasedIntentsVerifierRequestBuildingInfo",
|
|
59
|
+
name: "",
|
|
60
|
+
type: "tuple",
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
stateMutability: "view",
|
|
64
|
+
type: "function",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
inputs: [
|
|
68
|
+
{
|
|
69
|
+
internalType: "address",
|
|
70
|
+
name: "_account",
|
|
71
|
+
type: "address",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
internalType: "uint8",
|
|
75
|
+
name: "_actionType",
|
|
76
|
+
type: "uint8",
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
name: "getRequestBuildingInfoForLiquidityIntentsVerifier",
|
|
80
|
+
outputs: [
|
|
81
|
+
{
|
|
82
|
+
components: [
|
|
83
|
+
{
|
|
84
|
+
internalType: "address",
|
|
85
|
+
name: "verifier",
|
|
86
|
+
type: "address",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
internalType: "address",
|
|
90
|
+
name: "account",
|
|
91
|
+
type: "address",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
internalType: "uint8",
|
|
95
|
+
name: "actionType",
|
|
96
|
+
type: "uint8",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
internalType: "uint256",
|
|
100
|
+
name: "currentNonce",
|
|
101
|
+
type: "uint256",
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
internalType: "struct AccountBasedIntentsVerifierRequestBuildingInfo",
|
|
105
|
+
name: "",
|
|
106
|
+
type: "tuple",
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
stateMutability: "view",
|
|
110
|
+
type: "function",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
inputs: [
|
|
114
|
+
{
|
|
115
|
+
internalType: "bytes32",
|
|
116
|
+
name: "_positionId",
|
|
117
|
+
type: "bytes32",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
internalType: "uint8",
|
|
121
|
+
name: "_actionType",
|
|
122
|
+
type: "uint8",
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
name: "getRequestBuildingInfoForTradeIntentsVerifier",
|
|
126
|
+
outputs: [
|
|
127
|
+
{
|
|
128
|
+
components: [
|
|
129
|
+
{
|
|
130
|
+
internalType: "address",
|
|
131
|
+
name: "verifier",
|
|
132
|
+
type: "address",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
internalType: "bytes32",
|
|
136
|
+
name: "hash",
|
|
137
|
+
type: "bytes32",
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
internalType: "uint8",
|
|
141
|
+
name: "actionType",
|
|
142
|
+
type: "uint8",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
internalType: "uint256",
|
|
146
|
+
name: "currentNonce",
|
|
147
|
+
type: "uint256",
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
internalType: "struct HashBasedIntentsVerifierRequestBuildingInfo",
|
|
151
|
+
name: "",
|
|
152
|
+
type: "tuple",
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
stateMutability: "view",
|
|
156
|
+
type: "function",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
inputs: [],
|
|
160
|
+
name: "registry",
|
|
161
|
+
outputs: [
|
|
162
|
+
{
|
|
163
|
+
internalType: "contract IRegistryV1",
|
|
164
|
+
name: "",
|
|
165
|
+
type: "address",
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
stateMutability: "view",
|
|
169
|
+
type: "function",
|
|
170
|
+
},
|
|
171
|
+
];
|
|
172
|
+
const _bytecode = "0x60a060405234801561001057600080fd5b5060405161068638038061068683398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516105e761009f6000396000818160b60152818161017d0152818161023a01526102ef01526105e76000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063605e0db0146100515780637b103999146100b15780637c25c476146100f057806394da4e1d14610142575b600080fd5b61006461005f36600461051c565b610155565b6040516100a8919081516001600160a01b0390811682526020808401519091169082015260408083015160ff16908201526060918201519181019190915260800190565b60405180910390f35b6100d87f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100a8565b6101036100fe366004610551565b610212565b6040516100a8919081516001600160a01b031681526020808301519082015260408083015160ff16908201526060918201519181019190915260800190565b61006461015036600461051c565b6102c7565b60408051608081018252600080825260208201819052918101829052606081019190915260007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c62777c56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fd9190610574565b905061020a81858561034b565b949350505050565b60408051608081018252600080825260208201819052918101829052606081019190915260007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663372e24706040518163ffffffff1660e01b8152600401602060405180830381865afa158015610296573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ba9190610574565b905061020a81858561041e565b60408051608081018252600080825260208201819052918101829052606081019190915260007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635cecd5ff6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101d9573d6000803e3d6000fd5b604080516080810182526000808252602082018190529181018290526060810191909152604051630d81587160e41b81526001600160a01b03848116600483015260ff841660248301526000919086169063d815871090604401602060405180830381865afa1580156103c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e69190610598565b604080516080810182526001600160a01b03978816815295909616602086015260ff9390931694840194909452506060820152919050565b604080516080810182526000808252602082018190529181018290526060810191909152604051633febb98960e01b81526004810184905260ff831660248201526000906001600160a01b03861690633febb98990604401602060405180830381865afa158015610493573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b79190610598565b604080516080810182526001600160a01b03979097168752602087019590955260ff93909316938501939093525060608301525090565b6001600160a01b038116811461050357600080fd5b50565b803560ff8116811461051757600080fd5b919050565b6000806040838503121561052f57600080fd5b823561053a816104ee565b915061054860208401610506565b90509250929050565b6000806040838503121561056457600080fd5b8235915061054860208401610506565b60006020828403121561058657600080fd5b8151610591816104ee565b9392505050565b6000602082840312156105aa57600080fd5b505191905056fea26469706673582212204c3476fe7d7622d13cf8979afe6e26a278ffb11b2bf51ffe5c4a001c9eda73f264736f6c63430008180033";
|
|
173
|
+
const isSuperArgs = (xs) => xs.length > 1;
|
|
174
|
+
class IntentsVerifierLens__factory extends ethers_1.ContractFactory {
|
|
175
|
+
constructor(...args) {
|
|
176
|
+
if (isSuperArgs(args)) {
|
|
177
|
+
super(...args);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
super(_abi, _bytecode, args[0]);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
getDeployTransaction(_registry, overrides) {
|
|
184
|
+
return super.getDeployTransaction(_registry, overrides || {});
|
|
185
|
+
}
|
|
186
|
+
deploy(_registry, overrides) {
|
|
187
|
+
return super.deploy(_registry, overrides || {});
|
|
188
|
+
}
|
|
189
|
+
connect(runner) {
|
|
190
|
+
return super.connect(runner);
|
|
191
|
+
}
|
|
192
|
+
static createInterface() {
|
|
193
|
+
return new ethers_1.Interface(_abi);
|
|
194
|
+
}
|
|
195
|
+
static connect(address, runner) {
|
|
196
|
+
return new ethers_1.Contract(address, _abi, runner);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.IntentsVerifierLens__factory = IntentsVerifierLens__factory;
|
|
200
|
+
IntentsVerifierLens__factory.bytecode = _bytecode;
|
|
201
|
+
IntentsVerifierLens__factory.abi = _abi;
|