-
Notifications
You must be signed in to change notification settings - Fork 5
🐛 app: route owner rpc through alchemy #994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@exactly/mobile": patch | ||
| --- | ||
|
|
||
| 🐛 route owner rpc through alchemy |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,11 +1,13 @@ | ||||||||||||||||||||||||||||||||||||||
| import AsyncStorage from "@react-native-async-storage/async-storage"; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| import * as infra from "@account-kit/infra"; | ||||||||||||||||||||||||||||||||||||||
| import { sdk } from "@farcaster/miniapp-sdk"; | ||||||||||||||||||||||||||||||||||||||
| import { farcasterMiniApp as miniAppConnector } from "@farcaster/miniapp-wagmi-connector"; | ||||||||||||||||||||||||||||||||||||||
| import { http } from "viem"; | ||||||||||||||||||||||||||||||||||||||
| import * as chains from "viem/chains"; | ||||||||||||||||||||||||||||||||||||||
| import { createConfig, createStorage, custom, injected } from "wagmi"; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| import alchemyAPIKey from "@exactly/common/alchemyAPIKey"; | ||||||||||||||||||||||||||||||||||||||
| import chain from "@exactly/common/generated/chain"; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| import publicClient from "../publicClient"; | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -15,6 +17,14 @@ const config = createConfig({ | |||||||||||||||||||||||||||||||||||||
| connectors: [miniAppConnector(), injected()], | ||||||||||||||||||||||||||||||||||||||
| transports: { | ||||||||||||||||||||||||||||||||||||||
| ...Object.fromEntries(Object.values(chains).map((c) => [c.id, http()])), | ||||||||||||||||||||||||||||||||||||||
| ...Object.values(infra).reduce<Record<number, ReturnType<typeof http>>>((result, item) => { | ||||||||||||||||||||||||||||||||||||||
| if (typeof item !== "object" || !("id" in item) || !("rpcUrls" in item)) return result; | ||||||||||||||||||||||||||||||||||||||
| const c = item as { id: number; rpcUrls: { alchemy?: { http?: readonly string[] } } }; | ||||||||||||||||||||||||||||||||||||||
| const url = c.rpcUrls.alchemy?.http?.[0]; | ||||||||||||||||||||||||||||||||||||||
| if (!url) return result; | ||||||||||||||||||||||||||||||||||||||
| result[c.id] = http(`${url}/${alchemyAPIKey}`); | ||||||||||||||||||||||||||||||||||||||
| return result; | ||||||||||||||||||||||||||||||||||||||
| }, {}), | ||||||||||||||||||||||||||||||||||||||
|
dieguezguille marked this conversation as resolved.
Comment on lines
+20
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Empty When running locally with anvil,
Suggested change
Was this helpful? React with 👍 or 👎 to provide feedback. |
||||||||||||||||||||||||||||||||||||||
| [chain.id]: custom(publicClient), | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| storage: createStorage({ key: "wagmi.owner", storage: AsyncStorage }), | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.