-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bridge-ui): Simplify the wallet connection modal (#509)
* feat(bridge-ui): Simplify the wallet connection modal * Fix copy on metadata Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com> Signed-off-by: Alain Nicolas <alainncls@users.noreply.github.com> --------- Signed-off-by: Alain Nicolas <alainncls@users.noreply.github.com> Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com>
- Loading branch information
1 parent
50d4516
commit 06294fd
Showing
5 changed files
with
758 additions
and
520 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,28 @@ | ||
import { defaultWagmiConfig } from "@web3modal/wagmi/react/config"; | ||
import { http, injected } from "@wagmi/core"; | ||
import { http } from "@wagmi/core"; | ||
import { mainnet, sepolia, linea, lineaSepolia } from "@wagmi/core/chains"; | ||
import { walletConnect, coinbaseWallet } from "@wagmi/connectors"; | ||
import { config } from "./config"; | ||
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi"; | ||
import { AppKitNetwork } from "@reown/appkit/networks"; | ||
|
||
if (!config.walletConnectId) throw new Error("Project ID is not defined"); | ||
|
||
const metadata = { | ||
name: "Linea Bridge", | ||
description: `Linea Bridge is a bridge solution, providing secure and efficient cross-chain transactions between Layer 1 and Linea networks. | ||
Discover the future of blockchain interaction with Linea Bridge.`, | ||
url: "https://bridge.linea.build", | ||
icons: [], | ||
}; | ||
export const chains: [AppKitNetwork, ...AppKitNetwork[]] = [mainnet, sepolia, linea, lineaSepolia]; | ||
|
||
const chains = [mainnet, sepolia, linea, lineaSepolia] as const; | ||
|
||
export const wagmiConfig = defaultWagmiConfig({ | ||
chains, | ||
export const wagmiAdapter = new WagmiAdapter({ | ||
networks: chains, | ||
projectId: config.walletConnectId, | ||
metadata, | ||
multiInjectedProviderDiscovery: true, | ||
ssr: true, | ||
enableEIP6963: true, | ||
|
||
batch: { | ||
multicall: true, | ||
}, | ||
connectors: [ | ||
walletConnect({ | ||
projectId: config.walletConnectId, | ||
showQrModal: false, | ||
}), | ||
injected({ shimDisconnect: true }), | ||
coinbaseWallet({ | ||
appName: "Linea Bridge", | ||
}), | ||
], | ||
transports: { | ||
[mainnet.id]: http(`https://mainnet.infura.io/v3/${process.env.NEXT_PUBLIC_INFURA_ID}`, { batch: true }), | ||
[sepolia.id]: http(`https://sepolia.infura.io/v3/${process.env.NEXT_PUBLIC_INFURA_ID}`, { batch: true }), | ||
[linea.id]: http(`https://linea-mainnet.infura.io/v3/${process.env.NEXT_PUBLIC_INFURA_ID}`, { batch: true }), | ||
[lineaSepolia.id]: http(`https://linea-sepolia.infura.io/v3/${process.env.NEXT_PUBLIC_INFURA_ID}`, { batch: true }), | ||
}, | ||
}); | ||
|
||
export const wagmiConfig = wagmiAdapter.wagmiConfig; |
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
Oops, something went wrong.