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
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TriggersAndPortalLens__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: "address",
|
|
13
|
+
name: "_triggers",
|
|
14
|
+
type: "address",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
internalType: "uint16",
|
|
18
|
+
name: "_pairId",
|
|
19
|
+
type: "uint16",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
name: "getPairConfigsInTriggers",
|
|
23
|
+
outputs: [
|
|
24
|
+
{
|
|
25
|
+
components: [
|
|
26
|
+
{
|
|
27
|
+
internalType: "uint16",
|
|
28
|
+
name: "pairId",
|
|
29
|
+
type: "uint16",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
internalType: "uint256",
|
|
33
|
+
name: "maxConfidenceFraction",
|
|
34
|
+
type: "uint256",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
internalType: "uint256",
|
|
38
|
+
name: "spreadFraction",
|
|
39
|
+
type: "uint256",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
internalType: "struct PairConfigsInTriggers",
|
|
43
|
+
name: "pairConfigs",
|
|
44
|
+
type: "tuple",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
stateMutability: "view",
|
|
48
|
+
type: "function",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
inputs: [
|
|
52
|
+
{
|
|
53
|
+
internalType: "address",
|
|
54
|
+
name: "_triggers",
|
|
55
|
+
type: "address",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
internalType: "uint16[]",
|
|
59
|
+
name: "_pairIds",
|
|
60
|
+
type: "uint16[]",
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
name: "getPairsConfigsInTriggers",
|
|
64
|
+
outputs: [
|
|
65
|
+
{
|
|
66
|
+
components: [
|
|
67
|
+
{
|
|
68
|
+
internalType: "uint16",
|
|
69
|
+
name: "pairId",
|
|
70
|
+
type: "uint16",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
internalType: "uint256",
|
|
74
|
+
name: "maxConfidenceFraction",
|
|
75
|
+
type: "uint256",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
internalType: "uint256",
|
|
79
|
+
name: "spreadFraction",
|
|
80
|
+
type: "uint256",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
internalType: "struct PairConfigsInTriggers[]",
|
|
84
|
+
name: "pairsConfigs",
|
|
85
|
+
type: "tuple[]",
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
stateMutability: "view",
|
|
89
|
+
type: "function",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
inputs: [
|
|
93
|
+
{
|
|
94
|
+
internalType: "address",
|
|
95
|
+
name: "_tradersPortal",
|
|
96
|
+
type: "address",
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
name: "getTradersPortalConfigurations",
|
|
100
|
+
outputs: [
|
|
101
|
+
{
|
|
102
|
+
components: [
|
|
103
|
+
{
|
|
104
|
+
internalType: "uint16",
|
|
105
|
+
name: "limitOrdersTimelock",
|
|
106
|
+
type: "uint16",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
internalType: "uint16",
|
|
110
|
+
name: "marketOrdersTimeout",
|
|
111
|
+
type: "uint16",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
internalType: "bool",
|
|
115
|
+
name: "isLimitingMarketClosePriceRange",
|
|
116
|
+
type: "bool",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
internalType: "uint256",
|
|
120
|
+
name: "nativeFeeForPositionOpenRequest",
|
|
121
|
+
type: "uint256",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
internalType: "uint256",
|
|
125
|
+
name: "nativeFeeForMarketCloseRequest",
|
|
126
|
+
type: "uint256",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
internalType: "uint256",
|
|
130
|
+
name: "nativeFeeForSingleFieldUpdateRequest",
|
|
131
|
+
type: "uint256",
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
internalType: "uint256",
|
|
135
|
+
name: "nativeFeeForDoubleFieldUpdateRequest",
|
|
136
|
+
type: "uint256",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
internalType: "uint256",
|
|
140
|
+
name: "minLiveTimeForMarketClose",
|
|
141
|
+
type: "uint256",
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
internalType: "struct CompleteTradersPortalConfigurations",
|
|
145
|
+
name: "tradersPortalConfigurations",
|
|
146
|
+
type: "tuple",
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
stateMutability: "view",
|
|
150
|
+
type: "function",
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
inputs: [
|
|
154
|
+
{
|
|
155
|
+
internalType: "address",
|
|
156
|
+
name: "_triggers",
|
|
157
|
+
type: "address",
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
name: "getTriggersConfigurations",
|
|
161
|
+
outputs: [
|
|
162
|
+
{
|
|
163
|
+
components: [
|
|
164
|
+
{
|
|
165
|
+
internalType: "uint16",
|
|
166
|
+
name: "minTriggerPeriodForMarketOrders",
|
|
167
|
+
type: "uint16",
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
internalType: "uint16",
|
|
171
|
+
name: "maxTriggerPeriodForMarketOrders",
|
|
172
|
+
type: "uint16",
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
internalType: "uint16",
|
|
176
|
+
name: "marketOrdersTimeout",
|
|
177
|
+
type: "uint16",
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
internalType: "uint16",
|
|
181
|
+
name: "marketOrderTightTimeRange",
|
|
182
|
+
type: "uint16",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
internalType: "uint16",
|
|
186
|
+
name: "minTriggerPeriodForLimitOrders",
|
|
187
|
+
type: "uint16",
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
internalType: "uint16",
|
|
191
|
+
name: "triggerPriceFreshnessTimeRange",
|
|
192
|
+
type: "uint16",
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
internalType: "uint256",
|
|
196
|
+
name: "marketOrderCancelFeeFraction",
|
|
197
|
+
type: "uint256",
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
internalType: "uint256",
|
|
201
|
+
name: "openPositionCancellationFeeFraction",
|
|
202
|
+
type: "uint256",
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
internalType: "uint16",
|
|
206
|
+
name: "maxTriggersPerBlock",
|
|
207
|
+
type: "uint16",
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
internalType: "address[]",
|
|
211
|
+
name: "permissionedTriggerAccounts",
|
|
212
|
+
type: "address[]",
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
internalType: "struct CompleteTriggerConfigurations",
|
|
216
|
+
name: "triggersConfigurations",
|
|
217
|
+
type: "tuple",
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
stateMutability: "view",
|
|
221
|
+
type: "function",
|
|
222
|
+
},
|
|
223
|
+
];
|
|
224
|
+
const _bytecode = "0x608060405234801561001057600080fd5b506110b9806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063098eb3171461005157806312e5f7a81461007a578063549d65731461009a578063984d9f2314610118575b600080fd5b61006461005f366004610c63565b610138565b6040516100719190610cc5565b60405180910390f35b61008d610088366004610d9b565b61014f565b6040516100719190610dd0565b6100ad6100a8366004610c63565b610188565b604051610071919060006101008201905061ffff80845116835280602085015116602084015250604083015115156040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015292915050565b61012b610126366004610df5565b610199565b6040516100719190610e7d565b610140610ba6565b61014982610278565b92915050565b6101776040518060600160405280600061ffff16815260200160008152602001600081525090565b61018183836106ec565b9392505050565b610190610bfc565b61014982610811565b60608167ffffffffffffffff8111156101b4576101b4610ee3565b60405190808252806020026020018201604052801561020d57816020015b6101fa6040518060600160405280600061ffff16815260200160008152602001600081525090565b8152602001906001900390816101d25790505b50905060005b828110156102705761024b8585858481811061023157610231610ef9565b90506020020160208101906102469190610f0f565b6106ec565b82828151811061025d5761025d610ef9565b6020908102919091010152600101610213565b509392505050565b610280610ba6565b6000829050806001600160a01b03166345b617136040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e79190610f2a565b61ffff16825260408051637f31c2db60e01b815290516001600160a01b03831691637f31c2db9160048083019260209291908290030181865afa158015610332573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103569190610f2a565b61ffff166020808401919091526040805163104302df60e21b815290516001600160a01b0384169263410c0b7c92600480820193918290030181865afa1580156103a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c89190610f2a565b826040019061ffff16908161ffff1681525050806001600160a01b031663a5b602086040518163ffffffff1660e01b8152600401602060405180830381865afa158015610419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043d9190610f2a565b61ffff16606083015260408051637f588b9160e01b815290516001600160a01b03831691637f588b919160048083019260209291908290030181865afa15801561048b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104af9190610f2a565b61ffff166080830152604080516301c9281f60e51b815290516001600160a01b0383169163392503e09160048083019260209291908290030181865afa1580156104fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105219190610f2a565b61ffff1660a0830152604080516310b4cc1360e01b815290516001600160a01b038316916310b4cc139160048083019260209291908290030181865afa15801561056f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105939190610f2a565b8260c0018181525050806001600160a01b03166322ede93c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fe9190610f2a565b8260e0018181525050806001600160a01b031663814052056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610645573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106699190610f2a565b61ffff1661010083015260408051634363f8cd60e11b815290516001600160a01b038316916386c7f19a9160048083019260009291908290030181865afa1580156106b8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106e09190810190610f4e565b61012083015250919050565b6107146040518060600160405280600061ffff16815260200160008152602001600081525090565b61ffff8216808252604051639f918f4560e01b8152600481019190915283906001600160a01b03821690639f918f4590602401602060405180830381865afa158015610764573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107889190611013565b63ffffffff166020830152604051632e966ff560e11b815261ffff841660048201526001600160a01b03821690635d2cdfea90602401602060405180830381865afa1580156107db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ff9190611013565b63ffffffff1660408301525092915050565b610819610bfc565b6000829050806001600160a01b0316630890d22a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561085c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108809190610f2a565b61ffff1682526040805163104302df60e21b815290516001600160a01b0383169163410c0b7c9160048083019260209291908290030181865afa1580156108cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ef9190610f2a565b61ffff166020808401919091526040805163699db38b60e11b815290516001600160a01b0384169263d33b671692600480820193918290030181865afa15801561093d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109619190611039565b15156040808401919091525163d060576b60e01b81526001600160a01b0382169063d060576b906109979060019060040161105b565b602060405180830381865afa1580156109b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d89190610f2a565b606083015260405163d060576b60e01b81526001600160a01b0382169063d060576b90610a0a9060029060040161105b565b602060405180830381865afa158015610a27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4b9190610f2a565b608083015260405163d060576b60e01b81526001600160a01b0382169063d060576b90610a7d9060039060040161105b565b602060405180830381865afa158015610a9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abe9190610f2a565b60a083015260405163d060576b60e01b81526001600160a01b0382169063d060576b90610aef90600490810161105b565b602060405180830381865afa158015610b0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b309190610f2a565b8260c0018181525050806001600160a01b031663441f64bb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9b9190610f2a565b60e083015250919050565b604080516101408101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e0820183905261010082019290925261012081019190915290565b604051806101000160405280600061ffff168152602001600061ffff16815260200160001515815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b0381168114610c6057600080fd5b50565b600060208284031215610c7557600080fd5b813561018181610c4b565b60008151808452602080850194506020840160005b83811015610cba5781516001600160a01b031687529582019590820190600101610c95565b509495945050505050565b60208152610cda60208201835161ffff169052565b60006020830151610cf1604084018261ffff169052565b50604083015161ffff8116606084015250606083015161ffff8116608084015250608083015161ffff811660a08401525060a083015161ffff811660c08401525060c083015160e083015260e0830151610100818185015280850151915050610120610d628185018361ffff169052565b840151610140848101529050610d7c610160840182610c80565b949350505050565b803561ffff81168114610d9657600080fd5b919050565b60008060408385031215610dae57600080fd5b8235610db981610c4b565b9150610dc760208401610d84565b90509250929050565b815161ffff168152602080830151908201526040808301519082015260608101610149565b600080600060408486031215610e0a57600080fd5b8335610e1581610c4b565b9250602084013567ffffffffffffffff80821115610e3257600080fd5b818601915086601f830112610e4657600080fd5b813581811115610e5557600080fd5b8760208260051b8501011115610e6a57600080fd5b6020830194508093505050509250925092565b6020808252825182820181905260009190848201906040850190845b81811015610ed757610ec4838551805161ffff16825260208082015190830152604090810151910152565b9284019260609290920191600101610e99565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060208284031215610f2157600080fd5b61018182610d84565b600060208284031215610f3c57600080fd5b5051919050565b8051610d9681610c4b565b60006020808385031215610f6157600080fd5b825167ffffffffffffffff80821115610f7957600080fd5b818501915085601f830112610f8d57600080fd5b815181811115610f9f57610f9f610ee3565b8060051b604051601f19603f83011681018181108582111715610fc457610fc4610ee3565b604052918252848201925083810185019188831115610fe257600080fd5b938501935b8285101561100757610ff885610f43565b84529385019392850192610fe7565b98975050505050505050565b60006020828403121561102557600080fd5b815163ffffffff8116811461018157600080fd5b60006020828403121561104b57600080fd5b8151801515811461018157600080fd5b602081016005831061107d57634e487b7160e01b600052602160045260246000fd5b9190529056fea2646970667358221220f5d94db6de931badf0898b54b7010ce7759c3d28dbd8618f5821dccedbc113fe64736f6c63430008180033";
|
|
225
|
+
const isSuperArgs = (xs) => xs.length > 1;
|
|
226
|
+
class TriggersAndPortalLens__factory extends ethers_1.ContractFactory {
|
|
227
|
+
constructor(...args) {
|
|
228
|
+
if (isSuperArgs(args)) {
|
|
229
|
+
super(...args);
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
super(_abi, _bytecode, args[0]);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
getDeployTransaction(overrides) {
|
|
236
|
+
return super.getDeployTransaction(overrides || {});
|
|
237
|
+
}
|
|
238
|
+
deploy(overrides) {
|
|
239
|
+
return super.deploy(overrides || {});
|
|
240
|
+
}
|
|
241
|
+
connect(runner) {
|
|
242
|
+
return super.connect(runner);
|
|
243
|
+
}
|
|
244
|
+
static createInterface() {
|
|
245
|
+
return new ethers_1.Interface(_abi);
|
|
246
|
+
}
|
|
247
|
+
static connect(address, runner) {
|
|
248
|
+
return new ethers_1.Contract(address, _abi, runner);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
exports.TriggersAndPortalLens__factory = TriggersAndPortalLens__factory;
|
|
252
|
+
TriggersAndPortalLens__factory.bytecode = _bytecode;
|
|
253
|
+
TriggersAndPortalLens__factory.abi = _abi;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./utils/chainTypes"), exports);
|
|
18
|
+
__exportStar(require("./utils/addresses"), exports);
|
|
19
|
+
__exportStar(require("./utils/bignumbers"), exports);
|
|
20
|
+
__exportStar(require("./utils/chipsCalculationsUtils"), exports);
|
|
21
|
+
__exportStar(require("./utils/leverageCalculationsUtils"), exports);
|
|
22
|
+
__exportStar(require("./utils/cloning"), exports);
|
|
23
|
+
__exportStar(require("./utils/enumTypes"), exports);
|
|
24
|
+
__exportStar(require("./utils/ethersTypes"), exports);
|
|
25
|
+
__exportStar(require("./utils/hashes"), exports);
|
|
26
|
+
__exportStar(require("./utils/lynxScalesUtils"), exports);
|
|
27
|
+
__exportStar(require("./utils/types"), exports);
|
|
28
|
+
__exportStar(require("./common/constants/contractEnums"), exports);
|
|
29
|
+
__exportStar(require("./common/constants/generalConstants"), exports);
|
|
30
|
+
__exportStar(require("./common/constants/scales"), exports);
|
|
31
|
+
__exportStar(require("./common/constants/pairIds"), exports);
|
|
32
|
+
__exportStar(require("./common/constants/groupIds"), exports);
|
|
33
|
+
__exportStar(require("./common/constants/feeIds"), exports);
|
|
34
|
+
__exportStar(require("./common/priceFeeds/pyth/pythFeedConstants"), exports);
|
|
35
|
+
__exportStar(require("./common/priceFeeds/pyth/pythFeedFunctions"), exports);
|
|
36
|
+
// export * from "./abis";
|
|
37
|
+
__exportStar(require("./addresses/lensAddresses"), exports);
|
|
38
|
+
__exportStar(require("./common/contractsIntegration/deployedContractsConnector"), exports);
|
|
39
|
+
__exportStar(require("./common/typechain/contracts/Peripheral/Lens/IntentsVerifierLens"), exports);
|
|
40
|
+
__exportStar(require("./common/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens"), exports);
|
|
41
|
+
__exportStar(require("./common/typechain/contracts/Peripheral/Lens/LexLens"), exports);
|
|
42
|
+
__exportStar(require("./common/typechain/contracts/Peripheral/Lens/TradingFloorLens"), exports);
|
|
43
|
+
__exportStar(require("./common/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory"), exports);
|
|
44
|
+
__exportStar(require("./common/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory"), exports);
|
|
45
|
+
__exportStar(require("./common/typechain/factories/contracts/Peripheral/Lens/LexLens__factory"), exports);
|
|
46
|
+
__exportStar(require("./common/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSameAddress = isSameAddress;
|
|
4
|
+
exports.isSameTxHash = isSameTxHash;
|
|
5
|
+
exports.isSameBytes32 = isSameBytes32;
|
|
6
|
+
function isSameAddress(addressA, addressB) {
|
|
7
|
+
return addressA.toLowerCase() === addressB.toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
function isSameTxHash(hashA, hashB) {
|
|
10
|
+
return hashA.toLowerCase() === hashB.toLowerCase();
|
|
11
|
+
}
|
|
12
|
+
function isSameBytes32(bytes32A, bytes32B) {
|
|
13
|
+
return bytes32A.toLowerCase() === bytes32B.toLowerCase();
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.etherBnToFloat = etherBnToFloat;
|
|
4
|
+
exports.unitsBnToFloat = unitsBnToFloat;
|
|
5
|
+
exports.floatToEtherBn = floatToEtherBn;
|
|
6
|
+
exports.floatToUnitsBn = floatToUnitsBn;
|
|
7
|
+
exports.bigintToHumanNumber = bigintToHumanNumber;
|
|
8
|
+
const ethers_1 = require("ethers");
|
|
9
|
+
function etherBnToFloat(etherBn) {
|
|
10
|
+
return parseFloat(ethers_1.ethers.formatEther(etherBn.toString()));
|
|
11
|
+
}
|
|
12
|
+
function unitsBnToFloat(etherBn, decimals) {
|
|
13
|
+
return parseFloat(ethers_1.ethers.formatUnits(etherBn.toString(), decimals));
|
|
14
|
+
}
|
|
15
|
+
function floatToEtherBn(units) {
|
|
16
|
+
return ethers_1.ethers.parseEther(units.toFixed(18));
|
|
17
|
+
}
|
|
18
|
+
function floatToUnitsBn(units, decimals, precisionDecimals) {
|
|
19
|
+
return ethers_1.ethers.parseUnits(units.toFixed(precisionDecimals ?? decimals), decimals);
|
|
20
|
+
}
|
|
21
|
+
function bigintToHumanNumber(value, decimals, decimalsToShow, useCommas = true) {
|
|
22
|
+
const decimalValue = (value / BigInt(10 ** decimals)).toString();
|
|
23
|
+
const fractionalValue = (value % BigInt(10 ** decimals))
|
|
24
|
+
.toString()
|
|
25
|
+
.padStart(decimals, "0")
|
|
26
|
+
.slice(0, decimalsToShow);
|
|
27
|
+
let result = decimalsToShow > 0 ? `${decimalValue}.${fractionalValue}` : decimalValue;
|
|
28
|
+
if (useCommas) {
|
|
29
|
+
const [integerPart, fractionPart] = result.split(".");
|
|
30
|
+
result =
|
|
31
|
+
integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",") +
|
|
32
|
+
(fractionPart ? `.${fractionPart}` : "");
|
|
33
|
+
}
|
|
34
|
+
return result.replace(/(\.\d*?[1-9])0+|\.0+$/, "$1");
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CHAIN_ID_AVALANCHE_C_CHAIN = exports.CHAIN_ID_LINEA = exports.CHAIN_ID_CELO = exports.CHAIN_ID_ARBITRUM_ONE = exports.CHAIN_ID_MODE = exports.CHAIN_ID_MANTLE_TESTNET = exports.CHAIN_ID_MANTLE_MAINNET = exports.CHAIN_ID_BOBA_GOERLI = exports.CHAIN_ID_BOBA_MAINNET = exports.CHAIN_ID_FUSE = exports.CHAIN_ID_MATIC_MAINNET = exports.CHAIN_ID_FANTOM_OPERA = exports.CHAIN_ID_POLYGON = exports.CHAIN_ID_BSC = exports.CHAIN_ID_OPTIMISM = exports.CHAIN_ID_ETHEREUM_ROPSTEN = exports.CHAIN_ID_ETHEREUM_MAINNET = void 0;
|
|
4
|
+
exports.CHAIN_ID_ETHEREUM_MAINNET = 1;
|
|
5
|
+
exports.CHAIN_ID_ETHEREUM_ROPSTEN = 3;
|
|
6
|
+
exports.CHAIN_ID_OPTIMISM = 10;
|
|
7
|
+
exports.CHAIN_ID_BSC = 56;
|
|
8
|
+
exports.CHAIN_ID_POLYGON = 137;
|
|
9
|
+
exports.CHAIN_ID_FANTOM_OPERA = 250;
|
|
10
|
+
exports.CHAIN_ID_MATIC_MAINNET = 137;
|
|
11
|
+
exports.CHAIN_ID_FUSE = 122;
|
|
12
|
+
exports.CHAIN_ID_BOBA_MAINNET = 288;
|
|
13
|
+
exports.CHAIN_ID_BOBA_GOERLI = 2888;
|
|
14
|
+
exports.CHAIN_ID_MANTLE_MAINNET = 5000;
|
|
15
|
+
exports.CHAIN_ID_MANTLE_TESTNET = 5001;
|
|
16
|
+
exports.CHAIN_ID_MODE = 34443;
|
|
17
|
+
exports.CHAIN_ID_ARBITRUM_ONE = 42161;
|
|
18
|
+
exports.CHAIN_ID_CELO = 42220;
|
|
19
|
+
exports.CHAIN_ID_LINEA = 59144;
|
|
20
|
+
exports.CHAIN_ID_AVALANCHE_C_CHAIN = 43114;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.floatToChipsBn = floatToChipsBn;
|
|
4
|
+
exports.chipsBnToUnits = chipsBnToUnits;
|
|
5
|
+
const scales_1 = require("../common/constants/scales");
|
|
6
|
+
const bignumbers_1 = require("./bignumbers");
|
|
7
|
+
function floatToChipsBn(value) {
|
|
8
|
+
return (0, bignumbers_1.floatToUnitsBn)(value, scales_1.CHIP_DECIMALS);
|
|
9
|
+
}
|
|
10
|
+
function chipsBnToUnits(chipAmount) {
|
|
11
|
+
return (0, bignumbers_1.unitsBnToFloat)(chipAmount, scales_1.CHIP_DECIMALS);
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cloneAndCompleteOverride = cloneAndCompleteOverride;
|
|
4
|
+
exports.cloneAndOverride = cloneAndOverride;
|
|
5
|
+
/**
|
|
6
|
+
* Note : Enforces to fill all the fields
|
|
7
|
+
*/
|
|
8
|
+
function cloneAndCompleteOverride(source, overrides) {
|
|
9
|
+
return cloneAndOverride(source, overrides);
|
|
10
|
+
}
|
|
11
|
+
function cloneAndOverride(source, overrides) {
|
|
12
|
+
const safeOverrides = overrides || {};
|
|
13
|
+
return {
|
|
14
|
+
...source,
|
|
15
|
+
...safeOverrides,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ethersStructResponseToObject = ethersStructResponseToObject;
|
|
4
|
+
exports.ethersStructResponseToArray = ethersStructResponseToArray;
|
|
5
|
+
/**
|
|
6
|
+
* This functions takes a tuple returned from an 'ethers' contract object and returns it in a pure object form.
|
|
7
|
+
*/
|
|
8
|
+
function ethersStructResponseToObject(ethersStructResponse,
|
|
9
|
+
// NOTE : This is needed due to changes in ethers 6 + typechain that returns weird proxy object for struct which
|
|
10
|
+
// makes it hard/impossible to get the proper keys of the intended type.
|
|
11
|
+
// TODO : Solve it if possible ?
|
|
12
|
+
emptyConcreteObject) {
|
|
13
|
+
const obj = {};
|
|
14
|
+
// for (let key in ethersStructResponse) {
|
|
15
|
+
for (let key of Object.keys(emptyConcreteObject)) {
|
|
16
|
+
// DEV_NOTE : We assume that all numeric keys belongs to the array and ignore them
|
|
17
|
+
if (Number.isNaN(parseInt(key))) {
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
const value = ethersStructResponse[key];
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
obj[key] = value;
|
|
22
|
+
// const isBigNumber = value instanceof BigNumber || value["_isBigNumber"];
|
|
23
|
+
const isBigNumber = false;
|
|
24
|
+
// BigNumbers are taken 'as is', other objects are cleaned as well
|
|
25
|
+
// This part handles structs within structs
|
|
26
|
+
if (value instanceof Object && !isFunction(value)) {
|
|
27
|
+
if (isBigNumber) {
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
obj[key] = BigInt(value);
|
|
30
|
+
}
|
|
31
|
+
else if (Array.isArray(value)) {
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
obj[key] = ethersStructResponseToArray(value);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
obj[key] = ethersStructResponseToObject(value);
|
|
38
|
+
}
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
// console.log(`key ${key} | obj[key] : ${obj[key]}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return obj;
|
|
45
|
+
}
|
|
46
|
+
function ethersStructResponseToArray(ethersStructResponseArray, emptyConcreteObject) {
|
|
47
|
+
return ethersStructResponseArray.map((struct) => ethersStructResponseToObject(struct, emptyConcreteObject));
|
|
48
|
+
}
|
|
49
|
+
function isFunction(functionToCheck) {
|
|
50
|
+
return (functionToCheck && {}.toString.call(functionToCheck) === "[object Function]");
|
|
51
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hashContractName = hashContractName;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
function hashContractName(contractName) {
|
|
6
|
+
const contractNameHash = ethers_1.ethers.solidityPackedKeccak256(["string"], [contractName]);
|
|
7
|
+
return contractNameHash;
|
|
8
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scaledLeverageToUnits = scaledLeverageToUnits;
|
|
4
|
+
exports.floatUnitsToScaledLeverage = floatUnitsToScaledLeverage;
|
|
5
|
+
exports.calculateLeveragedPosition = calculateLeveragedPosition;
|
|
6
|
+
exports.calculateCollateralFromLeveragedPosition = calculateCollateralFromLeveragedPosition;
|
|
7
|
+
exports.calculateLeveragedPosition_leverageUnits = calculateLeveragedPosition_leverageUnits;
|
|
8
|
+
const scales_1 = require("../common/constants/scales");
|
|
9
|
+
function scaledLeverageToUnits(scaledLeverage) {
|
|
10
|
+
return scaledLeverage / scales_1.LEVERAGE_MULTIPLIER_SCALE;
|
|
11
|
+
}
|
|
12
|
+
function floatUnitsToScaledLeverage(leverageInUnits) {
|
|
13
|
+
return leverageInUnits * scales_1.LEVERAGE_MULTIPLIER_SCALE;
|
|
14
|
+
}
|
|
15
|
+
function calculateLeveragedPosition(collateral, leverage) {
|
|
16
|
+
return (collateral * BigInt(leverage)) / scales_1.LEVERAGE_UNIT;
|
|
17
|
+
}
|
|
18
|
+
function calculateCollateralFromLeveragedPosition(leveragedPosition, leverage) {
|
|
19
|
+
return (leveragedPosition * scales_1.LEVERAGE_UNIT) / leverage;
|
|
20
|
+
}
|
|
21
|
+
function calculateLeveragedPosition_leverageUnits(collateral, leverageInUnits) {
|
|
22
|
+
// TODO : Change after changing scale
|
|
23
|
+
const leverageBn = floatUnitsToScaledLeverage(leverageInUnits);
|
|
24
|
+
return calculateLeveragedPosition(collateral, leverageBn);
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.precisionBnToFloat = precisionBnToFloat;
|
|
4
|
+
exports.floatToPrecisionBn = floatToPrecisionBn;
|
|
5
|
+
exports.priceBnToFloat = priceBnToFloat;
|
|
6
|
+
exports.floatToPriceBn = floatToPriceBn;
|
|
7
|
+
const scales_1 = require("../common/constants/scales");
|
|
8
|
+
const bignumbers_1 = require("./bignumbers");
|
|
9
|
+
function precisionBnToFloat(precisionBn) {
|
|
10
|
+
return (0, bignumbers_1.unitsBnToFloat)(precisionBn, Number(scales_1.PRECISION_SCALE));
|
|
11
|
+
}
|
|
12
|
+
function floatToPrecisionBn(value) {
|
|
13
|
+
return (0, bignumbers_1.floatToUnitsBn)(value, Number(scales_1.PRECISION_SCALE));
|
|
14
|
+
}
|
|
15
|
+
function priceBnToFloat(pricesBn) {
|
|
16
|
+
return (0, bignumbers_1.unitsBnToFloat)(pricesBn, scales_1.PRICES_SCALE);
|
|
17
|
+
}
|
|
18
|
+
function floatToPriceBn(priceUnits) {
|
|
19
|
+
return (0, bignumbers_1.floatToUnitsBn)(priceUnits, scales_1.PRICES_SCALE);
|
|
20
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const LensAddresses: {
|
|
2
|
+
readonly boba: {
|
|
3
|
+
readonly lexLens: "0xCcFaDF4E72d5b2D382555E0eb72a1BF6F7f0EF7F";
|
|
4
|
+
readonly tradingFloorLensLens: "0xed9D263917921cb5f0B9a59c5083beA4075F33e7";
|
|
5
|
+
readonly intentsVerifierLens: "0x8F33670B7a076793D178D340AD70Cc097DD03739";
|
|
6
|
+
readonly triggersAndPortalLens: "0xA03312361D07dfAe0C517a441C69BFA9E84e38bf";
|
|
7
|
+
};
|
|
8
|
+
readonly sonic: {
|
|
9
|
+
readonly lexLens: "0xBcb1D4ACbc844ba5FC0aA411b98aebD4A508B65F";
|
|
10
|
+
readonly tradingFloorLensLens: "0xa5802951D972372f1385e9Ac83df738b3323d0A8";
|
|
11
|
+
readonly intentsVerifierLens: "0xDBe9130AAe593Ec73a838ce286fa84c193bceFA1";
|
|
12
|
+
readonly triggersAndPortalLens: "0xaA96df0a4F01212169c2347dc23D5AEb89924839";
|
|
13
|
+
};
|
|
14
|
+
readonly fantom: {
|
|
15
|
+
readonly lexLens: "0xB5A5041654391a720953D346367D3A3BE9c3d47B";
|
|
16
|
+
readonly tradingFloorLensLens: "0x30377D42736Bf4b40A67C18e5dFC7f45496e8569";
|
|
17
|
+
readonly intentsVerifierLens: "0xD9E77b2A3E9B1a21aC256802bB86Cba3e21627E7";
|
|
18
|
+
readonly triggersAndPortalLens: "0x9544C73C97BD292a1F09ef671A5f8CcDf9Ff5429";
|
|
19
|
+
};
|
|
20
|
+
readonly flare: {
|
|
21
|
+
readonly lexLens: "0x812Ea46a0618f923ae473eb239a89A8169b34B85";
|
|
22
|
+
readonly tradingFloorLensLens: "0x13d878F3C3f32400A727662af7dfAdBc8b389637";
|
|
23
|
+
readonly intentsVerifierLens: "0x33576dFbA7Ed5E3F8F744132D6885cE106178161";
|
|
24
|
+
readonly triggersAndPortalLens: "0x625D49B0258BB8277516C07494910d420FA31B06";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=lensAddresses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lensAddresses.d.ts","sourceRoot":"","sources":["../../../addresses/lensAddresses.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;CAyBhB,CAAC"}
|
|
@@ -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
|
+
};
|