Skip to content

Commit

Permalink
api: add magicswap api urls for base chains
Browse files Browse the repository at this point in the history
  • Loading branch information
alecananian committed Dec 15, 2024
1 parent 2455681 commit da427fe
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
14 changes: 14 additions & 0 deletions apps/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { http, createConfig, fallback } from "@wagmi/core";
import {
arbitrum,
arbitrumSepolia,
base,
baseSepolia,
mainnet,
sepolia,
} from "@wagmi/core/chains";
Expand Down Expand Up @@ -65,6 +67,8 @@ const main = async () => {
arbitrumSepolia,
mainnet,
sepolia,
base,
baseSepolia,
defineChain(TREASURE_CHAIN_DEFINITION),
defineChain(TREASURE_TOPAZ_CHAIN_DEFINITION),
],
Expand Down Expand Up @@ -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}`,
Expand Down
12 changes: 11 additions & 1 deletion packages/core/src/constants.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit da427fe

Please sign in to comment.