@across-protocol/sdk 3.3.32 → 3.4.0
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/clients/BundleDataClient/utils/SuperstructUtils.d.ts +10 -10
- package/dist/cjs/gasPriceOracle/adapters/arbitrum.d.ts +2 -1
- package/dist/cjs/gasPriceOracle/adapters/arbitrum.js +2 -2
- package/dist/cjs/gasPriceOracle/adapters/arbitrum.js.map +1 -1
- package/dist/cjs/gasPriceOracle/adapters/ethereum.d.ts +6 -4
- package/dist/cjs/gasPriceOracle/adapters/ethereum.js +21 -13
- package/dist/cjs/gasPriceOracle/adapters/ethereum.js.map +1 -1
- package/dist/cjs/gasPriceOracle/adapters/linea-viem.d.ts +2 -1
- package/dist/cjs/gasPriceOracle/adapters/linea-viem.js +16 -10
- package/dist/cjs/gasPriceOracle/adapters/linea-viem.js.map +1 -1
- package/dist/cjs/gasPriceOracle/adapters/linea.d.ts +2 -1
- package/dist/cjs/gasPriceOracle/adapters/linea.js +2 -2
- package/dist/cjs/gasPriceOracle/adapters/linea.js.map +1 -1
- package/dist/cjs/gasPriceOracle/adapters/polygon.d.ts +21 -1
- package/dist/cjs/gasPriceOracle/adapters/polygon.js +45 -5
- package/dist/cjs/gasPriceOracle/adapters/polygon.js.map +1 -1
- package/dist/cjs/gasPriceOracle/oracle.d.ts +11 -3
- package/dist/cjs/gasPriceOracle/oracle.js +29 -27
- package/dist/cjs/gasPriceOracle/oracle.js.map +1 -1
- package/dist/cjs/providers/types.d.ts +3 -3
- package/dist/cjs/relayFeeCalculator/chain-queries/alephZero.d.ts +0 -229
- package/dist/cjs/relayFeeCalculator/chain-queries/alephZero.js +2 -12
- package/dist/cjs/relayFeeCalculator/chain-queries/alephZero.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.d.ts +10 -5
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js +55 -11
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.d.ts +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.js +4 -5
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/polygon.d.ts +0 -229
- package/dist/cjs/relayFeeCalculator/chain-queries/polygon.js +2 -12
- package/dist/cjs/relayFeeCalculator/chain-queries/polygon.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +1 -1
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
- package/dist/cjs/utils/common.d.ts +1 -8
- package/dist/cjs/utils/common.js +1 -83
- package/dist/cjs/utils/common.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.d.ts +10 -10
- package/dist/esm/gasPriceOracle/adapters/arbitrum.d.ts +10 -1
- package/dist/esm/gasPriceOracle/adapters/arbitrum.js +10 -4
- package/dist/esm/gasPriceOracle/adapters/arbitrum.js.map +1 -1
- package/dist/esm/gasPriceOracle/adapters/ethereum.d.ts +19 -6
- package/dist/esm/gasPriceOracle/adapters/ethereum.js +38 -16
- package/dist/esm/gasPriceOracle/adapters/ethereum.js.map +1 -1
- package/dist/esm/gasPriceOracle/adapters/linea-viem.d.ts +19 -1
- package/dist/esm/gasPriceOracle/adapters/linea-viem.js +33 -10
- package/dist/esm/gasPriceOracle/adapters/linea-viem.js.map +1 -1
- package/dist/esm/gasPriceOracle/adapters/linea.d.ts +2 -1
- package/dist/esm/gasPriceOracle/adapters/linea.js +6 -2
- package/dist/esm/gasPriceOracle/adapters/linea.js.map +1 -1
- package/dist/esm/gasPriceOracle/adapters/polygon.d.ts +27 -1
- package/dist/esm/gasPriceOracle/adapters/polygon.js +49 -5
- package/dist/esm/gasPriceOracle/adapters/polygon.js.map +1 -1
- package/dist/esm/gasPriceOracle/oracle.d.ts +16 -8
- package/dist/esm/gasPriceOracle/oracle.js +35 -33
- package/dist/esm/gasPriceOracle/oracle.js.map +1 -1
- package/dist/esm/providers/types.d.ts +3 -3
- package/dist/esm/relayFeeCalculator/chain-queries/alephZero.d.ts +0 -229
- package/dist/esm/relayFeeCalculator/chain-queries/alephZero.js +3 -13
- package/dist/esm/relayFeeCalculator/chain-queries/alephZero.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.d.ts +21 -7
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js +68 -15
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/factory.js +4 -5
- package/dist/esm/relayFeeCalculator/chain-queries/factory.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/polygon.d.ts +0 -229
- package/dist/esm/relayFeeCalculator/chain-queries/polygon.js +3 -13
- package/dist/esm/relayFeeCalculator/chain-queries/polygon.js.map +1 -1
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +1 -1
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
- package/dist/esm/utils/common.d.ts +1 -19
- package/dist/esm/utils/common.js +3 -95
- package/dist/esm/utils/common.js.map +1 -1
- package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts +10 -10
- package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts +10 -1
- package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/adapters/ethereum.d.ts +19 -6
- package/dist/types/gasPriceOracle/adapters/ethereum.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/adapters/linea-viem.d.ts +19 -1
- package/dist/types/gasPriceOracle/adapters/linea-viem.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/adapters/linea.d.ts +2 -1
- package/dist/types/gasPriceOracle/adapters/linea.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/adapters/polygon.d.ts +27 -1
- package/dist/types/gasPriceOracle/adapters/polygon.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/oracle.d.ts +16 -8
- package/dist/types/gasPriceOracle/oracle.d.ts.map +1 -1
- package/dist/types/providers/types.d.ts +3 -3
- package/dist/types/relayFeeCalculator/chain-queries/alephZero.d.ts +0 -229
- package/dist/types/relayFeeCalculator/chain-queries/alephZero.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts +21 -7
- package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/polygon.d.ts +0 -229
- package/dist/types/relayFeeCalculator/chain-queries/polygon.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +1 -1
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
- package/dist/types/utils/common.d.ts +1 -19
- package/dist/types/utils/common.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/gasPriceOracle/adapters/arbitrum.ts +13 -6
- package/src/gasPriceOracle/adapters/ethereum.ts +43 -12
- package/src/gasPriceOracle/adapters/linea-viem.ts +32 -6
- package/src/gasPriceOracle/adapters/linea.ts +7 -2
- package/src/gasPriceOracle/adapters/polygon.ts +46 -5
- package/src/gasPriceOracle/oracle.ts +53 -28
- package/src/relayFeeCalculator/chain-queries/alephZero.ts +1 -29
- package/src/relayFeeCalculator/chain-queries/baseQuery.ts +73 -20
- package/src/relayFeeCalculator/chain-queries/factory.ts +6 -6
- package/src/relayFeeCalculator/chain-queries/polygon.ts +1 -29
- package/src/relayFeeCalculator/relayFeeCalculator.ts +6 -1
- package/src/utils/common.ts +2 -92
- package/dist/cjs/gasPriceOracle/adapters/arbitrum-viem.d.ts +0 -3
- package/dist/cjs/gasPriceOracle/adapters/arbitrum-viem.js +0 -21
- package/dist/cjs/gasPriceOracle/adapters/arbitrum-viem.js.map +0 -1
- package/dist/cjs/gasPriceOracle/adapters/ethereum-viem.d.ts +0 -4
- package/dist/cjs/gasPriceOracle/adapters/ethereum-viem.js +0 -26
- package/dist/cjs/gasPriceOracle/adapters/ethereum-viem.js.map +0 -1
- package/dist/cjs/gasPriceOracle/adapters/polygon-viem.d.ts +0 -3
- package/dist/cjs/gasPriceOracle/adapters/polygon-viem.js +0 -84
- package/dist/cjs/gasPriceOracle/adapters/polygon-viem.js.map +0 -1
- package/dist/cjs/package.json +0 -1
- package/dist/esm/gasPriceOracle/adapters/arbitrum-viem.d.ts +0 -3
- package/dist/esm/gasPriceOracle/adapters/arbitrum-viem.js +0 -20
- package/dist/esm/gasPriceOracle/adapters/arbitrum-viem.js.map +0 -1
- package/dist/esm/gasPriceOracle/adapters/ethereum-viem.d.ts +0 -4
- package/dist/esm/gasPriceOracle/adapters/ethereum-viem.js +0 -21
- package/dist/esm/gasPriceOracle/adapters/ethereum-viem.js.map +0 -1
- package/dist/esm/gasPriceOracle/adapters/polygon-viem.d.ts +0 -3
- package/dist/esm/gasPriceOracle/adapters/polygon-viem.js +0 -82
- package/dist/esm/gasPriceOracle/adapters/polygon-viem.js.map +0 -1
- package/dist/esm/package.json +0 -1
- package/dist/types/gasPriceOracle/adapters/arbitrum-viem.d.ts +0 -4
- package/dist/types/gasPriceOracle/adapters/arbitrum-viem.d.ts.map +0 -1
- package/dist/types/gasPriceOracle/adapters/ethereum-viem.d.ts +0 -5
- package/dist/types/gasPriceOracle/adapters/ethereum-viem.d.ts.map +0 -1
- package/dist/types/gasPriceOracle/adapters/polygon-viem.d.ts +0 -4
- package/dist/types/gasPriceOracle/adapters/polygon-viem.d.ts.map +0 -1
- package/src/gasPriceOracle/adapters/arbitrum-viem.ts +0 -13
- package/src/gasPriceOracle/adapters/ethereum-viem.ts +0 -19
- package/src/gasPriceOracle/adapters/polygon-viem.ts +0 -86
|
@@ -1,233 +1,4 @@
|
|
|
1
|
-
import { Logger } from "../relayFeeCalculator";
|
|
2
|
-
import { providers } from "ethers";
|
|
3
1
|
import { QueryBase } from "./baseQuery";
|
|
4
2
|
export declare class AlephZeroQueries extends QueryBase {
|
|
5
|
-
constructor(provider: providers.Provider, symbolMapping?: {
|
|
6
|
-
ACX: {
|
|
7
|
-
name: string;
|
|
8
|
-
symbol: string;
|
|
9
|
-
decimals: number;
|
|
10
|
-
addresses: {
|
|
11
|
-
[x: number]: string;
|
|
12
|
-
};
|
|
13
|
-
coingeckoId: string;
|
|
14
|
-
};
|
|
15
|
-
ARB: {
|
|
16
|
-
name: string;
|
|
17
|
-
symbol: string;
|
|
18
|
-
decimals: number;
|
|
19
|
-
addresses: {
|
|
20
|
-
[x: number]: string;
|
|
21
|
-
};
|
|
22
|
-
coingeckoId: string;
|
|
23
|
-
};
|
|
24
|
-
AZERO: {
|
|
25
|
-
name: string;
|
|
26
|
-
symbol: string;
|
|
27
|
-
decimals: number;
|
|
28
|
-
addresses: {
|
|
29
|
-
[x: number]: string;
|
|
30
|
-
};
|
|
31
|
-
coingeckoId: string;
|
|
32
|
-
};
|
|
33
|
-
BAL: {
|
|
34
|
-
name: string;
|
|
35
|
-
symbol: string;
|
|
36
|
-
decimals: number;
|
|
37
|
-
addresses: {
|
|
38
|
-
[x: number]: string;
|
|
39
|
-
};
|
|
40
|
-
coingeckoId: string;
|
|
41
|
-
};
|
|
42
|
-
BADGER: {
|
|
43
|
-
name: string;
|
|
44
|
-
symbol: string;
|
|
45
|
-
decimals: number;
|
|
46
|
-
addresses: {
|
|
47
|
-
[x: number]: string;
|
|
48
|
-
};
|
|
49
|
-
coingeckoId: string;
|
|
50
|
-
};
|
|
51
|
-
BOBA: {
|
|
52
|
-
name: string;
|
|
53
|
-
symbol: string;
|
|
54
|
-
decimals: number;
|
|
55
|
-
addresses: {
|
|
56
|
-
[x: number]: string;
|
|
57
|
-
};
|
|
58
|
-
coingeckoId: string;
|
|
59
|
-
};
|
|
60
|
-
DAI: {
|
|
61
|
-
name: string;
|
|
62
|
-
symbol: string;
|
|
63
|
-
decimals: number;
|
|
64
|
-
addresses: {
|
|
65
|
-
[x: number]: string;
|
|
66
|
-
};
|
|
67
|
-
coingeckoId: string;
|
|
68
|
-
};
|
|
69
|
-
ETH: {
|
|
70
|
-
name: string;
|
|
71
|
-
symbol: string;
|
|
72
|
-
decimals: number;
|
|
73
|
-
addresses: {
|
|
74
|
-
[x: number]: string;
|
|
75
|
-
};
|
|
76
|
-
coingeckoId: string;
|
|
77
|
-
};
|
|
78
|
-
GHO: {
|
|
79
|
-
name: string;
|
|
80
|
-
symbol: string;
|
|
81
|
-
decimals: number;
|
|
82
|
-
addresses: {
|
|
83
|
-
[x: number]: string;
|
|
84
|
-
};
|
|
85
|
-
coingeckoId: string;
|
|
86
|
-
};
|
|
87
|
-
LSK: {
|
|
88
|
-
name: string;
|
|
89
|
-
symbol: string;
|
|
90
|
-
decimals: number;
|
|
91
|
-
addresses: {
|
|
92
|
-
[x: number]: string;
|
|
93
|
-
};
|
|
94
|
-
coingeckoId: string;
|
|
95
|
-
};
|
|
96
|
-
MATIC: {
|
|
97
|
-
name: string;
|
|
98
|
-
symbol: string;
|
|
99
|
-
decimals: number;
|
|
100
|
-
addresses: {
|
|
101
|
-
[x: number]: string;
|
|
102
|
-
};
|
|
103
|
-
coingeckoId: string;
|
|
104
|
-
};
|
|
105
|
-
OP: {
|
|
106
|
-
name: string;
|
|
107
|
-
symbol: string;
|
|
108
|
-
decimals: number;
|
|
109
|
-
addresses: {
|
|
110
|
-
[x: number]: string;
|
|
111
|
-
};
|
|
112
|
-
coingeckoId: string;
|
|
113
|
-
};
|
|
114
|
-
POOL: {
|
|
115
|
-
name: string;
|
|
116
|
-
symbol: string;
|
|
117
|
-
decimals: number;
|
|
118
|
-
addresses: {
|
|
119
|
-
[x: number]: string;
|
|
120
|
-
};
|
|
121
|
-
coingeckoId: string;
|
|
122
|
-
};
|
|
123
|
-
SNX: {
|
|
124
|
-
name: string;
|
|
125
|
-
symbol: string;
|
|
126
|
-
decimals: number;
|
|
127
|
-
addresses: {
|
|
128
|
-
[x: number]: string;
|
|
129
|
-
};
|
|
130
|
-
coingeckoId: string;
|
|
131
|
-
};
|
|
132
|
-
UMA: {
|
|
133
|
-
name: string;
|
|
134
|
-
symbol: string;
|
|
135
|
-
decimals: number;
|
|
136
|
-
addresses: {
|
|
137
|
-
[x: number]: string;
|
|
138
|
-
};
|
|
139
|
-
coingeckoId: string;
|
|
140
|
-
};
|
|
141
|
-
USDB: {
|
|
142
|
-
name: string;
|
|
143
|
-
symbol: string;
|
|
144
|
-
decimals: number;
|
|
145
|
-
addresses: {
|
|
146
|
-
[x: number]: string;
|
|
147
|
-
};
|
|
148
|
-
coingeckoId: string;
|
|
149
|
-
};
|
|
150
|
-
USDC: {
|
|
151
|
-
name: string;
|
|
152
|
-
symbol: string;
|
|
153
|
-
decimals: number;
|
|
154
|
-
addresses: {
|
|
155
|
-
[x: number]: string;
|
|
156
|
-
};
|
|
157
|
-
coingeckoId: string;
|
|
158
|
-
};
|
|
159
|
-
"USDC.e": {
|
|
160
|
-
name: string;
|
|
161
|
-
symbol: string;
|
|
162
|
-
decimals: number;
|
|
163
|
-
addresses: {
|
|
164
|
-
[x: number]: string;
|
|
165
|
-
};
|
|
166
|
-
coingeckoId: string;
|
|
167
|
-
};
|
|
168
|
-
USDbC: {
|
|
169
|
-
name: string;
|
|
170
|
-
symbol: string;
|
|
171
|
-
decimals: number;
|
|
172
|
-
addresses: {
|
|
173
|
-
[x: number]: string;
|
|
174
|
-
};
|
|
175
|
-
coingeckoId: string;
|
|
176
|
-
};
|
|
177
|
-
USDzC: {
|
|
178
|
-
name: string;
|
|
179
|
-
symbol: string;
|
|
180
|
-
decimals: number;
|
|
181
|
-
addresses: {
|
|
182
|
-
[x: number]: string;
|
|
183
|
-
};
|
|
184
|
-
coingeckoId: string;
|
|
185
|
-
};
|
|
186
|
-
USDT: {
|
|
187
|
-
name: string;
|
|
188
|
-
symbol: string;
|
|
189
|
-
decimals: number;
|
|
190
|
-
addresses: {
|
|
191
|
-
[x: number]: string;
|
|
192
|
-
};
|
|
193
|
-
coingeckoId: string;
|
|
194
|
-
};
|
|
195
|
-
WAZERO: {
|
|
196
|
-
name: string;
|
|
197
|
-
symbol: string;
|
|
198
|
-
decimals: number;
|
|
199
|
-
addresses: {
|
|
200
|
-
[x: number]: string;
|
|
201
|
-
};
|
|
202
|
-
coingeckoId: string;
|
|
203
|
-
};
|
|
204
|
-
WBTC: {
|
|
205
|
-
name: string;
|
|
206
|
-
symbol: string;
|
|
207
|
-
decimals: number;
|
|
208
|
-
addresses: {
|
|
209
|
-
[x: number]: string;
|
|
210
|
-
};
|
|
211
|
-
coingeckoId: string;
|
|
212
|
-
};
|
|
213
|
-
WETH: {
|
|
214
|
-
name: string;
|
|
215
|
-
symbol: string;
|
|
216
|
-
decimals: number;
|
|
217
|
-
addresses: {
|
|
218
|
-
[x: number]: string;
|
|
219
|
-
};
|
|
220
|
-
coingeckoId: string;
|
|
221
|
-
};
|
|
222
|
-
WMATIC: {
|
|
223
|
-
name: string;
|
|
224
|
-
symbol: string;
|
|
225
|
-
decimals: number;
|
|
226
|
-
addresses: {
|
|
227
|
-
[x: number]: string;
|
|
228
|
-
};
|
|
229
|
-
coingeckoId: string;
|
|
230
|
-
};
|
|
231
|
-
}, spokePoolAddress?: string | undefined, simulatedRelayerAddress?: string, coingeckoProApiKey?: string, logger?: Logger, gasMarkup?: number);
|
|
232
3
|
getTokenPrice(tokenSymbol: string): Promise<number>;
|
|
233
4
|
}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import { __awaiter, __extends, __generator } from "tslib";
|
|
2
|
-
import
|
|
3
|
-
import { getDeployedAddress } from "../../utils/DeploymentUtils";
|
|
4
|
-
import { DEFAULT_LOGGER } from "../relayFeeCalculator";
|
|
5
|
-
import { CHAIN_IDs, DEFAULT_SIMULATED_RELAYER_ADDRESS, TOKEN_SYMBOLS_MAP } from "../../constants";
|
|
2
|
+
import { CHAIN_IDs } from "../../constants";
|
|
6
3
|
import { Coingecko } from "../../coingecko/Coingecko";
|
|
7
|
-
import { isDefined } from "../../utils";
|
|
8
4
|
import { QueryBase } from "./baseQuery";
|
|
9
5
|
var AlephZeroQueries = /** @class */ (function (_super) {
|
|
10
6
|
__extends(AlephZeroQueries, _super);
|
|
11
|
-
function AlephZeroQueries(
|
|
12
|
-
|
|
13
|
-
if (spokePoolAddress === void 0) { spokePoolAddress = getDeployedAddress("SpokePool", CHAIN_IDs.ALEPH_ZERO); }
|
|
14
|
-
if (simulatedRelayerAddress === void 0) { simulatedRelayerAddress = DEFAULT_SIMULATED_RELAYER_ADDRESS; }
|
|
15
|
-
if (logger === void 0) { logger = DEFAULT_LOGGER; }
|
|
16
|
-
if (gasMarkup === void 0) { gasMarkup = 0; }
|
|
17
|
-
assert(isDefined(spokePoolAddress));
|
|
18
|
-
return _super.call(this, provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, gasMarkup, logger, coingeckoProApiKey, undefined, "usd") || this;
|
|
7
|
+
function AlephZeroQueries() {
|
|
8
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
19
9
|
}
|
|
20
10
|
AlephZeroQueries.prototype.getTokenPrice = function (tokenSymbol) {
|
|
21
11
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alephZero.js","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/alephZero.ts"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"alephZero.js","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/alephZero.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;IAAsC,oCAAS;IAA/C;;IAeA,CAAC;IAdgB,wCAAa,GAA5B,UAA6B,WAAmB;;;;;;wBAC9C,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;4BAAE,MAAM,IAAI,KAAK,CAAC,UAAG,WAAW,+BAA4B,CAAC,CAAC;wBAC5F,iBAAiB,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;wBACvD,qBAAM,iBAAiB,CAAC,yBAAyB,CACtE,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,EAC5D,KAAK,CACN,EAAA;;wBAHK,KAAiB,SAGtB,EAHQ,UAAU,QAAA;wBAKQ,qBAAM,iBAAiB,CAAC,yBAAyB,CAC1E,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,EACxD,KAAK,CACN,EAAA;;wBAHK,KAAqB,SAG1B,EAHQ,cAAc,QAAA;wBAIvB,sBAAO,MAAM,CAAC,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAC;;;;KAC5F;IACH,uBAAC;AAAD,CAAC,AAfD,CAAsC,SAAS,GAe9C"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { L2Provider } from "@eth-optimism/sdk/dist/interfaces/l2-provider";
|
|
2
|
-
import { providers } from "ethers";
|
|
2
|
+
import { PopulatedTransaction, providers } from "ethers";
|
|
3
3
|
import { Deposit } from "../../interfaces";
|
|
4
4
|
import { SpokePool } from "../../typechain";
|
|
5
|
-
import { BigNumberish, TransactionCostEstimate } from "../../utils";
|
|
5
|
+
import { BigNumberish, TransactionCostEstimate, BigNumber } from "../../utils";
|
|
6
6
|
import { Logger, QueryInterface } from "../relayFeeCalculator";
|
|
7
7
|
import { Transport } from "viem";
|
|
8
8
|
type Provider = providers.Provider;
|
|
@@ -20,7 +20,6 @@ export declare class QueryBase implements QueryInterface {
|
|
|
20
20
|
readonly symbolMapping: SymbolMappingType;
|
|
21
21
|
readonly spokePoolAddress: string;
|
|
22
22
|
readonly simulatedRelayerAddress: string;
|
|
23
|
-
readonly gasMarkup: number;
|
|
24
23
|
readonly logger: Logger;
|
|
25
24
|
readonly coingeckoProApiKey?: string | undefined;
|
|
26
25
|
readonly fixedGasPrice?: BigNumberish | undefined;
|
|
@@ -32,13 +31,12 @@ export declare class QueryBase implements QueryInterface {
|
|
|
32
31
|
* @param symbolMapping A mapping to valid ERC20 tokens and their respective characteristics
|
|
33
32
|
* @param spokePoolAddress The valid address of the Spoke Pool deployment
|
|
34
33
|
* @param simulatedRelayerAddress The address that these queries will reference as the sender. Note: This address must be approved for USDC
|
|
35
|
-
* @param gasMarkup A multiplier that is applied to the total gas estimate
|
|
36
34
|
* @param logger A logging utility to report logs
|
|
37
35
|
* @param coingeckoProApiKey An optional CoinGecko API key that links to a PRO account
|
|
38
36
|
* @param fixedGasPrice Overrides the gas price with a fixed value. Note: primarily used for the Boba blockchain
|
|
39
37
|
* @param coingeckoBaseCurrency The basis currency that CoinGecko will use to resolve pricing
|
|
40
38
|
*/
|
|
41
|
-
constructor(provider: Provider | OptimismProvider, symbolMapping: SymbolMappingType, spokePoolAddress: string, simulatedRelayerAddress: string,
|
|
39
|
+
constructor(provider: Provider | OptimismProvider, symbolMapping: SymbolMappingType, spokePoolAddress: string, simulatedRelayerAddress: string, logger: Logger, coingeckoProApiKey?: string | undefined, fixedGasPrice?: BigNumberish | undefined, coingeckoBaseCurrency?: string);
|
|
42
40
|
/**
|
|
43
41
|
* Retrieves the current gas costs of performing a fillRelay contract at the referenced SpokePool.
|
|
44
42
|
* @param deposit V3 deposit instance.
|
|
@@ -46,14 +44,30 @@ export declare class QueryBase implements QueryInterface {
|
|
|
46
44
|
* @param options
|
|
47
45
|
* @param options.gasPrice Optional gas price to use for the simulation.
|
|
48
46
|
* @param options.gasUnits Optional gas units to use for the simulation.
|
|
49
|
-
* @param options.omitMarkup Optional flag to omit the gas markup.
|
|
50
47
|
* @param options.transport Optional transport object for custom gas price retrieval.
|
|
51
48
|
* @returns The gas estimate for this function call (multiplied with the optional buffer).
|
|
52
49
|
*/
|
|
53
50
|
getGasCosts(deposit: Deposit, relayer?: string, options?: Partial<{
|
|
54
51
|
gasPrice: BigNumberish;
|
|
55
52
|
gasUnits: BigNumberish;
|
|
56
|
-
|
|
53
|
+
baseFeeMultiplier: BigNumber;
|
|
54
|
+
transport: Transport;
|
|
55
|
+
}>): Promise<TransactionCostEstimate>;
|
|
56
|
+
/**
|
|
57
|
+
* Estimates the total gas cost required to submit an unsigned (populated) transaction on-chain.
|
|
58
|
+
* @param unsignedTx The unsigned transaction that this function will estimate.
|
|
59
|
+
* @param senderAddress The address that the transaction will be submitted from.
|
|
60
|
+
* @param provider A valid ethers provider - will be used to reason the gas price.
|
|
61
|
+
* @param options
|
|
62
|
+
* @param options.gasPrice A manually provided gas price - if set, this function will not resolve the current gas price.
|
|
63
|
+
* @param options.gasUnits A manually provided gas units - if set, this function will not estimate the gas units.
|
|
64
|
+
* @param options.transport A custom transport object for custom gas price retrieval.
|
|
65
|
+
* @returns Estimated cost in units of gas and the underlying gas token (gasPrice * estimatedGasUnits).
|
|
66
|
+
*/
|
|
67
|
+
estimateGas(unsignedTx: PopulatedTransaction, senderAddress: string, provider: providers.Provider | L2Provider<providers.Provider>, options?: Partial<{
|
|
68
|
+
gasPrice: BigNumberish;
|
|
69
|
+
gasUnits: BigNumberish;
|
|
70
|
+
baseFeeMultiplier: BigNumber;
|
|
57
71
|
transport: Transport;
|
|
58
72
|
}>): Promise<TransactionCostEstimate>;
|
|
59
73
|
/**
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { __awaiter, __generator } from "tslib";
|
|
2
|
-
import
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
|
+
import { isL2Provider as isOptimismL2Provider } from "@eth-optimism/sdk/dist/l2-provider";
|
|
3
|
+
import { VoidSigner } from "ethers";
|
|
3
4
|
import { Coingecko } from "../../coingecko";
|
|
4
5
|
import { CHAIN_IDs, DEFAULT_SIMULATED_RELAYER_ADDRESS } from "../../constants";
|
|
5
6
|
import { SpokePool__factory } from "../../typechain";
|
|
6
|
-
import {
|
|
7
|
+
import { populateV3Relay, BigNumber, toBNWei, bnZero, assert, chainIsOPStack, } from "../../utils";
|
|
8
|
+
import { getGasPriceEstimate } from "../../gasPriceOracle/oracle";
|
|
7
9
|
/**
|
|
8
10
|
* A unified QueryBase for querying gas costs, token prices, and decimals of various tokens
|
|
9
11
|
* on a blockchain.
|
|
@@ -15,19 +17,17 @@ var QueryBase = /** @class */ (function () {
|
|
|
15
17
|
* @param symbolMapping A mapping to valid ERC20 tokens and their respective characteristics
|
|
16
18
|
* @param spokePoolAddress The valid address of the Spoke Pool deployment
|
|
17
19
|
* @param simulatedRelayerAddress The address that these queries will reference as the sender. Note: This address must be approved for USDC
|
|
18
|
-
* @param gasMarkup A multiplier that is applied to the total gas estimate
|
|
19
20
|
* @param logger A logging utility to report logs
|
|
20
21
|
* @param coingeckoProApiKey An optional CoinGecko API key that links to a PRO account
|
|
21
22
|
* @param fixedGasPrice Overrides the gas price with a fixed value. Note: primarily used for the Boba blockchain
|
|
22
23
|
* @param coingeckoBaseCurrency The basis currency that CoinGecko will use to resolve pricing
|
|
23
24
|
*/
|
|
24
|
-
function QueryBase(provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress,
|
|
25
|
+
function QueryBase(provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, logger, coingeckoProApiKey, fixedGasPrice, coingeckoBaseCurrency) {
|
|
25
26
|
if (coingeckoBaseCurrency === void 0) { coingeckoBaseCurrency = "eth"; }
|
|
26
27
|
this.provider = provider;
|
|
27
28
|
this.symbolMapping = symbolMapping;
|
|
28
29
|
this.spokePoolAddress = spokePoolAddress;
|
|
29
30
|
this.simulatedRelayerAddress = simulatedRelayerAddress;
|
|
30
|
-
this.gasMarkup = gasMarkup;
|
|
31
31
|
this.logger = logger;
|
|
32
32
|
this.coingeckoProApiKey = coingeckoProApiKey;
|
|
33
33
|
this.fixedGasPrice = fixedGasPrice;
|
|
@@ -41,7 +41,6 @@ var QueryBase = /** @class */ (function () {
|
|
|
41
41
|
* @param options
|
|
42
42
|
* @param options.gasPrice Optional gas price to use for the simulation.
|
|
43
43
|
* @param options.gasUnits Optional gas units to use for the simulation.
|
|
44
|
-
* @param options.omitMarkup Optional flag to omit the gas markup.
|
|
45
44
|
* @param options.transport Optional transport object for custom gas price retrieval.
|
|
46
45
|
* @returns The gas estimate for this function call (multiplied with the optional buffer).
|
|
47
46
|
*/
|
|
@@ -49,33 +48,87 @@ var QueryBase = /** @class */ (function () {
|
|
|
49
48
|
if (relayer === void 0) { relayer = DEFAULT_SIMULATED_RELAYER_ADDRESS; }
|
|
50
49
|
if (options === void 0) { options = {}; }
|
|
51
50
|
return __awaiter(this, void 0, void 0, function () {
|
|
52
|
-
var _a, gasPrice, gasUnits,
|
|
51
|
+
var _a, gasPrice, gasUnits, baseFeeMultiplier, transport, tx, _b, nativeGasCost, tokenGasCost, impliedGasPrice;
|
|
53
52
|
return __generator(this, function (_c) {
|
|
54
53
|
switch (_c.label) {
|
|
55
54
|
case 0:
|
|
56
|
-
_a = options.gasPrice, gasPrice = _a === void 0 ? this.fixedGasPrice : _a, gasUnits = options.gasUnits,
|
|
57
|
-
gasMarkup = omitMarkup ? 0 : this.gasMarkup;
|
|
58
|
-
assert(gasMarkup > -1 && gasMarkup <= 4, "Require -1.0 < Gas Markup (".concat(gasMarkup, ") <= 4.0 for a total gas multiplier within (0, +5.0]"));
|
|
59
|
-
gasTotalMultiplier = toBNWei(1.0 + gasMarkup);
|
|
55
|
+
_a = options.gasPrice, gasPrice = _a === void 0 ? this.fixedGasPrice : _a, gasUnits = options.gasUnits, baseFeeMultiplier = options.baseFeeMultiplier, transport = options.transport;
|
|
60
56
|
return [4 /*yield*/, populateV3Relay(this.spokePool, deposit, relayer)];
|
|
61
57
|
case 1:
|
|
62
58
|
tx = _c.sent();
|
|
63
|
-
return [4 /*yield*/,
|
|
59
|
+
return [4 /*yield*/, this.estimateGas(tx, relayer, this.provider, {
|
|
64
60
|
gasPrice: gasPrice,
|
|
65
61
|
gasUnits: gasUnits,
|
|
62
|
+
baseFeeMultiplier: baseFeeMultiplier,
|
|
66
63
|
transport: transport,
|
|
67
64
|
})];
|
|
68
65
|
case 2:
|
|
69
66
|
_b = _c.sent(), nativeGasCost = _b.nativeGasCost, tokenGasCost = _b.tokenGasCost, impliedGasPrice = _b.gasPrice;
|
|
70
67
|
return [2 /*return*/, {
|
|
71
|
-
nativeGasCost: nativeGasCost
|
|
72
|
-
tokenGasCost: tokenGasCost
|
|
68
|
+
nativeGasCost: nativeGasCost,
|
|
69
|
+
tokenGasCost: tokenGasCost,
|
|
73
70
|
gasPrice: impliedGasPrice,
|
|
74
71
|
}];
|
|
75
72
|
}
|
|
76
73
|
});
|
|
77
74
|
});
|
|
78
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* Estimates the total gas cost required to submit an unsigned (populated) transaction on-chain.
|
|
78
|
+
* @param unsignedTx The unsigned transaction that this function will estimate.
|
|
79
|
+
* @param senderAddress The address that the transaction will be submitted from.
|
|
80
|
+
* @param provider A valid ethers provider - will be used to reason the gas price.
|
|
81
|
+
* @param options
|
|
82
|
+
* @param options.gasPrice A manually provided gas price - if set, this function will not resolve the current gas price.
|
|
83
|
+
* @param options.gasUnits A manually provided gas units - if set, this function will not estimate the gas units.
|
|
84
|
+
* @param options.transport A custom transport object for custom gas price retrieval.
|
|
85
|
+
* @returns Estimated cost in units of gas and the underlying gas token (gasPrice * estimatedGasUnits).
|
|
86
|
+
*/
|
|
87
|
+
QueryBase.prototype.estimateGas = function (unsignedTx, senderAddress, provider, options) {
|
|
88
|
+
if (options === void 0) { options = {}; }
|
|
89
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
+
var _a, _gasPrice, gasUnits, _b, baseFeeMultiplier, transport, chainId, voidSigner, queries, _c, nativeGasCost, gasPrice, tokenGasCost, populatedTransaction, l1GasCost, l2GasCost;
|
|
91
|
+
return __generator(this, function (_d) {
|
|
92
|
+
switch (_d.label) {
|
|
93
|
+
case 0:
|
|
94
|
+
_a = options || {}, _gasPrice = _a.gasPrice, gasUnits = _a.gasUnits, _b = _a.baseFeeMultiplier, baseFeeMultiplier = _b === void 0 ? toBNWei("1") : _b, transport = _a.transport;
|
|
95
|
+
return [4 /*yield*/, provider.getNetwork()];
|
|
96
|
+
case 1:
|
|
97
|
+
chainId = (_d.sent()).chainId;
|
|
98
|
+
voidSigner = new VoidSigner(senderAddress, provider);
|
|
99
|
+
queries = [
|
|
100
|
+
gasUnits ? Promise.resolve(BigNumber.from(gasUnits)) : voidSigner.estimateGas(unsignedTx),
|
|
101
|
+
_gasPrice
|
|
102
|
+
? Promise.resolve({ maxFeePerGas: _gasPrice })
|
|
103
|
+
: getGasPriceEstimate(provider, { chainId: chainId, baseFeeMultiplier: baseFeeMultiplier, transport: transport, unsignedTx: unsignedTx }),
|
|
104
|
+
];
|
|
105
|
+
return [4 /*yield*/, Promise.all(queries)];
|
|
106
|
+
case 2:
|
|
107
|
+
_c = _d.sent(), nativeGasCost = _c[0], gasPrice = _c[1].maxFeePerGas;
|
|
108
|
+
assert(nativeGasCost.gt(bnZero), "Gas cost should not be 0");
|
|
109
|
+
if (!chainIsOPStack(chainId)) return [3 /*break*/, 5];
|
|
110
|
+
assert(isOptimismL2Provider(provider), "Unexpected provider for chain ID ".concat(chainId, "."));
|
|
111
|
+
return [4 /*yield*/, voidSigner.populateTransaction(__assign(__assign({}, unsignedTx), { gasLimit: nativeGasCost }))];
|
|
112
|
+
case 3:
|
|
113
|
+
populatedTransaction = _d.sent();
|
|
114
|
+
return [4 /*yield*/, provider.estimateL1GasCost(populatedTransaction)];
|
|
115
|
+
case 4:
|
|
116
|
+
l1GasCost = _d.sent();
|
|
117
|
+
l2GasCost = nativeGasCost.mul(gasPrice);
|
|
118
|
+
tokenGasCost = l1GasCost.add(l2GasCost);
|
|
119
|
+
return [3 /*break*/, 6];
|
|
120
|
+
case 5:
|
|
121
|
+
tokenGasCost = nativeGasCost.mul(gasPrice);
|
|
122
|
+
_d.label = 6;
|
|
123
|
+
case 6: return [2 /*return*/, {
|
|
124
|
+
nativeGasCost: nativeGasCost,
|
|
125
|
+
tokenGasCost: tokenGasCost,
|
|
126
|
+
gasPrice: tokenGasCost.div(nativeGasCost), // Units: wei/gas
|
|
127
|
+
}];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
};
|
|
79
132
|
/**
|
|
80
133
|
* Retrieves the current price of a token
|
|
81
134
|
* @param tokenSymbol A valid [CoinGecko-ID](https://api.coingecko.com/api/v3/coins/list)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseQuery.js","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/baseQuery.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"baseQuery.js","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/baseQuery.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1F,OAAO,EAAmC,UAAU,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAE/E,OAAO,EAAa,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAGL,eAAe,EACf,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,EACN,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,mB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AmB;QAClC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,UAAG,WAAW,+BAA4B,CAAC,CAAC;QAClG,OAAO,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC;IAClD,CAAC;IACH,gBAAC;AAAD,CAAC,AAtJD,IAsJC"}
|
|
@@ -228,5 +228,5 @@ export declare class QueryBase__factory {
|
|
|
228
228
|
};
|
|
229
229
|
coingeckoId: string;
|
|
230
230
|
};
|
|
231
|
-
}, spokePoolAddress?: string | undefined, simulatedRelayerAddress?: string, coingeckoProApiKey?: string, logger?: Logger,
|
|
231
|
+
}, spokePoolAddress?: string | undefined, simulatedRelayerAddress?: string, coingeckoProApiKey?: string, logger?: Logger, coingeckoBaseCurrency?: string): QueryBase;
|
|
232
232
|
}
|
|
@@ -19,23 +19,22 @@ var fixedGasPrice = (_a = {},
|
|
|
19
19
|
var QueryBase__factory = /** @class */ (function () {
|
|
20
20
|
function QueryBase__factory() {
|
|
21
21
|
}
|
|
22
|
-
QueryBase__factory.create = function (chainId, provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, coingeckoProApiKey, logger,
|
|
22
|
+
QueryBase__factory.create = function (chainId, provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, coingeckoProApiKey, logger, coingeckoBaseCurrency) {
|
|
23
23
|
if (symbolMapping === void 0) { symbolMapping = TOKEN_SYMBOLS_MAP; }
|
|
24
24
|
if (spokePoolAddress === void 0) { spokePoolAddress = getDeployedAddress("SpokePool", chainId); }
|
|
25
25
|
if (simulatedRelayerAddress === void 0) { simulatedRelayerAddress = DEFAULT_SIMULATED_RELAYER_ADDRESS; }
|
|
26
26
|
if (logger === void 0) { logger = DEFAULT_LOGGER; }
|
|
27
|
-
if (gasMarkup === void 0) { gasMarkup = 0; }
|
|
28
27
|
if (coingeckoBaseCurrency === void 0) { coingeckoBaseCurrency = "eth"; }
|
|
29
28
|
assert(isDefined(spokePoolAddress));
|
|
30
29
|
if (chainIsMatic(chainId)) {
|
|
31
|
-
return new PolygonQueries(provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, coingeckoProApiKey,
|
|
30
|
+
return new PolygonQueries(provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, logger, coingeckoProApiKey, fixedGasPrice[chainId], "usd");
|
|
32
31
|
}
|
|
33
32
|
if (chainIsAlephZero(chainId)) {
|
|
34
|
-
return new AlephZeroQueries(provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, coingeckoProApiKey,
|
|
33
|
+
return new AlephZeroQueries(provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, logger, coingeckoProApiKey, fixedGasPrice[chainId], "usd");
|
|
35
34
|
}
|
|
36
35
|
// For OPStack chains, we need to wrap the provider in an L2Provider
|
|
37
36
|
provider = chainIsOPStack(chainId) ? asL2Provider(provider) : provider;
|
|
38
|
-
return new QueryBase(provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress,
|
|
37
|
+
return new QueryBase(provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, logger, coingeckoProApiKey, fixedGasPrice[chainId], coingeckoBaseCurrency);
|
|
39
38
|
};
|
|
40
39
|
return QueryBase__factory;
|
|
41
40
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/factory.ts"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,E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