From da427febd88f596327e12ad5f39ccbf15e82b075 Mon Sep 17 00:00:00 2001 From: Alec Ananian <1013230+alecananian@users.noreply.github.com> Date: Sun, 15 Dec 2024 13:44:05 -0800 Subject: [PATCH] api: add magicswap api urls for base chains --- apps/api/src/index.ts | 14 ++++++++++++++ packages/core/src/constants.ts | 12 +++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index 08c7aad0..49c57504 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -12,6 +12,8 @@ import { http, createConfig, fallback } from "@wagmi/core"; import { arbitrum, arbitrumSepolia, + base, + baseSepolia, mainnet, sepolia, } from "@wagmi/core/chains"; @@ -65,6 +67,8 @@ const main = async () => { arbitrumSepolia, mainnet, sepolia, + base, + baseSepolia, defineChain(TREASURE_CHAIN_DEFINITION), defineChain(TREASURE_TOPAZ_CHAIN_DEFINITION), ], @@ -93,6 +97,16 @@ const main = async () => { ), http(), ]), + [base.id]: fallback([ + http(`https://${base.id}.rpc.thirdweb.com/${env.THIRDWEB_CLIENT_ID}`), + http(), + ]), + [baseSepolia.id]: fallback([ + http( + `https://${baseSepolia.id}.rpc.thirdweb.com/${env.THIRDWEB_CLIENT_ID}`, + ), + http(), + ]), [TREASURE_CHAIN_DEFINITION.id]: fallback([ http( `https://${TREASURE_CHAIN_DEFINITION.id}.rpc.thirdweb.com/${env.THIRDWEB_CLIENT_ID}`, diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index 27d0098c..afebb2d3 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -1,5 +1,11 @@ import { defineChain } from "thirdweb"; -import { arbitrum, arbitrumSepolia, sepolia } from "thirdweb/chains"; +import { + arbitrum, + arbitrumSepolia, + base, + baseSepolia, + sepolia, +} from "thirdweb/chains"; import type { AddressString, Contract } from "./types"; @@ -79,6 +85,10 @@ export const MAGICSWAPV2_API_URL = { "https://api.goldsky.com/api/public/project_clrm53zqegpoi01x18coz2fb5/subgraphs/magicswap-dev-topaz/live/gn", [sepolia.id]: "https://api.goldsky.com/api/public/project_clrm53zqegpoi01x18coz2fb5/subgraphs/magicswap-dev-sepolia/live/gn", + [base.id]: + "https://api.goldsky.com/api/public/project_clrm53zqegpoi01x18coz2fb5/subgraphs/magicswap-base/live/gn", + [baseSepolia.id]: + "https://api.goldsky.com/api/public/project_clrm53zqegpoi01x18coz2fb5/subgraphs/magicswap-dev-base-sepolia/live/gn", } as const; // Tokens