-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d708888
commit f3367f5
Showing
10 changed files
with
169 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
import { configureChains, createConfig, fetchBlockNumber } from "@wagmi/core"; | ||
import { alchemyProvider } from "@wagmi/core/providers/alchemy"; | ||
import { publicProvider } from "@wagmi/core/providers/public"; | ||
import { createConfig, getBlockNumber, http } from "@wagmi/core"; | ||
import { type ExpoRequest, ExpoResponse } from "expo-router/server"; | ||
|
||
import { alchemyAPIKey, chain } from "../utils/constants"; | ||
import { chain, httpURL } from "../utils/constants"; | ||
|
||
const { publicClient, webSocketPublicClient } = configureChains( | ||
[chain], | ||
[alchemyAPIKey ? alchemyProvider({ apiKey: alchemyAPIKey }) : publicProvider()], | ||
); | ||
createConfig({ publicClient, webSocketPublicClient }); | ||
const wagmiConfig = createConfig({ chains: [chain], transports: { [chain.id]: http(httpURL) } }); | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export async function GET(_: ExpoRequest) { | ||
const blockNumber = await fetchBlockNumber(); | ||
const blockNumber = await getBlockNumber(wagmiConfig); | ||
return ExpoResponse.json(Number(blockNumber)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.