@across-protocol/sdk 3.3.31 → 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/BundleDataClient.js +8 -2
- package/dist/cjs/clients/BundleDataClient/BundleDataClient.js.map +1 -1
- 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/DepositUtils.d.ts +1 -0
- package/dist/cjs/utils/DepositUtils.js +5 -1
- package/dist/cjs/utils/DepositUtils.js.map +1 -1
- package/dist/cjs/utils/Multicall.js +0 -5
- package/dist/cjs/utils/Multicall.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/BundleDataClient.js +16 -3
- package/dist/esm/clients/BundleDataClient/BundleDataClient.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/DepositUtils.d.ts +9 -0
- package/dist/esm/utils/DepositUtils.js +11 -0
- package/dist/esm/utils/DepositUtils.js.map +1 -1
- package/dist/esm/utils/Multicall.js +1 -6
- package/dist/esm/utils/Multicall.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/BundleDataClient.d.ts.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/DepositUtils.d.ts +9 -0
- package/dist/types/utils/DepositUtils.d.ts.map +1 -1
- package/dist/types/utils/Multicall.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/clients/BundleDataClient/BundleDataClient.ts +17 -2
- 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/DepositUtils.ts +12 -0
- package/src/utils/Multicall.ts +1 -6
- 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,8 +1,6 @@
|
|
|
1
|
-
import { L2Provider } from "@eth-optimism/sdk/dist/interfaces/l2-provider";
|
|
2
1
|
import Decimal from "decimal.js";
|
|
3
|
-
import { ethers
|
|
2
|
+
import { ethers } from "ethers";
|
|
4
3
|
import { BigNumber, BigNumberish, BN } from "./BigNumberUtils";
|
|
5
|
-
import { Transport } from "viem";
|
|
6
4
|
export type Decimalish = string | number | Decimal;
|
|
7
5
|
export declare const AddressZero = "0x0000000000000000000000000000000000000000";
|
|
8
6
|
export declare const MAX_BIG_INT: ethers.BigNumber;
|
|
@@ -131,20 +129,4 @@ export type TransactionCostEstimate = {
|
|
|
131
129
|
tokenGasCost: BigNumber;
|
|
132
130
|
gasPrice: BigNumber;
|
|
133
131
|
};
|
|
134
|
-
/**
|
|
135
|
-
* Estimates the total gas cost required to submit an unsigned (populated) transaction on-chain.
|
|
136
|
-
* @param unsignedTx The unsigned transaction that this function will estimate.
|
|
137
|
-
* @param senderAddress The address that the transaction will be submitted from.
|
|
138
|
-
* @param provider A valid ethers provider - will be used to reason the gas price.
|
|
139
|
-
* @param options
|
|
140
|
-
* @param options.gasPrice A manually provided gas price - if set, this function will not resolve the current gas price.
|
|
141
|
-
* @param options.gasUnits A manually provided gas units - if set, this function will not estimate the gas units.
|
|
142
|
-
* @param options.transport A custom transport object for custom gas price retrieval.
|
|
143
|
-
* @returns Estimated cost in units of gas and the underlying gas token (gasPrice * estimatedGasUnits).
|
|
144
|
-
*/
|
|
145
|
-
export declare function estimateTotalGasRequiredByUnsignedTransaction(unsignedTx: PopulatedTransaction, senderAddress: string, provider: providers.Provider | L2Provider<providers.Provider>, options?: Partial<{
|
|
146
|
-
gasPrice: BigNumberish;
|
|
147
|
-
gasUnits: BigNumberish;
|
|
148
|
-
transport: Transport;
|
|
149
|
-
}>): Promise<TransactionCostEstimate>;
|
|
150
132
|
export declare function randomAddress(): string;
|
package/dist/esm/utils/common.js
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isL2Provider as isOptimismL2Provider } from "@eth-optimism/sdk/dist/l2-provider";
|
|
3
|
-
import assert from "assert";
|
|
1
|
+
import { __awaiter, __generator } from "tslib";
|
|
4
2
|
import Decimal from "decimal.js";
|
|
5
|
-
import { ethers
|
|
6
|
-
import {
|
|
7
|
-
import { BigNumber, bnZero, formatUnits, parseUnits, toBN } from "./BigNumberUtils";
|
|
3
|
+
import { ethers } from "ethers";
|
|
4
|
+
import { BigNumber, formatUnits, parseUnits, toBN } from "./BigNumberUtils";
|
|
8
5
|
import { ConvertDecimals } from "./FormattingUtils";
|
|
9
|
-
import { chainIsOPStack } from "./NetworkUtils";
|
|
10
|
-
import { CHAIN_IDs } from "@across-protocol/constants";
|
|
11
|
-
import { estimateGas } from "viem/linea";
|
|
12
|
-
import { getPublicClient } from "../gasPriceOracle/util";
|
|
13
6
|
export var AddressZero = ethers.constants.AddressZero;
|
|
14
7
|
export var MAX_BIG_INT = BigNumber.from(Number.MAX_SAFE_INTEGER.toString());
|
|
15
8
|
/**
|
|
@@ -201,91 +194,6 @@ export function retry(call, times, delayS) {
|
|
|
201
194
|
}); });
|
|
202
195
|
return promiseChain;
|
|
203
196
|
}
|
|
204
|
-
/**
|
|
205
|
-
* Estimates the total gas cost required to submit an unsigned (populated) transaction on-chain.
|
|
206
|
-
* @param unsignedTx The unsigned transaction that this function will estimate.
|
|
207
|
-
* @param senderAddress The address that the transaction will be submitted from.
|
|
208
|
-
* @param provider A valid ethers provider - will be used to reason the gas price.
|
|
209
|
-
* @param options
|
|
210
|
-
* @param options.gasPrice A manually provided gas price - if set, this function will not resolve the current gas price.
|
|
211
|
-
* @param options.gasUnits A manually provided gas units - if set, this function will not estimate the gas units.
|
|
212
|
-
* @param options.transport A custom transport object for custom gas price retrieval.
|
|
213
|
-
* @returns Estimated cost in units of gas and the underlying gas token (gasPrice * estimatedGasUnits).
|
|
214
|
-
*/
|
|
215
|
-
export function estimateTotalGasRequiredByUnsignedTransaction(unsignedTx, senderAddress, provider, options) {
|
|
216
|
-
if (options === void 0) { options = {}; }
|
|
217
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
218
|
-
var _a, _gasPrice, gasUnits, transport, chainId, voidSigner, queries, _b, nativeGasCost, gasPrice, tokenGasCost, populatedTransaction, l1GasCost, l2GasCost, baseFeePerGas, priorityFeePerGas;
|
|
219
|
-
var _c;
|
|
220
|
-
return __generator(this, function (_d) {
|
|
221
|
-
switch (_d.label) {
|
|
222
|
-
case 0:
|
|
223
|
-
_a = options || {}, _gasPrice = _a.gasPrice, gasUnits = _a.gasUnits, transport = _a.transport;
|
|
224
|
-
return [4 /*yield*/, provider.getNetwork()];
|
|
225
|
-
case 1:
|
|
226
|
-
chainId = (_d.sent()).chainId;
|
|
227
|
-
voidSigner = new VoidSigner(senderAddress, provider);
|
|
228
|
-
queries = [
|
|
229
|
-
gasUnits ? Promise.resolve(BigNumber.from(gasUnits)) : voidSigner.estimateGas(unsignedTx),
|
|
230
|
-
_gasPrice ? Promise.resolve({ maxFeePerGas: _gasPrice }) : getGasPriceEstimate(provider, chainId, transport),
|
|
231
|
-
];
|
|
232
|
-
return [4 /*yield*/, Promise.all(queries)];
|
|
233
|
-
case 2:
|
|
234
|
-
_b = _d.sent(), nativeGasCost = _b[0], gasPrice = _b[1].maxFeePerGas;
|
|
235
|
-
assert(nativeGasCost.gt(bnZero), "Gas cost should not be 0");
|
|
236
|
-
if (!chainIsOPStack(chainId)) return [3 /*break*/, 5];
|
|
237
|
-
assert(isOptimismL2Provider(provider), "Unexpected provider for chain ID ".concat(chainId, "."));
|
|
238
|
-
return [4 /*yield*/, voidSigner.populateTransaction(__assign(__assign({}, unsignedTx), { gasLimit: nativeGasCost }))];
|
|
239
|
-
case 3:
|
|
240
|
-
populatedTransaction = _d.sent();
|
|
241
|
-
return [4 /*yield*/, provider.estimateL1GasCost(populatedTransaction)];
|
|
242
|
-
case 4:
|
|
243
|
-
l1GasCost = _d.sent();
|
|
244
|
-
l2GasCost = nativeGasCost.mul(gasPrice);
|
|
245
|
-
tokenGasCost = l1GasCost.add(l2GasCost);
|
|
246
|
-
return [3 /*break*/, 8];
|
|
247
|
-
case 5:
|
|
248
|
-
if (!(chainId === CHAIN_IDs.LINEA && process.env["NEW_GAS_PRICE_ORACLE_".concat(chainId)] === "true")) return [3 /*break*/, 7];
|
|
249
|
-
baseFeePerGas = void 0, priorityFeePerGas = void 0;
|
|
250
|
-
return [4 /*yield*/, getLineaGasFees(chainId, transport, unsignedTx)];
|
|
251
|
-
case 6:
|
|
252
|
-
(_c = _d.sent(), nativeGasCost = _c.gasLimit, baseFeePerGas = _c.baseFeePerGas, priorityFeePerGas = _c.priorityFeePerGas);
|
|
253
|
-
gasPrice = baseFeePerGas.add(priorityFeePerGas);
|
|
254
|
-
_d.label = 7;
|
|
255
|
-
case 7:
|
|
256
|
-
tokenGasCost = nativeGasCost.mul(gasPrice);
|
|
257
|
-
_d.label = 8;
|
|
258
|
-
case 8: return [2 /*return*/, {
|
|
259
|
-
nativeGasCost: nativeGasCost,
|
|
260
|
-
tokenGasCost: tokenGasCost,
|
|
261
|
-
gasPrice: tokenGasCost.div(nativeGasCost), // Units: wei/gas
|
|
262
|
-
}];
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
function getLineaGasFees(chainId, transport, unsignedTx) {
|
|
268
|
-
var _a;
|
|
269
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
270
|
-
var _b, gasLimit, baseFeePerGas, priorityFeePerGas;
|
|
271
|
-
return __generator(this, function (_c) {
|
|
272
|
-
switch (_c.label) {
|
|
273
|
-
case 0: return [4 /*yield*/, estimateGas(getPublicClient(chainId, transport), {
|
|
274
|
-
account: unsignedTx.from,
|
|
275
|
-
to: unsignedTx.to,
|
|
276
|
-
value: BigInt(((_a = unsignedTx.value) === null || _a === void 0 ? void 0 : _a.toString()) || "1"),
|
|
277
|
-
})];
|
|
278
|
-
case 1:
|
|
279
|
-
_b = _c.sent(), gasLimit = _b.gasLimit, baseFeePerGas = _b.baseFeePerGas, priorityFeePerGas = _b.priorityFeePerGas;
|
|
280
|
-
return [2 /*return*/, {
|
|
281
|
-
gasLimit: BigNumber.from(gasLimit.toString()),
|
|
282
|
-
baseFeePerGas: BigNumber.from(baseFeePerGas.toString()),
|
|
283
|
-
priorityFeePerGas: BigNumber.from(priorityFeePerGas.toString()),
|
|
284
|
-
}];
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
197
|
export function randomAddress() {
|
|
290
198
|
return ethers.utils.getAddress(ethers.utils.hexlify(ethers.utils.randomBytes(20)));
|
|
291
199
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/utils/common.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/utils/common.ts"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAoB,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,MAAM,CAAC,IAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC;AACxD,MAAM,CAAC,IAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,OAAO,GAAG,UAAC,GAAiB,EAAE,QAAiB,IAAS,OAAA,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,EAApC,CAAoC,CAAC;AAE1G;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,OAAO,GAAG,UAAC,GAAiB,EAAE,QAAiB,IAAa,OAAA,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,EAArC,CAAqC,CAAC;AAE/G;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,CAAC,CAAe,EAAE,CAAe;IAClD,IAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,IAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AAClC,CAAC;AACD;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,CAAC,CAAe,EAAE,CAAe;IAClD,IAAM,GAAG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;4BAChC,qBAAM,KAAK,CAAC,MAAM,CAAC,EAAA;;wBAAnB,SAAmB,CAAC;wBACb,qBAAM,IAAI,EAAE,EAAA;4BAAnB,sBAAO,SAAY,EAAC;;;aACrB,CAAC,CAAC;IACL,OAAO,YAAY,CAAC;AACtB,CAAC;AAQD,MAAM,UAAU,aAAa;IAC3B,OAAO,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleDataClient.d.ts","sourceRoot":"","sources":["../../../../src/clients/BundleDataClient/BundleDataClient.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAElB,uBAAuB,EAGvB,mBAAmB,EAOnB,OAAO,EACP,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAA2B,eAAe,EAAE,MAAM,IAAI,CAAC;AAC9D,OAAO,EACL,SAAS,
|
|
1
|
+
{"version":3,"file":"BundleDataClient.d.ts","sourceRoot":"","sources":["../../../../src/clients/BundleDataClient/BundleDataClient.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAElB,uBAAuB,EAGvB,mBAAmB,EAOnB,OAAO,EACP,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAA2B,eAAe,EAAE,MAAM,IAAI,CAAC;AAC9D,OAAO,EACL,SAAS,EAeV,MAAM,aAAa,CAAC;AACrB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAQL,iBAAiB,EAIlB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,sBAAsB,WAAc,CAAC;AAqFlD,qBAAa,gBAAgB;IAQzB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO;IACzB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|
|
5
5
|
transactionIndex: number;
|
|
6
|
-
transactionHash: string;
|
|
7
6
|
logIndex: number;
|
|
7
|
+
transactionHash: string;
|
|
8
8
|
message: string;
|
|
9
9
|
originChainId: number;
|
|
10
10
|
inputToken: string;
|
|
@@ -32,8 +32,8 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
32
32
|
fills: {
|
|
33
33
|
blockNumber: number;
|
|
34
34
|
transactionIndex: number;
|
|
35
|
-
transactionHash: string;
|
|
36
35
|
logIndex: number;
|
|
36
|
+
transactionHash: string;
|
|
37
37
|
message: string;
|
|
38
38
|
originChainId: number;
|
|
39
39
|
inputToken: string;
|
|
@@ -65,8 +65,8 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
65
65
|
bundleSlowFillsV3: Record<string, Record<string, {
|
|
66
66
|
blockNumber: number;
|
|
67
67
|
transactionIndex: number;
|
|
68
|
-
transactionHash: string;
|
|
69
68
|
logIndex: number;
|
|
69
|
+
transactionHash: string;
|
|
70
70
|
message: string;
|
|
71
71
|
originChainId: number;
|
|
72
72
|
inputToken: string;
|
|
@@ -94,8 +94,8 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
94
94
|
expiredDepositsToRefundV3: Record<string, Record<string, {
|
|
95
95
|
blockNumber: number;
|
|
96
96
|
transactionIndex: number;
|
|
97
|
-
transactionHash: string;
|
|
98
97
|
logIndex: number;
|
|
98
|
+
transactionHash: string;
|
|
99
99
|
message: string;
|
|
100
100
|
originChainId: number;
|
|
101
101
|
inputToken: string;
|
|
@@ -122,8 +122,8 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
122
122
|
unexecutableSlowFills: Record<string, Record<string, {
|
|
123
123
|
blockNumber: number;
|
|
124
124
|
transactionIndex: number;
|
|
125
|
-
transactionHash: string;
|
|
126
125
|
logIndex: number;
|
|
126
|
+
transactionHash: string;
|
|
127
127
|
message: string;
|
|
128
128
|
originChainId: number;
|
|
129
129
|
inputToken: string;
|
|
@@ -152,8 +152,8 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
152
152
|
bundleDepositsV3: import("superstruct").Struct<Record<string, Record<string, {
|
|
153
153
|
blockNumber: number;
|
|
154
154
|
transactionIndex: number;
|
|
155
|
-
transactionHash: string;
|
|
156
155
|
logIndex: number;
|
|
156
|
+
transactionHash: string;
|
|
157
157
|
message: string;
|
|
158
158
|
originChainId: number;
|
|
159
159
|
inputToken: string;
|
|
@@ -180,8 +180,8 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
180
180
|
expiredDepositsToRefundV3: import("superstruct").Struct<Record<string, Record<string, {
|
|
181
181
|
blockNumber: number;
|
|
182
182
|
transactionIndex: number;
|
|
183
|
-
transactionHash: string;
|
|
184
183
|
logIndex: number;
|
|
184
|
+
transactionHash: string;
|
|
185
185
|
message: string;
|
|
186
186
|
originChainId: number;
|
|
187
187
|
inputToken: string;
|
|
@@ -208,8 +208,8 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
208
208
|
unexecutableSlowFills: import("superstruct").Struct<Record<string, Record<string, {
|
|
209
209
|
blockNumber: number;
|
|
210
210
|
transactionIndex: number;
|
|
211
|
-
transactionHash: string;
|
|
212
211
|
logIndex: number;
|
|
212
|
+
transactionHash: string;
|
|
213
213
|
message: string;
|
|
214
214
|
originChainId: number;
|
|
215
215
|
inputToken: string;
|
|
@@ -237,8 +237,8 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
237
237
|
bundleSlowFillsV3: import("superstruct").Struct<Record<string, Record<string, {
|
|
238
238
|
blockNumber: number;
|
|
239
239
|
transactionIndex: number;
|
|
240
|
-
transactionHash: string;
|
|
241
240
|
logIndex: number;
|
|
241
|
+
transactionHash: string;
|
|
242
242
|
message: string;
|
|
243
243
|
originChainId: number;
|
|
244
244
|
inputToken: string;
|
|
@@ -267,8 +267,8 @@ export declare const BundleDataSS: import("superstruct").Struct<{
|
|
|
267
267
|
fills: {
|
|
268
268
|
blockNumber: number;
|
|
269
269
|
transactionIndex: number;
|
|
270
|
-
transactionHash: string;
|
|
271
270
|
logIndex: number;
|
|
271
|
+
transactionHash: string;
|
|
272
272
|
message: string;
|
|
273
273
|
originChainId: number;
|
|
274
274
|
inputToken: string;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { providers } from "ethers";
|
|
2
2
|
import { GasPriceEstimate } from "../types";
|
|
3
|
-
|
|
3
|
+
import { GasPriceEstimateOptions } from "../oracle";
|
|
4
|
+
/**
|
|
5
|
+
* @notice Return Arbitrum orbit gas fees
|
|
6
|
+
* @dev Arbitrum Nitro implements EIP-1559 pricing, but the priority fee is always refunded to the caller.
|
|
7
|
+
* Reference: https://docs.arbitrum.io/how-arbitrum-works/gas-fees so we hardcode the priority fee
|
|
8
|
+
* to 1 wei.
|
|
9
|
+
* @param provider Ethers Provider
|
|
10
|
+
* @returns GasPriceEstimate
|
|
11
|
+
*/
|
|
12
|
+
export declare function eip1559(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate>;
|
|
4
13
|
//# sourceMappingURL=arbitrum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arbitrum.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/arbitrum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"arbitrum.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/arbitrum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD;;;;;;;GAOG;AACH,wBAAsB,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAQpH"}
|
|
@@ -1,24 +1,37 @@
|
|
|
1
1
|
import { providers } from "ethers";
|
|
2
|
+
import { BigNumber } from "../../utils";
|
|
2
3
|
import { GasPriceEstimate } from "../types";
|
|
4
|
+
import { GasPriceEstimateOptions } from "../oracle";
|
|
3
5
|
/**
|
|
6
|
+
* @dev If GAS_PRICE_EIP1559_RAW_${chainId}=true, then constructs total fee by adding
|
|
7
|
+
* eth_getBlock("pending").baseFee to eth_maxPriorityFeePerGas, otherwise calls the ethers provider's
|
|
8
|
+
* getFeeData() method which adds eth_getBlock("latest").baseFee to a hardcoded priority fee of 1.5 gwei.
|
|
4
9
|
* @param provider ethers RPC provider instance.
|
|
5
|
-
* @param chainId Chain ID of provider instance.
|
|
6
10
|
* @returns Promise of gas price estimate object.
|
|
7
11
|
*/
|
|
8
|
-
export declare function eip1559(provider: providers.Provider,
|
|
12
|
+
export declare function eip1559(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate>;
|
|
9
13
|
/**
|
|
10
14
|
* @note Performs direct RPC calls to retrieve the RPC-suggested priority fee for the next block.
|
|
15
|
+
* @dev Constructs total fee by adding eth_getBlock("pending").baseFee to eth_maxPriorityFeePerGas
|
|
11
16
|
* @param provider ethers RPC provider instance.
|
|
12
17
|
* @param chainId Chain ID of the provider instance.
|
|
13
18
|
* @returns Promise of gas price estimate object.
|
|
14
19
|
*/
|
|
15
|
-
export declare function eip1559Raw(provider: providers.Provider, chainId: number): Promise<GasPriceEstimate>;
|
|
20
|
+
export declare function eip1559Raw(provider: providers.Provider, chainId: number, baseFeeMultiplier: BigNumber): Promise<GasPriceEstimate>;
|
|
16
21
|
/**
|
|
17
|
-
* @
|
|
22
|
+
* @notice Returns fee data using provider's getFeeData() method.
|
|
23
|
+
* @note Resolves priority gas pricing poorly, because the priority fee is hardcoded to 1.5 Gwei in ethers v5's
|
|
24
|
+
* getFeeData() method
|
|
25
|
+
* @dev TODO: Remove this function soon. See note above about slowly rolling out eip1559Raw.
|
|
18
26
|
* @param provider ethers RPC provider instance.
|
|
19
27
|
* @param chainId Chain ID of the provider instance.
|
|
20
28
|
* @returns Promise of gas price estimate object.
|
|
21
29
|
*/
|
|
22
|
-
export declare function eip1559Bad(provider: providers.Provider, chainId: number): Promise<GasPriceEstimate>;
|
|
23
|
-
|
|
30
|
+
export declare function eip1559Bad(provider: providers.Provider, chainId: number, baseFeeMultiplier: BigNumber): Promise<GasPriceEstimate>;
|
|
31
|
+
/**
|
|
32
|
+
* @notice Returns result of eth_gasPrice RPC call
|
|
33
|
+
* @dev Its recommended to use the eip1559Raw method over this one where possible as it will be more accurate.
|
|
34
|
+
* @returns GasPriceEstimate
|
|
35
|
+
*/
|
|
36
|
+
export declare function legacy(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate>;
|
|
24
37
|
//# sourceMappingURL=ethereum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ethereum.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/ethereum.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"ethereum.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/ethereum.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,SAAS,EAAgD,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAMpD;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAK9G;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAC5B,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,SAAS,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAa3B;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAC5B,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,SAAS,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAc3B;AAED;;;;GAIG;AACH,wBAAsB,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAUnH"}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { PublicClient } from "viem";
|
|
2
2
|
import { InternalGasPriceEstimate } from "../types";
|
|
3
|
-
|
|
3
|
+
import { GasPriceEstimateOptions } from "../oracle";
|
|
4
|
+
/**
|
|
5
|
+
* @notice The Linea viem provider calls the linea_estimateGas RPC endpoint to estimate gas. Linea is unique
|
|
6
|
+
* in that the recommended fee per gas is hardcoded to 7 wei while the priority fee is dynamic based on the
|
|
7
|
+
* compressed transaction size, layer 1 verification costs and capacity, gas price ratio between layer 1 and layer 2,
|
|
8
|
+
* the transaction's gas usage, the minimum gas price on layer 2,
|
|
9
|
+
* and a minimum margin (for error) for gas price estimation.
|
|
10
|
+
* Source: https://docs.linea.build/get-started/how-to/gas-fees#how-gas-works-on-linea
|
|
11
|
+
* @dev Because the Linea priority fee is more volatile than the base fee, the base fee multiplier will be applied
|
|
12
|
+
* to the priority fee.
|
|
13
|
+
* @param provider Viem PublicClient
|
|
14
|
+
* @param _chainId Unused in this adapter
|
|
15
|
+
* @param baseFeeMultiplier Amount to multiply priority fee, since Linea's base fee is hardcoded while its priority
|
|
16
|
+
* fee is dynamic
|
|
17
|
+
* @param _unsignedTx Should contain any params passed to linea_estimateGas, which are listed
|
|
18
|
+
* here: https://docs.linea.build/api/reference/linea-estimategas#parameters
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare function eip1559(provider: PublicClient, opts: GasPriceEstimateOptions): Promise<InternalGasPriceEstimate>;
|
|
4
22
|
//# sourceMappingURL=linea-viem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linea-viem.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/linea-viem.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"linea-viem.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/linea-viem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAE,MAAM,MAAM,CAAC;AAGlD,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAGpD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,OAAO,CAC3B,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,wBAAwB,CAAC,CAenC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { providers } from "ethers";
|
|
2
2
|
import { GasPriceEstimate } from "../types";
|
|
3
|
-
|
|
3
|
+
import { GasPriceEstimateOptions } from "../oracle";
|
|
4
|
+
export declare function eip1559(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate>;
|
|
4
5
|
//# sourceMappingURL=linea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linea.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/linea.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"linea.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/linea.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAM9G"}
|
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
import { providers } from "ethers";
|
|
2
|
+
import { BaseHTTPAdapter, BaseHTTPAdapterArgs } from "../../priceClient/adapters/baseAdapter";
|
|
3
|
+
import { BigNumber } from "../../utils";
|
|
2
4
|
import { GasPriceEstimate } from "../types";
|
|
3
|
-
|
|
5
|
+
import { GasPriceEstimateOptions } from "../oracle";
|
|
6
|
+
type Polygon1559GasPrice = {
|
|
7
|
+
maxPriorityFee: number | string;
|
|
8
|
+
maxFee: number | string;
|
|
9
|
+
};
|
|
10
|
+
type GasStationArgs = BaseHTTPAdapterArgs & {
|
|
11
|
+
chainId?: number;
|
|
12
|
+
host?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare class PolygonGasStation extends BaseHTTPAdapter {
|
|
15
|
+
readonly chainId: number;
|
|
16
|
+
constructor({ chainId, host, timeout, retries }?: GasStationArgs);
|
|
17
|
+
getFeeData(strategy?: "safeLow" | "standard" | "fast"): Promise<GasPriceEstimate>;
|
|
18
|
+
protected isPolygon1559GasPrice(gasPrice: unknown): gasPrice is Polygon1559GasPrice;
|
|
19
|
+
}
|
|
20
|
+
export declare const MockPolygonGasStationBaseFee: () => BigNumber;
|
|
21
|
+
export declare const MockPolygonGasStationPriorityFee: () => BigNumber;
|
|
22
|
+
/**
|
|
23
|
+
* @notice Returns the gas price suggested by the Polygon GasStation API or reconstructs it using
|
|
24
|
+
* the eip1559() method as a fallback.
|
|
25
|
+
* @param provider Ethers Provider.
|
|
26
|
+
* @returns GasPriceEstimate
|
|
27
|
+
*/
|
|
28
|
+
export declare function gasStation(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate>;
|
|
29
|
+
export {};
|
|
4
30
|
//# sourceMappingURL=polygon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/polygon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../../../src/gasPriceOracle/adapters/polygon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,SAAS,EAAuD,MAAM,aAAa,CAAC;AAE7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,KAAK,mBAAmB,GAAG;IACzB,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAWF,KAAK,cAAc,GAAG,mBAAmB,GAAG;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAIF,qBAAa,iBAAkB,SAAQ,eAAe;IACpD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,EAAE,OAAiB,EAAE,IAAI,EAAE,OAAc,EAAE,OAAW,EAAE,GAAE,cAAmB;IAOnF,UAAU,CAAC,QAAQ,GAAE,SAAS,GAAG,UAAU,GAAG,MAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAqB/F,SAAS,CAAC,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,mBAAmB;CAOpF;AAQD,eAAO,MAAM,4BAA4B,iBAA4B,CAAC;AACtE,eAAO,MAAM,gCAAgC,iBAA2B,CAAC;AAWzE;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAC5B,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAkC3B"}
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import { Transport } from "viem";
|
|
2
|
-
import { providers } from "ethers";
|
|
2
|
+
import { PopulatedTransaction, providers } from "ethers";
|
|
3
|
+
import { BigNumber } from "../utils";
|
|
3
4
|
import { GasPriceEstimate } from "./types";
|
|
5
|
+
export interface GasPriceEstimateOptions {
|
|
6
|
+
baseFeeMultiplier: BigNumber;
|
|
7
|
+
legacyFallback: boolean;
|
|
8
|
+
chainId: number;
|
|
9
|
+
unsignedTx?: PopulatedTransaction;
|
|
10
|
+
transport?: Transport;
|
|
11
|
+
}
|
|
4
12
|
/**
|
|
5
13
|
* Provide an estimate for the current gas price for a particular chain.
|
|
6
|
-
* @param chainId The chain ID to query for gas prices.
|
|
7
14
|
* @param provider A valid ethers provider.
|
|
8
|
-
* @param
|
|
9
|
-
* @returns
|
|
15
|
+
* @param {opts} GasPriceEstimateOptions optional parameters.
|
|
16
|
+
* @returns An object of type GasPriceEstimate.
|
|
10
17
|
*/
|
|
11
|
-
export declare function getGasPriceEstimate(provider: providers.Provider,
|
|
18
|
+
export declare function getGasPriceEstimate(provider: providers.Provider, opts?: Partial<GasPriceEstimateOptions>): Promise<GasPriceEstimate>;
|
|
12
19
|
/**
|
|
13
20
|
* Provide an estimate for the current gas price for a particular chain.
|
|
14
21
|
* @param providerOrChainId A valid ethers provider or a chain ID.
|
|
15
|
-
* @param transport An optional
|
|
16
|
-
* @
|
|
22
|
+
* @param transport An optional Viem Transport object for custom gas price retrieval.
|
|
23
|
+
* @param unsignedTx Only used in Linea provider to estimate priority gas fee.
|
|
24
|
+
* @returns An object of type GasPriceEstimate.
|
|
17
25
|
*/
|
|
18
|
-
export declare function
|
|
26
|
+
export declare function _getViemGasPriceEstimate(providerOrChainId: providers.Provider | number, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate>;
|
|
19
27
|
//# sourceMappingURL=oracle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oracle.d.ts","sourceRoot":"","sources":["../../../src/gasPriceOracle/oracle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"oracle.d.ts","sourceRoot":"","sources":["../../../src/gasPriceOracle/oracle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAiD,MAAM,UAAU,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAQ3C,MAAM,WAAW,uBAAuB;IAEtC,iBAAiB,EAAE,SAAS,CAAC;IAE7B,cAAc,EAAE,OAAO,CAAC;IAExB,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAElC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAMD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAC5B,IAAI,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAC1C,OAAO,CAAC,gBAAgB,CAAC,CAmB3B;AAgCD;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC5C,iBAAiB,EAAE,SAAS,CAAC,QAAQ,GAAG,MAAM,EAC9C,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CA2B3B"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export type RPCProvider = "ALCHEMY" | "DRPC" | "INFURA" | "INFURA_DIN";
|
|
2
2
|
export type RPCTransport = "https" | "wss";
|
|
3
3
|
export declare const JsonRpcError: import("superstruct").Struct<{
|
|
4
|
-
id: string | number;
|
|
5
4
|
error: {
|
|
6
|
-
code: number;
|
|
7
5
|
message: string;
|
|
6
|
+
code: number;
|
|
8
7
|
data?: any;
|
|
9
8
|
};
|
|
9
|
+
id: string | number;
|
|
10
10
|
jsonrpc: "2.0";
|
|
11
11
|
}, {
|
|
12
12
|
jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
|
|
13
13
|
id: import("superstruct").Struct<string | number, null>;
|
|
14
14
|
error: import("superstruct").Struct<{
|
|
15
|
-
code: number;
|
|
16
15
|
message: string;
|
|
16
|
+
code: number;
|
|
17
17
|
data?: any;
|
|
18
18
|
}, {
|
|
19
19
|
code: import("superstruct").Struct<number, null>;
|