diff --git a/configs/envvars/src/genEnvVars.ts b/configs/envvars/src/genEnvVars.ts index 18db80eb..4b8ea752 100644 --- a/configs/envvars/src/genEnvVars.ts +++ b/configs/envvars/src/genEnvVars.ts @@ -189,6 +189,8 @@ const EXPLORER_API_DEFAULTS: Record = { // Story 1514: "https://www.storyscan.xyz/api/v2/", 1315: "https://aeneid.storyscan.xyz/api/v2", + // Citrea + 5115: "https://explorer.testnet.citrea.xyz", }; /** API Keys are per-domain */ @@ -227,6 +229,8 @@ const EXPLORER_API_KEY_DEFAULTS: Record = { // TODO: support blockscout // 1514: " ", // 1315: " ", + // Citrea + // 5115 }; /** @@ -248,7 +252,7 @@ export function getEnvVarsForNetworkId(networkId: string): EnvVarDef[] { //const chainIds = allChains.map((c) => c.chainId); const chainIds = [ 1, 5, 1337, 11155111, 17000, 11155420, 59144, 59140, 137, 80001, 80002, 42161, 421614, 42170, 10, 43114, 43113, 56, - 97, 168587773, 8453, 84532, 3441006, 204, 5611, 33139, 33111, 1329, 713715, 1868, 80094, 1514, 1315, 9001, + 97, 168587773, 8453, 84532, 3441006, 204, 5611, 33139, 33111, 1329, 713715, 1868, 80094, 1514, 1315, 9001, 5115, ]; //TODO: For all networkIds, right now this breaks because file is too big. Is there a better way? const NETWORK_ENVVARS: EnvVarDef[] = []; diff --git a/packages/chains/src/chains/citreaTestnet.ts b/packages/chains/src/chains/citreaTestnet.ts new file mode 100644 index 00000000..2c6466ec --- /dev/null +++ b/packages/chains/src/chains/citreaTestnet.ts @@ -0,0 +1,31 @@ +import { defineChain } from "viem/utils"; +import { defineNetwork } from "../defineChain.js"; + +const citreaTestnetViem = /*#__PURE__*/ defineChain({ + id: 5115, + name: "Citrea Testnet", + nativeCurrency: { name: "cBTC", symbol: "cBTC", decimals: 18 }, + rpcUrls: { + default: { + http: ["https://rpc.testnet.citrea.xyz"], + }, + }, + blockExplorers: { + default: { + name: "Citrea Explorer", + url: "https://explorer.testnet.citrea.xyz", + apiUrl: "https://explorer.testnet.citrea.xyz/api", + }, + }, + testnet: true, +}); + +export const citreaTestnet = /*#__PURE__*/ defineNetwork({ + ...citreaTestnetViem, + rpcUrls: { + ...citreaTestnetViem.rpcUrls, + public: citreaTestnetViem.rpcUrls.default, + }, + slug: "citreaTestnet", + enabled: true, +}); diff --git a/packages/chains/src/chains/index.ts b/packages/chains/src/chains/index.ts index 9a0af296..80d0c541 100644 --- a/packages/chains/src/chains/index.ts +++ b/packages/chains/src/chains/index.ts @@ -16,6 +16,7 @@ export * from "./blast.js"; export * from "./blastSepolia.js"; export * from "./bsc.js"; export * from "./bscTestnet.js"; +export * from "./citreaTestnet.js"; export * from "./coreDao.js"; export * from "./curtis.js"; export * from "./evmos.js"; diff --git a/packages/contracts-account-abstraction/src/actions/bundler/estimateUserOperationGas.ts b/packages/contracts-account-abstraction/src/actions/bundler/estimateUserOperationGas.ts index 37105648..0d611c9c 100644 --- a/packages/contracts-account-abstraction/src/actions/bundler/estimateUserOperationGas.ts +++ b/packages/contracts-account-abstraction/src/actions/bundler/estimateUserOperationGas.ts @@ -25,6 +25,7 @@ import { sei, celo, } from "viem/chains"; +import { citreaTestnet } from "@owlprotocol/chains"; import { getExecutionResult } from "./simulateHandleOp.js"; import { calcPreVerificationGas } from "./calcPreVerificationGas.js"; import { getSupportedEntryPoints } from "./getSupportedEntryPoints.js"; @@ -172,7 +173,8 @@ export async function estimateUserOperationGas( chainId === celo.id || chainId === sei.id || chainId === seiDevnet.id || - chainId === seiTestnet.id + chainId === seiTestnet.id || + chainId === citreaTestnet.chainId ) { verificationGasLimit = 1_000_000n; callGasLimit = 1_000_000n;