From fe72fa436c2665840a7a57992aa8c3bcde1af4e3 Mon Sep 17 00:00:00 2001 From: "James Morris, MS" <96435344+james-a-morris@users.noreply.github.com> Date: Wed, 6 Mar 2024 09:46:21 -0700 Subject: [PATCH] feat(queries): add linea queries (#577) Signed-off-by: james-a-morris --- package.json | 4 +-- src/relayFeeCalculator/chain-queries/index.ts | 5 +-- src/relayFeeCalculator/chain-queries/linea.ts | 33 +++++++++++++++++++ yarn.lock | 5 +++ 4 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 src/relayFeeCalculator/chain-queries/linea.ts diff --git a/package.json b/package.json index 51433cbfd..75b9a31d5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@across-protocol/sdk-v2", "author": "UMA Team", - "version": "0.22.7", + "version": "0.22.8", "license": "AGPL-3.0", "homepage": "https://docs.across.to/v/developer-docs/developers/across-sdk", "files": [ @@ -99,7 +99,7 @@ }, "dependencies": { "@across-protocol/across-token": "^1.0.0", - "@across-protocol/constants-v2": "^1.0.11", + "@across-protocol/constants-v2": "^1.0.12", "@across-protocol/contracts-v2": "2.5.0-beta.7", "@eth-optimism/sdk": "^3.1.8", "@pinata/sdk": "^2.1.0", diff --git a/src/relayFeeCalculator/chain-queries/index.ts b/src/relayFeeCalculator/chain-queries/index.ts index 47c357d2f..4e581ae17 100644 --- a/src/relayFeeCalculator/chain-queries/index.ts +++ b/src/relayFeeCalculator/chain-queries/index.ts @@ -1,8 +1,9 @@ export * from "./arbitrum"; +export * from "./base"; +export * from "./baseQuery"; export * from "./boba"; export * from "./ethereum"; +export * from "./linea"; export * from "./optimism"; export * from "./polygon"; export * from "./zksync"; -export * from "./base"; -export * from "./baseQuery"; diff --git a/src/relayFeeCalculator/chain-queries/linea.ts b/src/relayFeeCalculator/chain-queries/linea.ts new file mode 100644 index 000000000..21ff0f189 --- /dev/null +++ b/src/relayFeeCalculator/chain-queries/linea.ts @@ -0,0 +1,33 @@ +import { providers } from "ethers"; +import { CHAIN_IDs, DEFAULT_SIMULATED_RELAYER_ADDRESS, TOKEN_SYMBOLS_MAP } from "../../constants"; +import { getDeployedAddress } from "../../utils/DeploymentUtils"; +import { DEFAULT_LOGGER, Logger } from "../relayFeeCalculator"; +import QueryBase from "./baseQuery"; + +export class LineaQueries extends QueryBase { + constructor( + provider: providers.Provider, + symbolMapping = TOKEN_SYMBOLS_MAP, + spokePoolAddress = getDeployedAddress("SpokePool", CHAIN_IDs.LINEA), + simulatedRelayerAddress = DEFAULT_SIMULATED_RELAYER_ADDRESS, + coingeckoProApiKey?: string, + logger: Logger = DEFAULT_LOGGER, + gasMarkup = 0 + ) { + super(provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, gasMarkup, logger, coingeckoProApiKey); + } +} + +export class LineaGoerliQueries extends QueryBase { + constructor( + provider: providers.Provider, + symbolMapping = TOKEN_SYMBOLS_MAP, + spokePoolAddress = getDeployedAddress("SpokePool", CHAIN_IDs.LINEA_GOERLI), + simulatedRelayerAddress = DEFAULT_SIMULATED_RELAYER_ADDRESS, + coingeckoProApiKey?: string, + logger: Logger = DEFAULT_LOGGER, + gasMarkup = 0 + ) { + super(provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, gasMarkup, logger, coingeckoProApiKey); + } +} diff --git a/yarn.lock b/yarn.lock index cde0c1ff1..545041862 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21,6 +21,11 @@ resolved "https://registry.yarnpkg.com/@across-protocol/constants-v2/-/constants-v2-1.0.11.tgz#58d34b5cb50351d097f2ca43c5a30b5908faed7c" integrity sha512-RpseYB2QxGyfyrfXtUeFxUSCUW1zqu442QFzsdD1LBZtymuzdHuL2MwtTdmRRnJSvzRTFTtlRh4bYDoExSb5zQ== +"@across-protocol/constants-v2@^1.0.12": + version "1.0.12" + resolved "https://registry.yarnpkg.com/@across-protocol/constants-v2/-/constants-v2-1.0.12.tgz#a85e8d39efa9c5294a368e229eab65357f00645e" + integrity sha512-UrrPOxV/+FjCHmlMnezviAMXDiGDzUNCwKC2ifQ0U8PGa+lNulb7KCGNIEIFAFLHNn+/CMFST5Vwf+aAqbumvQ== + "@across-protocol/contracts-v2@2.5.0-beta.7": version "2.5.0-beta.7" resolved "https://registry.yarnpkg.com/@across-protocol/contracts-v2/-/contracts-v2-2.5.0-beta.7.tgz#9410efc9e39b8b1b6e814dcd416e6017f7d40abd"